621 | NONE => |
621 | NONE => |
622 if get_silent (Context.Proof ctxt) |
622 if get_silent (Context.Proof ctxt) |
623 then Syntax.const "StateFun.lookup" $ Syntax.const "undefined" $ Syntax.free n $ s |
623 then Syntax.const "StateFun.lookup" $ Syntax.const "undefined" $ Syntax.free n $ s |
624 else raise TERM ("StateSpace.gen_lookup_tr: component " ^ n ^ " not defined",[])); |
624 else raise TERM ("StateSpace.gen_lookup_tr: component " ^ n ^ " not defined",[])); |
625 |
625 |
626 fun lookup_tr ctxt [s,Free (n,_)] = gen_lookup_tr ctxt s n; |
626 fun lookup_tr ctxt [s, x] = |
|
627 (case Syntax.strip_positions x of |
|
628 Free (n,_) => gen_lookup_tr ctxt s n |
|
629 | _ => raise Match); |
|
630 |
627 fun lookup_swap_tr ctxt [Free (n,_),s] = gen_lookup_tr ctxt s n; |
631 fun lookup_swap_tr ctxt [Free (n,_),s] = gen_lookup_tr ctxt s n; |
628 |
632 |
629 fun lookup_tr' ctxt [_$Free (prj,_),n as (_$Free (name,_)),s] = |
633 fun lookup_tr' ctxt [_$Free (prj,_),n as (_$Free (name,_)),s] = |
630 ( case get_comp (Context.Proof ctxt) name of |
634 ( case get_comp (Context.Proof ctxt) name of |
631 SOME (T,_) => if prj=project_name T then |
635 SOME (T,_) => if prj=project_name T then |
649 Syntax.const "undefined" $ Syntax.const "undefined" $ |
653 Syntax.const "undefined" $ Syntax.const "undefined" $ |
650 Syntax.free n $ (Syntax.const KN $ v) $ s |
654 Syntax.free n $ (Syntax.const KN $ v) $ s |
651 else raise TERM ("StateSpace.gen_update_tr: component " ^ n ^ " not defined",[])) |
655 else raise TERM ("StateSpace.gen_update_tr: component " ^ n ^ " not defined",[])) |
652 end; |
656 end; |
653 |
657 |
654 fun update_tr ctxt [s,Free (n,_),v] = gen_update_tr false ctxt n v s; |
658 fun update_tr ctxt [s, x, v] = |
|
659 (case Syntax.strip_positions x of |
|
660 Free (n, _) => gen_update_tr false ctxt n v s |
|
661 | _ => raise Match); |
655 |
662 |
656 fun update_tr' ctxt [_$Free (prj,_),_$Free (inj,_),n as (_$Free (name,_)),(Const (k,_)$v),s] = |
663 fun update_tr' ctxt [_$Free (prj,_),_$Free (inj,_),n as (_$Free (name,_)),(Const (k,_)$v),s] = |
657 if Long_Name.base_name k = Long_Name.base_name KN then |
664 if Long_Name.base_name k = Long_Name.base_name KN then |
658 (case get_comp (Context.Proof ctxt) name of |
665 (case get_comp (Context.Proof ctxt) name of |
659 SOME (T,_) => if inj=inject_name T andalso prj=project_name T then |
666 SOME (T,_) => if inj=inject_name T andalso prj=project_name T then |