equal
deleted
inserted
replaced
560 (case Vartab.lookup (binds, xi) of |
560 (case Vartab.lookup (binds, xi) of |
561 SOME (u, U) => |
561 SOME (u, U) => |
562 let |
562 let |
563 val env = unifyT ctxt (T, U) handle Type.TUNIFY => |
563 val env = unifyT ctxt (T, U) handle Type.TUNIFY => |
564 raise TYPE ("norm_term: ill-typed variable assignment", [T, U], [t, u]); |
564 raise TYPE ("norm_term: ill-typed variable assignment", [T, U], [t, u]); |
565 val u' = Term.subst_TVars_Vartab env u; |
565 val u' = Envir.subst_TVars env u; |
566 in norm u' handle SAME => u' end |
566 in norm u' handle SAME => u' end |
567 | NONE => |
567 | NONE => |
568 if schematic then raise SAME |
568 if schematic then raise SAME |
569 else raise CONTEXT ("Unbound schematic variable: " ^ Syntax.string_of_vname xi, ctxt)) |
569 else raise CONTEXT ("Unbound schematic variable: " ^ Syntax.string_of_vname xi, ctxt)) |
570 | norm (Abs (a, T, body)) = Abs (a, T, norm body) |
570 | norm (Abs (a, T, body)) = Abs (a, T, norm body) |
875 val domain = |
875 val domain = |
876 filter_out Term.is_replaced_dummy_pattern (map #1 (Drule.vars_of_terms (map #1 pairs))); |
876 filter_out Term.is_replaced_dummy_pattern (map #1 (Drule.vars_of_terms (map #1 pairs))); |
877 val _ = (*may not assign variables from text*) |
877 val _ = (*may not assign variables from text*) |
878 if null (map #1 (Envir.alist_of env) inter (map #1 (Drule.vars_of_terms (map #2 pairs)))) |
878 if null (map #1 (Envir.alist_of env) inter (map #1 (Drule.vars_of_terms (map #2 pairs)))) |
879 then () else fail (); |
879 then () else fail (); |
880 fun norm_bind (xi, t) = if xi mem domain then SOME (xi, Envir.norm_term env t) else NONE; |
880 fun norm_bind (xi, (_, t)) = if xi mem domain then SOME (xi, Envir.norm_term env t) else NONE; |
881 in List.mapPartial norm_bind (Envir.alist_of env) end; |
881 in List.mapPartial norm_bind (Envir.alist_of env) end; |
882 |
882 |
883 |
883 |
884 (* add_binds(_i) *) |
884 (* add_binds(_i) *) |
885 |
885 |