src/Provers/blast.ML
changeset 58958 114255dce178
parent 58957 c9e744ea8a38
child 58963 26bf09b95dda
equal deleted inserted replaced
58957:c9e744ea8a38 58958:114255dce178
   459   end
   459   end
   460   handle Bind => raise ElimBadConcl;
   460   handle Bind => raise ElimBadConcl;
   461 
   461 
   462 
   462 
   463 (*Like dup_elim, but puts the duplicated major premise FIRST*)
   463 (*Like dup_elim, but puts the duplicated major premise FIRST*)
   464 fun rev_dup_elim th = (th RSN (2, revcut_rl)) |> Thm.assumption NONE 2 |> Seq.hd;
   464 fun rev_dup_elim ctxt th = (th RSN (2, revcut_rl)) |> Thm.assumption (SOME ctxt) 2 |> Seq.hd;
   465 
   465 
   466 
   466 
   467 (*Rotate the assumptions in all new subgoals for the LIFO discipline*)
   467 (*Rotate the assumptions in all new subgoals for the LIFO discipline*)
   468 local
   468 local
   469   (*Count new hyps so that they can be rotated*)
   469   (*Count new hyps so that they can be rotated*)
   496   Flag "dup" requests duplication of the affected formula.*)
   496   Flag "dup" requests duplication of the affected formula.*)
   497 fun fromRule (state as State {ctxt, ...}) vars rl =
   497 fun fromRule (state as State {ctxt, ...}) vars rl =
   498   let val thy = Proof_Context.theory_of ctxt
   498   let val thy = Proof_Context.theory_of ctxt
   499       val trl = rl |> Thm.prop_of |> fromTerm thy |> convertRule state vars
   499       val trl = rl |> Thm.prop_of |> fromTerm thy |> convertRule state vars
   500       fun tac (upd, dup,rot) i =
   500       fun tac (upd, dup,rot) i =
   501         emtac ctxt upd (if dup then rev_dup_elim rl else rl) i
   501         emtac ctxt upd (if dup then rev_dup_elim ctxt rl else rl) i
   502         THEN
   502         THEN
   503         rot_subgoals_tac (rot, #2 trl) i
   503         rot_subgoals_tac (rot, #2 trl) i
   504   in Option.SOME (trl, tac) end
   504   in Option.SOME (trl, tac) end
   505   handle
   505   handle
   506     ElimBadPrem => (*reject: prems don't preserve conclusion*)
   506     ElimBadPrem => (*reject: prems don't preserve conclusion*)