21 val init: cterm -> thm |
21 val init: cterm -> thm |
22 val protect: int -> thm -> thm |
22 val protect: int -> thm -> thm |
23 val conclude: thm -> thm |
23 val conclude: thm -> thm |
24 val check_finished: Proof.context -> thm -> thm |
24 val check_finished: Proof.context -> thm -> thm |
25 val finish: Proof.context -> thm -> thm |
25 val finish: Proof.context -> thm -> thm |
26 val norm_result: thm -> thm |
26 val norm_result: Proof.context -> thm -> thm |
27 val skip_proofs_enabled: unit -> bool |
27 val skip_proofs_enabled: unit -> bool |
28 val future_enabled: int -> bool |
28 val future_enabled: int -> bool |
29 val future_enabled_timing: Time.time -> bool |
29 val future_enabled_timing: Time.time -> bool |
30 val future_result: Proof.context -> thm future -> term -> thm |
30 val future_result: Proof.context -> thm future -> term -> thm |
31 val prove_internal: cterm list -> cterm -> (thm list -> tactic) -> thm |
31 val prove_internal: Proof.context -> cterm list -> cterm -> (thm list -> tactic) -> thm |
32 val is_schematic: term -> bool |
32 val is_schematic: term -> bool |
33 val prove_multi: Proof.context -> string list -> term list -> term list -> |
33 val prove_multi: Proof.context -> string list -> term list -> term list -> |
34 ({prems: thm list, context: Proof.context} -> tactic) -> thm list |
34 ({prems: thm list, context: Proof.context} -> tactic) -> thm list |
35 val prove_future: Proof.context -> string list -> term list -> term -> |
35 val prove_future: Proof.context -> string list -> term list -> term -> |
36 ({prems: thm list, context: Proof.context} -> tactic) -> thm |
36 ({prems: thm list, context: Proof.context} -> tactic) -> thm |
164 |
164 |
165 (** tactical theorem proving **) |
165 (** tactical theorem proving **) |
166 |
166 |
167 (* prove_internal -- minimal checks, no normalization of result! *) |
167 (* prove_internal -- minimal checks, no normalization of result! *) |
168 |
168 |
169 fun prove_internal casms cprop tac = |
169 fun prove_internal ctxt casms cprop tac = |
170 (case SINGLE (tac (map Assumption.assume casms)) (init cprop) of |
170 (case SINGLE (tac (map (Assumption.assume ctxt) casms)) (init cprop) of |
171 SOME th => Drule.implies_intr_list casms |
171 SOME th => Drule.implies_intr_list casms |
172 (finish (Syntax.init_pretty_global (Thm.theory_of_thm th)) th) |
172 (finish (Syntax.init_pretty_global (Thm.theory_of_thm th)) th) |
173 | NONE => error "Tactic failed"); |
173 | NONE => error "Tactic failed"); |
174 |
174 |
175 |
175 |
334 let |
334 let |
335 val ((_, goal'), ctxt') = Variable.focus_cterm goal ctxt; |
335 val ((_, goal'), ctxt') = Variable.focus_cterm goal ctxt; |
336 val goal'' = Drule.cterm_rule (singleton (Variable.export ctxt' ctxt)) goal'; |
336 val goal'' = Drule.cterm_rule (singleton (Variable.export ctxt' ctxt)) goal'; |
337 val Rs = filter (non_atomic o Thm.term_of) (Drule.strip_imp_prems goal''); |
337 val Rs = filter (non_atomic o Thm.term_of) (Drule.strip_imp_prems goal''); |
338 val tacs = Rs |> map (fn R => |
338 val tacs = Rs |> map (fn R => |
339 etac (Raw_Simplifier.norm_hhf (Thm.trivial R)) THEN_ALL_NEW assume_tac); |
339 etac (Raw_Simplifier.norm_hhf ctxt (Thm.trivial R)) THEN_ALL_NEW assume_tac); |
340 in fold_rev (curry op APPEND') tacs (K no_tac) i end); |
340 in fold_rev (curry op APPEND') tacs (K no_tac) i end); |
341 |
341 |
342 |
342 |
343 |
343 |
344 (** parallel tacticals **) |
344 (** parallel tacticals **) |