equal
deleted
inserted
replaced
603 | exprgen_classlookup thy tabs (ClassPackage.Lookup (clss, (v, (i, j)))) trns = |
603 | exprgen_classlookup thy tabs (ClassPackage.Lookup (clss, (v, (i, j)))) trns = |
604 trns |
604 trns |
605 |> fold_map (ensure_def_class thy tabs) clss |
605 |> fold_map (ensure_def_class thy tabs) clss |
606 |-> (fn clss => pair (Lookup (clss, (v |> unprefix "'", if j = 1 then ~1 else i)))) |
606 |-> (fn clss => pair (Lookup (clss, (v |> unprefix "'", if j = 1 then ~1 else i)))) |
607 and mk_fun thy tabs (c, ty) trns = |
607 and mk_fun thy tabs (c, ty) trns = |
608 case CodegenTheorems.get_funs thy (c, Type.varifyT ty) |
608 case CodegenTheorems.get_funs thy (c, Logic.legacy_varifyT ty) (* FIXME *) |
609 of SOME (ty, eq_thms) => |
609 of SOME (ty, eq_thms) => |
610 let |
610 let |
611 val sortctxt = ClassPackage.extract_sortctxt thy ty; |
611 val sortctxt = ClassPackage.extract_sortctxt thy ty; |
612 fun dest_eqthm eq_thm = |
612 fun dest_eqthm eq_thm = |
613 let |
613 let |
847 trns |
847 trns |
848 |> appgen_default thy tabs app; |
848 |> appgen_default thy tabs app; |
849 |
849 |
850 fun appgen_wfrec thy tabs ((c, ty), [_, tf, tx]) trns = |
850 fun appgen_wfrec thy tabs ((c, ty), [_, tf, tx]) trns = |
851 let |
851 let |
852 val ty_def = (op ---> o apfst tl o strip_type o Type.unvarifyT o Sign.the_const_type thy) c; |
852 val ty_def = (op ---> o apfst tl o strip_type o Logic.legacy_unvarifyT o Sign.the_const_type thy) c; |
853 val ty' = (op ---> o apfst tl o strip_type) ty; |
853 val ty' = (op ---> o apfst tl o strip_type) ty; |
854 val idf = idf_of_const thy tabs (c, ty); |
854 val idf = idf_of_const thy tabs (c, ty); |
855 in |
855 in |
856 trns |
856 trns |
857 |> ensure_def [("wfrec", (K o succeed) Undef)] ("generating wfrec") idf |
857 |> ensure_def [("wfrec", (K o succeed) Undef)] ("generating wfrec") idf |