clarified specific use of inspect_contract: "any Bound variable will do" may render the term invalid for Term.fastype_of1 in inst_subst_tac (see also 7c3757fccf0e);
authorwenzelm
Thu, 09 Jul 2015 22:13:24 +0200
changeset 60706 03a6b1792cd8
parent 60705 6cc14cf3acff
child 60707 e96b7be56d44
clarified specific use of inspect_contract: "any Bound variable will do" may render the term invalid for Term.fastype_of1 in inst_subst_tac (see also 7c3757fccf0e);
src/Provers/hypsubst.ML
--- a/src/Provers/hypsubst.ML	Thu Jul 09 22:08:20 2015 +0200
+++ b/src/Provers/hypsubst.ML	Thu Jul 09 22:13:24 2015 +0200
@@ -61,7 +61,7 @@
 
 (*Simplifier turns Bound variables to special Free variables:
   change it back (any Bound variable will do)*)
-fun contract t =
+fun inspect_contract t =
   (case Envir.eta_contract t of
     Free (a, T) => if Name.is_bound a then Bound 0 else Free (a, T)
   | t' => t');
@@ -84,7 +84,7 @@
   if novars andalso (has_tvars t orelse has_tvars u)
   then raise Match   (*variables in the type!*)
   else
-    (case (contract t, contract u) of
+    (case apply2 inspect_contract (t, u) of
       (Bound i, _) =>
         if loose_bvar1 (u, i) orelse novars andalso has_vars u
         then raise Match
@@ -165,7 +165,7 @@
 
 fun inst_subst_tac ctxt b rl = CSUBGOAL (fn (cBi, i) =>
   case try (Logic.strip_assums_hyp #> hd #>
-      Data.dest_Trueprop #> Data.dest_eq #> apply2 contract) (Thm.term_of cBi) of
+      Data.dest_Trueprop #> Data.dest_eq #> apply2 Envir.eta_contract) (Thm.term_of cBi) of
     SOME (t, t') =>
       let
         val Bi = Thm.term_of cBi;