src/Pure/Proof/proof_rewrite_rules.ML
changeset 36042 85efdadee8ae
parent 33722 e588744f14da
child 36744 6e1f3d609a68
equal deleted inserted replaced
36041:8b25e3b217bc 36042:85efdadee8ae
   177       | rew' ((prf as PAxm ("Pure.combination", _, _) %
   177       | rew' ((prf as PAxm ("Pure.combination", _, _) %
   178         SOME ((eq as Const ("==", T)) $ t) % _ % _ % _) %%
   178         SOME ((eq as Const ("==", T)) $ t) % _ % _ % _) %%
   179           (PAxm ("Pure.reflexive", _, _) % _)) =
   179           (PAxm ("Pure.reflexive", _, _) % _)) =
   180         let val (U, V) = (case T of
   180         let val (U, V) = (case T of
   181           Type (_, [U, V]) => (U, V) | _ => (dummyT, dummyT))
   181           Type (_, [U, V]) => (U, V) | _ => (dummyT, dummyT))
   182         in SOME (prf %% (ax combination_axm [V, U] %> eq % ?? eq % ?? t % ?? t %%
   182         in SOME (prf %% (ax combination_axm [U, V] %> eq % ?? eq % ?? t % ?? t %%
   183           (ax reflexive_axm [T] % ?? eq) %% (ax reflexive_axm [U] % ?? t)))
   183           (ax reflexive_axm [T] % ?? eq) %% (ax reflexive_axm [U] % ?? t)))
   184         end
   184         end
   185 
   185 
   186       | rew' _ = NONE;
   186       | rew' _ = NONE;
   187   in rew' #> Option.map (rpair no_skel) end;
   187   in rew' #> Option.map (rpair no_skel) end;
   227   | insert_refl defs Ts prf = (case strip_combt prf of
   227   | insert_refl defs Ts prf = (case strip_combt prf of
   228         (PThm (_, ((s, prop, SOME Ts), _)), ts) =>
   228         (PThm (_, ((s, prop, SOME Ts), _)), ts) =>
   229           if member (op =) defs s then
   229           if member (op =) defs s then
   230             let
   230             let
   231               val vs = vars_of prop;
   231               val vs = vars_of prop;
   232               val tvars = OldTerm.term_tvars prop;
   232               val tvars = Term.add_tvars prop [] |> rev;
   233               val (_, rhs) = Logic.dest_equals prop;
   233               val (_, rhs) = Logic.dest_equals prop;
   234               val rhs' = Term.betapplys (subst_TVars (map fst tvars ~~ Ts)
   234               val rhs' = Term.betapplys (subst_TVars (map fst tvars ~~ Ts)
   235                 (fold_rev (fn x => fn b => Abs ("", dummyT, abstract_over (x, b))) vs rhs),
   235                 (fold_rev (fn x => fn b => Abs ("", dummyT, abstract_over (x, b))) vs rhs),
   236                 map the ts);
   236                 map the ts);
   237             in
   237             in