795 val (thy, tye, _) = fold_rev add_types ctpairs (Thm.theory_of_thm th, Vartab.empty, 0); |
795 val (thy, tye, _) = fold_rev add_types ctpairs (Thm.theory_of_thm th, Vartab.empty, 0); |
796 val certT = ctyp_of thy; |
796 val certT = ctyp_of thy; |
797 val instT = |
797 val instT = |
798 Vartab.fold (fn (xi, (S, T)) => |
798 Vartab.fold (fn (xi, (S, T)) => |
799 cons (certT (TVar (xi, S)), certT (Envir.norm_type tye T))) tye []; |
799 cons (certT (TVar (xi, S)), certT (Envir.norm_type tye T))) tye []; |
800 val inst = map (pairself (Thm.instantiate_cterm (instT, []))) ctpairs; |
800 val inst = map (apply2 (Thm.instantiate_cterm (instT, []))) ctpairs; |
801 in instantiate_normalize (instT, inst) th end |
801 in instantiate_normalize (instT, inst) th end |
802 handle TERM (msg, _) => raise THM (msg, 0, [th]) |
802 handle TERM (msg, _) => raise THM (msg, 0, [th]) |
803 | TYPE (msg, _, _) => raise THM (msg, 0, [th]); |
803 | TYPE (msg, _, _) => raise THM (msg, 0, [th]); |
804 end; |
804 end; |
805 |
805 |