File ‹intprover.ML›
signature INT_PROVER =
sig
val best_tac: Proof.context -> int -> tactic
val best_dup_tac: Proof.context -> int -> tactic
val fast_tac: Proof.context -> int -> tactic
val inst_step_tac: Proof.context -> int -> tactic
val safe_step_tac: Proof.context -> int -> tactic
val safe_brls: (bool * thm) list
val safe_tac: Proof.context -> tactic
val step_tac: Proof.context -> int -> tactic
val step_dup_tac: Proof.context -> int -> tactic
val haz_brls: (bool * thm) list
val haz_dup_brls: (bool * thm) list
end;
structure IntPr : INT_PROVER =
struct
val safe_brls = sort (make_ord lessb)
[ (true, @{thm FalseE}), (false, @{thm TrueI}), (false, @{thm refl}),
(false, @{thm impI}), (false, @{thm notI}), (false, @{thm allI}),
(true, @{thm conjE}), (true, @{thm exE}),
(false, @{thm conjI}), (true, @{thm conj_impE}),
(true, @{thm disj_impE}), (true, @{thm disjE}),
(false, @{thm iffI}), (true, @{thm iffE}), (true, @{thm not_to_imp}) ];
val haz_brls =
[ (false, @{thm disjI1}), (false, @{thm disjI2}), (false, @{thm exI}),
(true, @{thm allE}), (true, @{thm not_impE}), (true, @{thm imp_impE}), (true, @{thm iff_impE}),
(true, @{thm all_impE}), (true, @{thm ex_impE}), (true, @{thm impE}) ];
val haz_dup_brls =
[ (false, @{thm disjI1}), (false, @{thm disjI2}), (false, @{thm exI}),
(true, @{thm all_dupE}), (true, @{thm not_impE}), (true, @{thm imp_impE}), (true, @{thm iff_impE}),
(true, @{thm all_impE}), (true, @{thm ex_impE}), (true, @{thm impE}) ];
val (safe0_brls, safep_brls) =
List.partition (curry (op =) 0 o subgoals_of_brl) safe_brls;
fun safe_step_tac ctxt =
FIRST' [
eq_assume_tac,
eq_mp_tac ctxt,
bimatch_tac ctxt safe0_brls,
hyp_subst_tac ctxt,
bimatch_tac ctxt safep_brls];
fun safe_tac ctxt = REPEAT_DETERM_FIRST (safe_step_tac ctxt);
fun inst_step_tac ctxt =
assume_tac ctxt APPEND' mp_tac ctxt APPEND'
biresolve_tac ctxt (safe0_brls @ safep_brls);
fun step_tac ctxt i =
FIRST [safe_tac ctxt, inst_step_tac ctxt i, biresolve_tac ctxt haz_brls i];
fun step_dup_tac ctxt i =
FIRST [safe_tac ctxt, inst_step_tac ctxt i, biresolve_tac ctxt haz_dup_brls i];
fun fast_tac ctxt = SELECT_GOAL (DEPTH_SOLVE (step_tac ctxt 1));
fun best_tac ctxt =
SELECT_GOAL (BEST_FIRST (has_fewer_prems 1, size_of_thm) (step_tac ctxt 1));
fun best_dup_tac ctxt =
SELECT_GOAL (BEST_FIRST (has_fewer_prems 1, size_of_thm) (step_dup_tac ctxt 1));
end;