src/HOL/Tools/reification.ML
changeset 60696 8304fb4fb823
parent 60642 48dd1cefb4ae
child 60752 b48830b670a1
equal deleted inserted replaced
60695:757549b4bbe6 60696:8304fb4fb823
    21 
    21 
    22 fun rewrite_with ctxt eqs = Simplifier.rewrite (put_simpset HOL_basic_ss ctxt addsimps eqs);
    22 fun rewrite_with ctxt eqs = Simplifier.rewrite (put_simpset HOL_basic_ss ctxt addsimps eqs);
    23 
    23 
    24 val pure_subst = @{lemma "x == y ==> PROP P y ==> PROP P x" by simp}
    24 val pure_subst = @{lemma "x == y ==> PROP P y ==> PROP P x" by simp}
    25 
    25 
    26 fun lift_conv ctxt conv some_t = Subgoal.FOCUS (fn { concl, ... } =>
    26 fun lift_conv ctxt conv some_t = Subgoal.FOCUS (fn {context = ctxt', concl, ...} =>
    27   let
    27   let
    28     val ct = case some_t
    28     val ct =
    29      of NONE => Thm.dest_arg concl
    29       (case some_t of
    30       | SOME t => Thm.cterm_of ctxt t
    30         NONE => Thm.dest_arg concl
       
    31       | SOME t => Thm.cterm_of ctxt' t)
    31     val thm = conv ct;
    32     val thm = conv ct;
    32   in
    33   in
    33     if Thm.is_reflexive thm then no_tac
    34     if Thm.is_reflexive thm then no_tac
    34     else ALLGOALS (rtac (pure_subst OF [thm]))
    35     else ALLGOALS (rtac (pure_subst OF [thm]))
    35   end) ctxt;
    36   end) ctxt;