equal
deleted
inserted
replaced
4 Goals in tactical theorem proving. |
4 Goals in tactical theorem proving. |
5 *) |
5 *) |
6 |
6 |
7 signature BASIC_GOAL = |
7 signature BASIC_GOAL = |
8 sig |
8 sig |
|
9 val parallel_proofs: bool ref |
9 val SELECT_GOAL: tactic -> int -> tactic |
10 val SELECT_GOAL: tactic -> int -> tactic |
10 val CONJUNCTS: tactic -> int -> tactic |
11 val CONJUNCTS: tactic -> int -> tactic |
11 val PRECISE_CONJUNCTS: int -> tactic -> int -> tactic |
12 val PRECISE_CONJUNCTS: int -> tactic -> int -> tactic |
12 end; |
13 end; |
13 |
14 |
121 |> Thm.instantiate (instT, []) |
122 |> Thm.instantiate (instT, []) |
122 |> Drule.forall_elim_list fixes |
123 |> Drule.forall_elim_list fixes |
123 |> fold (Thm.elim_implies o Thm.assume) assms; |
124 |> fold (Thm.elim_implies o Thm.assume) assms; |
124 in local_result end; |
125 in local_result end; |
125 |
126 |
|
127 val parallel_proofs = ref true; |
|
128 |
126 |
129 |
127 |
130 |
128 (** tactical theorem proving **) |
131 (** tactical theorem proving **) |
129 |
132 |
130 (* prove_internal -- minimal checks, no normalization of result! *) |
133 (* prove_internal -- minimal checks, no normalization of result! *) |
170 if Unify.matches_list thy [Thm.term_of stmt] [Thm.prop_of res] |
173 if Unify.matches_list thy [Thm.term_of stmt] [Thm.prop_of res] |
171 then Thm.check_shyps sorts res |
174 then Thm.check_shyps sorts res |
172 else err ("Proved a different theorem: " ^ string_of_term (Thm.prop_of res)) |
175 else err ("Proved a different theorem: " ^ string_of_term (Thm.prop_of res)) |
173 end); |
176 end); |
174 val res = |
177 val res = |
175 if immediate orelse #maxidx (Thm.rep_cterm stmt) >= 0 orelse not (Future.enabled ()) |
178 if immediate orelse #maxidx (Thm.rep_cterm stmt) >= 0 orelse |
|
179 not (Future.enabled () andalso ! parallel_proofs) |
176 then result () |
180 then result () |
177 else future_result ctxt' (Future.fork_pri ~1 result) (Thm.term_of stmt); |
181 else future_result ctxt' (Future.fork_pri ~1 result) (Thm.term_of stmt); |
178 in |
182 in |
179 Conjunction.elim_balanced (length props) res |
183 Conjunction.elim_balanced (length props) res |
180 |> map (Assumption.export false ctxt' ctxt) |
184 |> map (Assumption.export false ctxt' ctxt) |