33 'a list -> |
33 'a list -> |
34 'b list -> |
34 'b list -> |
35 ('a * 'b) list -> ('a * 'b) list * ('a list * 'b list) |
35 ('a * 'b) list -> ('a * 'b) list * ('a list * 'b list) |
36 |
36 |
37 val consts_in : term -> term list |
37 val consts_in : term -> term list |
38 val head_quantified_variable : |
38 val head_quantified_variable : Proof.context -> int -> thm -> (string * typ) option |
39 int -> thm -> (string * typ) option |
|
40 val push_allvar_in : string -> term -> term |
39 val push_allvar_in : string -> term -> term |
41 val strip_top_All_var : term -> (string * typ) * term |
40 val strip_top_All_var : term -> (string * typ) * term |
42 val strip_top_All_vars : term -> (string * typ) list * term |
41 val strip_top_All_vars : term -> (string * typ) list * term |
43 val strip_top_all_vars : |
42 val strip_top_all_vars : |
44 (string * typ) list -> term -> (string * typ) list * term |
43 (string * typ) list -> term -> (string * typ) list * term |
45 val trace_tac' : |
44 val trace_tac' : Proof.context -> string -> |
46 string -> |
|
47 ('a -> thm -> 'b Seq.seq) -> 'a -> thm -> 'b Seq.seq |
45 ('a -> thm -> 'b Seq.seq) -> 'a -> thm -> 'b Seq.seq |
48 val try_dest_Trueprop : term -> term |
46 val try_dest_Trueprop : term -> term |
49 |
47 |
50 val type_devar : ((indexname * sort) * typ) list -> term -> term |
48 val type_devar : ((indexname * sort) * typ) list -> term -> term |
51 val diff_and_instantiate : Proof.context -> thm -> term -> term -> thm |
49 val diff_and_instantiate : Proof.context -> thm -> term -> term -> thm |
52 |
50 |
53 val batter : int -> tactic |
51 val batter_tac : Proof.context -> int -> tactic |
54 val break_hypotheses : int -> tactic |
52 val break_hypotheses_tac : Proof.context -> int -> tactic |
55 val clause_breaker : int -> tactic |
53 val clause_breaker_tac : Proof.context -> int -> tactic |
56 (* val dist_all_and_tac : Proof.context -> int -> tactic *)(*FIXME unused*) |
54 (* val dist_all_and_tac : Proof.context -> int -> tactic *)(*FIXME unused*) |
57 val reassociate_conjs_tac : Proof.context -> int -> tactic |
55 val reassociate_conjs_tac : Proof.context -> int -> tactic |
58 |
56 |
59 val ASAP : (int -> tactic) -> (int -> tactic) -> int -> tactic |
57 val ASAP : (int -> tactic) -> (int -> tactic) -> int -> tactic |
60 val COND' : |
58 val COND' : |
614 end |
612 end |
615 |
613 |
616 |
614 |
617 (** Some tactics **) |
615 (** Some tactics **) |
618 |
616 |
619 val break_hypotheses = |
617 fun break_hypotheses_tac ctxt = |
620 ((REPEAT_DETERM o etac @{thm conjE}) |
618 CHANGED o |
621 THEN' (REPEAT_DETERM o etac @{thm disjE}) |
619 ((REPEAT_DETERM o eresolve_tac ctxt @{thms conjE}) THEN' |
622 ) #> CHANGED |
620 (REPEAT_DETERM o eresolve_tac ctxt @{thms disjE})) |
623 |
621 |
624 (*Prove subgoals of form A ==> B1 | ... | A | ... | Bn*) |
622 (*Prove subgoals of form A ==> B1 | ... | A | ... | Bn*) |
625 val clause_breaker = |
623 fun clause_breaker_tac ctxt = |
626 (REPEAT o (resolve0_tac [@{thm "disjI1"}, @{thm "disjI2"}, @{thm "conjI"}])) |
624 (REPEAT o resolve_tac ctxt @{thms disjI1 disjI2 conjI}) THEN' |
627 THEN' atac |
625 assume_tac ctxt |
628 |
626 |
629 (* |
627 (* |
630 Refines a subgoal have the form: |
628 Refines a subgoal have the form: |
631 A1 ... An ==> B1 | ... | Aj | ... | Bi | ... | Ak | ... |
629 A1 ... An ==> B1 | ... | Aj | ... | Bi | ... | Ak | ... |
632 into multiple subgoals of the form: |
630 into multiple subgoals of the form: |
634 : |
632 : |
635 A'm ==> B1 | ... | Aj | ... | Bi | ... | Ak | ... |
633 A'm ==> B1 | ... | Aj | ... | Bi | ... | Ak | ... |
636 where {A'1 .. A'm} is disjoint from {B1, ..., Aj, ..., Bi, ..., Ak, ...} |
634 where {A'1 .. A'm} is disjoint from {B1, ..., Aj, ..., Bi, ..., Ak, ...} |
637 (and solves the subgoal completely if the first set is empty) |
635 (and solves the subgoal completely if the first set is empty) |
638 *) |
636 *) |
639 val batter = |
637 fun batter_tac ctxt i = |
640 break_hypotheses |
638 break_hypotheses_tac ctxt i THEN |
641 THEN' K (ALLGOALS (TRY o clause_breaker)) |
639 ALLGOALS (TRY o clause_breaker_tac ctxt) |
642 |
640 |
643 (*Same idiom as ex_expander_tac*) |
641 (*Same idiom as ex_expander_tac*) |
644 fun dist_all_and_tac ctxt i = |
642 fun dist_all_and_tac ctxt i = |
645 let |
643 let |
646 val simpset = |
644 val simpset = |
777 end |
772 end |
778 |
773 |
779 |
774 |
780 (** Tracing **) |
775 (** Tracing **) |
781 (*If "tac i st" succeeds then msg is printed to "trace" channel*) |
776 (*If "tac i st" succeeds then msg is printed to "trace" channel*) |
782 fun trace_tac' msg tac i st = |
777 fun trace_tac' ctxt msg tac i st = |
783 let |
778 let |
784 val thy = Thm.theory_of_thm st |
|
785 val ctxt = Proof_Context.init_global thy |
|
786 val result = tac i st |
779 val result = tac i st |
787 in |
780 in |
788 if Config.get ctxt tptp_trace_reconstruction andalso |
781 if Config.get ctxt tptp_trace_reconstruction andalso |
789 not (is_none (Seq.pull result)) then |
782 not (is_none (Seq.pull result)) then |
790 (tracing msg; result) |
783 (tracing msg; result) |