author | wenzelm |
Thu, 04 Dec 2008 23:00:58 +0100 | |
changeset 28973 | c549650d1442 |
parent 28619 | 89f9dd800a22 |
child 29088 | 95a239a5e055 |
permissions | -rw-r--r-- |
17980 | 1 |
(* Title: Pure/goal.ML |
2 |
ID: $Id$ |
|
3 |
Author: Makarius and Lawrence C Paulson |
|
4 |
||
18139 | 5 |
Goals in tactical theorem proving. |
17980 | 6 |
*) |
7 |
||
8 |
signature BASIC_GOAL = |
|
9 |
sig |
|
10 |
val SELECT_GOAL: tactic -> int -> tactic |
|
23418 | 11 |
val CONJUNCTS: tactic -> int -> tactic |
23414
927203ad4b3a
tuned conjunction tactics: slightly smaller proof terms;
wenzelm
parents:
23356
diff
changeset
|
12 |
val PRECISE_CONJUNCTS: int -> tactic -> int -> tactic |
17980 | 13 |
end; |
14 |
||
15 |
signature GOAL = |
|
16 |
sig |
|
17 |
include BASIC_GOAL |
|
18 |
val init: cterm -> thm |
|
18027
09ab79d4e8e1
renamed Goal constant to prop, more general protect/unprotect interfaces;
wenzelm
parents:
17986
diff
changeset
|
19 |
val protect: thm -> thm |
17980 | 20 |
val conclude: thm -> thm |
21 |
val finish: thm -> thm |
|
21604
1af327306c8e
added norm/close_result (supercede local_standard etc.);
wenzelm
parents:
21579
diff
changeset
|
22 |
val norm_result: thm -> thm |
28973
c549650d1442
future proofs: pass actual futures to facilitate composite computations;
wenzelm
parents:
28619
diff
changeset
|
23 |
val future_result: Proof.context -> thm future -> term -> thm |
23356 | 24 |
val prove_internal: cterm list -> cterm -> (thm list -> tactic) -> thm |
20290 | 25 |
val prove_multi: Proof.context -> string list -> term list -> term list -> |
26 |
({prems: thm list, context: Proof.context} -> tactic) -> thm list |
|
28446
a01de3b3fa2e
renamed promise to future, tuned related interfaces;
wenzelm
parents:
28363
diff
changeset
|
27 |
val prove_future: Proof.context -> string list -> term list -> term -> |
28340 | 28 |
({prems: thm list, context: Proof.context} -> tactic) -> thm |
20290 | 29 |
val prove: Proof.context -> string list -> term list -> term -> |
30 |
({prems: thm list, context: Proof.context} -> tactic) -> thm |
|
26713
1c6181def1d0
prove_global: Variable.set_body true, pass context;
wenzelm
parents:
26628
diff
changeset
|
31 |
val prove_global: theory -> string list -> term list -> term -> |
1c6181def1d0
prove_global: Variable.set_body true, pass context;
wenzelm
parents:
26628
diff
changeset
|
32 |
({prems: thm list, context: Proof.context} -> tactic) -> thm |
19184 | 33 |
val extract: int -> int -> thm -> thm Seq.seq |
34 |
val retrofit: int -> int -> thm -> thm -> thm Seq.seq |
|
23418 | 35 |
val conjunction_tac: int -> tactic |
23414
927203ad4b3a
tuned conjunction tactics: slightly smaller proof terms;
wenzelm
parents:
23356
diff
changeset
|
36 |
val precise_conjunction_tac: int -> int -> tactic |
23418 | 37 |
val recover_conjunction_tac: tactic |
21687 | 38 |
val norm_hhf_tac: int -> tactic |
39 |
val compose_hhf_tac: thm -> int -> tactic |
|
23237 | 40 |
val assume_rule_tac: Proof.context -> int -> tactic |
17980 | 41 |
end; |
42 |
||
43 |
structure Goal: GOAL = |
|
44 |
struct |
|
45 |
||
18027
09ab79d4e8e1
renamed Goal constant to prop, more general protect/unprotect interfaces;
wenzelm
parents:
17986
diff
changeset
|
46 |
(** goals **) |
09ab79d4e8e1
renamed Goal constant to prop, more general protect/unprotect interfaces;
wenzelm
parents:
17986
diff
changeset
|
47 |
|
09ab79d4e8e1
renamed Goal constant to prop, more general protect/unprotect interfaces;
wenzelm
parents:
17986
diff
changeset
|
48 |
(* |
09ab79d4e8e1
renamed Goal constant to prop, more general protect/unprotect interfaces;
wenzelm
parents:
17986
diff
changeset
|
49 |
-------- (init) |
09ab79d4e8e1
renamed Goal constant to prop, more general protect/unprotect interfaces;
wenzelm
parents:
17986
diff
changeset
|
50 |
C ==> #C |
09ab79d4e8e1
renamed Goal constant to prop, more general protect/unprotect interfaces;
wenzelm
parents:
17986
diff
changeset
|
51 |
*) |
20290 | 52 |
val init = |
22902
ac833b4bb7ee
moved some Drule operations to Thm (see more_thm.ML);
wenzelm
parents:
21687
diff
changeset
|
53 |
let val A = #1 (Thm.dest_implies (Thm.cprop_of Drule.protectI)) |
20290 | 54 |
in fn C => Thm.instantiate ([], [(A, C)]) Drule.protectI end; |
17980 | 55 |
|
56 |
(* |
|
18119 | 57 |
C |
58 |
--- (protect) |
|
59 |
#C |
|
17980 | 60 |
*) |
21579 | 61 |
fun protect th = th COMP_INCR Drule.protectI; |
17980 | 62 |
|
63 |
(* |
|
18027
09ab79d4e8e1
renamed Goal constant to prop, more general protect/unprotect interfaces;
wenzelm
parents:
17986
diff
changeset
|
64 |
A ==> ... ==> #C |
09ab79d4e8e1
renamed Goal constant to prop, more general protect/unprotect interfaces;
wenzelm
parents:
17986
diff
changeset
|
65 |
---------------- (conclude) |
17980 | 66 |
A ==> ... ==> C |
67 |
*) |
|
68 |
fun conclude th = |
|
18497 | 69 |
(case SINGLE (Thm.compose_no_flatten false (th, Thm.nprems_of th) 1) |
18027
09ab79d4e8e1
renamed Goal constant to prop, more general protect/unprotect interfaces;
wenzelm
parents:
17986
diff
changeset
|
70 |
(Drule.incr_indexes th Drule.protectD) of |
17980 | 71 |
SOME th' => th' |
72 |
| NONE => raise THM ("Failed to conclude goal", 0, [th])); |
|
73 |
||
74 |
(* |
|
18027
09ab79d4e8e1
renamed Goal constant to prop, more general protect/unprotect interfaces;
wenzelm
parents:
17986
diff
changeset
|
75 |
#C |
09ab79d4e8e1
renamed Goal constant to prop, more general protect/unprotect interfaces;
wenzelm
parents:
17986
diff
changeset
|
76 |
--- (finish) |
09ab79d4e8e1
renamed Goal constant to prop, more general protect/unprotect interfaces;
wenzelm
parents:
17986
diff
changeset
|
77 |
C |
17983 | 78 |
*) |
17980 | 79 |
fun finish th = |
80 |
(case Thm.nprems_of th of |
|
81 |
0 => conclude th |
|
82 |
| n => raise THM ("Proof failed.\n" ^ |
|
83 |
Pretty.string_of (Pretty.chunks (Display.pretty_goals n th)) ^ |
|
84 |
("\n" ^ string_of_int n ^ " unsolved goal(s)!"), 0, [th])); |
|
85 |
||
86 |
||
18027
09ab79d4e8e1
renamed Goal constant to prop, more general protect/unprotect interfaces;
wenzelm
parents:
17986
diff
changeset
|
87 |
|
09ab79d4e8e1
renamed Goal constant to prop, more general protect/unprotect interfaces;
wenzelm
parents:
17986
diff
changeset
|
88 |
(** results **) |
09ab79d4e8e1
renamed Goal constant to prop, more general protect/unprotect interfaces;
wenzelm
parents:
17986
diff
changeset
|
89 |
|
28340 | 90 |
(* normal form *) |
91 |
||
21604
1af327306c8e
added norm/close_result (supercede local_standard etc.);
wenzelm
parents:
21579
diff
changeset
|
92 |
val norm_result = |
1af327306c8e
added norm/close_result (supercede local_standard etc.);
wenzelm
parents:
21579
diff
changeset
|
93 |
Drule.flexflex_unique |
1af327306c8e
added norm/close_result (supercede local_standard etc.);
wenzelm
parents:
21579
diff
changeset
|
94 |
#> MetaSimplifier.norm_hhf_protect |
1af327306c8e
added norm/close_result (supercede local_standard etc.);
wenzelm
parents:
21579
diff
changeset
|
95 |
#> Thm.strip_shyps |
1af327306c8e
added norm/close_result (supercede local_standard etc.);
wenzelm
parents:
21579
diff
changeset
|
96 |
#> Drule.zero_var_indexes; |
1af327306c8e
added norm/close_result (supercede local_standard etc.);
wenzelm
parents:
21579
diff
changeset
|
97 |
|
1af327306c8e
added norm/close_result (supercede local_standard etc.);
wenzelm
parents:
21579
diff
changeset
|
98 |
|
28446
a01de3b3fa2e
renamed promise to future, tuned related interfaces;
wenzelm
parents:
28363
diff
changeset
|
99 |
(* future_result *) |
28340 | 100 |
|
28446
a01de3b3fa2e
renamed promise to future, tuned related interfaces;
wenzelm
parents:
28363
diff
changeset
|
101 |
fun future_result ctxt result prop = |
28340 | 102 |
let |
103 |
val thy = ProofContext.theory_of ctxt; |
|
104 |
val _ = Context.reject_draft thy; |
|
105 |
val cert = Thm.cterm_of thy; |
|
106 |
val certT = Thm.ctyp_of thy; |
|
107 |
||
108 |
val assms = Assumption.assms_of ctxt; |
|
109 |
val As = map Thm.term_of assms; |
|
110 |
||
111 |
val xs = map Free (fold Term.add_frees (prop :: As) []); |
|
112 |
val fixes = map cert xs; |
|
113 |
||
114 |
val tfrees = fold Term.add_tfrees (prop :: As) []; |
|
115 |
val instT = map (fn (a, S) => (certT (TVar ((a, 0), S)), certT (TFree (a, S)))) tfrees; |
|
116 |
||
117 |
val global_prop = |
|
118 |
Term.map_types Logic.varifyT (fold_rev Logic.all xs (Logic.list_implies (As, prop))); |
|
28973
c549650d1442
future proofs: pass actual futures to facilitate composite computations;
wenzelm
parents:
28619
diff
changeset
|
119 |
val global_result = result |> Future.map |
c549650d1442
future proofs: pass actual futures to facilitate composite computations;
wenzelm
parents:
28619
diff
changeset
|
120 |
(Thm.adjust_maxidx_thm ~1 #> |
c549650d1442
future proofs: pass actual futures to facilitate composite computations;
wenzelm
parents:
28619
diff
changeset
|
121 |
Drule.implies_intr_list assms #> |
c549650d1442
future proofs: pass actual futures to facilitate composite computations;
wenzelm
parents:
28619
diff
changeset
|
122 |
Drule.forall_intr_list fixes #> |
c549650d1442
future proofs: pass actual futures to facilitate composite computations;
wenzelm
parents:
28619
diff
changeset
|
123 |
Thm.generalize (map #1 tfrees, []) 0); |
28340 | 124 |
val local_result = |
28446
a01de3b3fa2e
renamed promise to future, tuned related interfaces;
wenzelm
parents:
28363
diff
changeset
|
125 |
Thm.future global_result (cert global_prop) |
28340 | 126 |
|> Thm.instantiate (instT, []) |
127 |
|> Drule.forall_elim_list fixes |
|
128 |
|> fold (Thm.elim_implies o Thm.assume) assms; |
|
129 |
in local_result end; |
|
130 |
||
131 |
||
18027
09ab79d4e8e1
renamed Goal constant to prop, more general protect/unprotect interfaces;
wenzelm
parents:
17986
diff
changeset
|
132 |
|
09ab79d4e8e1
renamed Goal constant to prop, more general protect/unprotect interfaces;
wenzelm
parents:
17986
diff
changeset
|
133 |
(** tactical theorem proving **) |
09ab79d4e8e1
renamed Goal constant to prop, more general protect/unprotect interfaces;
wenzelm
parents:
17986
diff
changeset
|
134 |
|
23356 | 135 |
(* prove_internal -- minimal checks, no normalization of result! *) |
20250
c3f209752749
prove: proper assumption context, more tactic arguments;
wenzelm
parents:
20228
diff
changeset
|
136 |
|
23356 | 137 |
fun prove_internal casms cprop tac = |
20250
c3f209752749
prove: proper assumption context, more tactic arguments;
wenzelm
parents:
20228
diff
changeset
|
138 |
(case SINGLE (tac (map Assumption.assume casms)) (init cprop) of |
c3f209752749
prove: proper assumption context, more tactic arguments;
wenzelm
parents:
20228
diff
changeset
|
139 |
SOME th => Drule.implies_intr_list casms (finish th) |
c3f209752749
prove: proper assumption context, more tactic arguments;
wenzelm
parents:
20228
diff
changeset
|
140 |
| NONE => error "Tactic failed."); |
c3f209752749
prove: proper assumption context, more tactic arguments;
wenzelm
parents:
20228
diff
changeset
|
141 |
|
c3f209752749
prove: proper assumption context, more tactic arguments;
wenzelm
parents:
20228
diff
changeset
|
142 |
|
28340 | 143 |
(* prove_common etc. *) |
17986 | 144 |
|
28340 | 145 |
fun prove_common immediate ctxt xs asms props tac = |
17980 | 146 |
let |
21516 | 147 |
val thy = ProofContext.theory_of ctxt; |
26939
1035c89b4c02
moved global pretty/string_of functions from Sign to Syntax;
wenzelm
parents:
26713
diff
changeset
|
148 |
val string_of_term = Syntax.string_of_term ctxt; |
20056 | 149 |
|
28355 | 150 |
val pos = Position.thread_data (); |
20250
c3f209752749
prove: proper assumption context, more tactic arguments;
wenzelm
parents:
20228
diff
changeset
|
151 |
fun err msg = cat_error msg |
c3f209752749
prove: proper assumption context, more tactic arguments;
wenzelm
parents:
20228
diff
changeset
|
152 |
("The error(s) above occurred for the goal statement:\n" ^ |
28355 | 153 |
string_of_term (Logic.list_implies (asms, Logic.mk_conjunction_list props)) ^ |
154 |
(case Position.str_of pos of "" => "" | s => "\n" ^ s)); |
|
17980 | 155 |
|
20250
c3f209752749
prove: proper assumption context, more tactic arguments;
wenzelm
parents:
20228
diff
changeset
|
156 |
fun cert_safe t = Thm.cterm_of thy (Envir.beta_norm (Term.no_dummy_patterns t)) |
17980 | 157 |
handle TERM (msg, _) => err msg | TYPE (msg, _, _) => err msg; |
20250
c3f209752749
prove: proper assumption context, more tactic arguments;
wenzelm
parents:
20228
diff
changeset
|
158 |
val casms = map cert_safe asms; |
c3f209752749
prove: proper assumption context, more tactic arguments;
wenzelm
parents:
20228
diff
changeset
|
159 |
val cprops = map cert_safe props; |
17980 | 160 |
|
20250
c3f209752749
prove: proper assumption context, more tactic arguments;
wenzelm
parents:
20228
diff
changeset
|
161 |
val (prems, ctxt') = ctxt |
c3f209752749
prove: proper assumption context, more tactic arguments;
wenzelm
parents:
20228
diff
changeset
|
162 |
|> Variable.add_fixes_direct xs |
27218
4548c83cd508
prove: full Variable.declare_term, including constraints;
wenzelm
parents:
26939
diff
changeset
|
163 |
|> fold Variable.declare_term (asms @ props) |
26713
1c6181def1d0
prove_global: Variable.set_body true, pass context;
wenzelm
parents:
26628
diff
changeset
|
164 |
|> Assumption.add_assumes casms |
1c6181def1d0
prove_global: Variable.set_body true, pass context;
wenzelm
parents:
26628
diff
changeset
|
165 |
||> Variable.set_body true; |
28619
89f9dd800a22
prove_common: include all sorts from context into statement, check shyps of result;
wenzelm
parents:
28446
diff
changeset
|
166 |
val sorts = Variable.sorts_of ctxt'; |
17980 | 167 |
|
28619
89f9dd800a22
prove_common: include all sorts from context into statement, check shyps of result;
wenzelm
parents:
28446
diff
changeset
|
168 |
val stmt = Thm.weaken_sorts sorts (Conjunction.mk_conjunction_balanced cprops); |
28340 | 169 |
|
170 |
fun result () = |
|
171 |
(case SINGLE (tac {prems = prems, context = ctxt'}) (init stmt) of |
|
19774
5fe7731d0836
allow non-trivial schematic goals (via embedded term vars);
wenzelm
parents:
19619
diff
changeset
|
172 |
NONE => err "Tactic failed." |
28340 | 173 |
| SOME st => |
174 |
let val res = finish st handle THM (msg, _, _) => err msg in |
|
28619
89f9dd800a22
prove_common: include all sorts from context into statement, check shyps of result;
wenzelm
parents:
28446
diff
changeset
|
175 |
if Unify.matches_list thy [Thm.term_of stmt] [Thm.prop_of res] |
89f9dd800a22
prove_common: include all sorts from context into statement, check shyps of result;
wenzelm
parents:
28446
diff
changeset
|
176 |
then Thm.check_shyps sorts res |
28340 | 177 |
else err ("Proved a different theorem: " ^ string_of_term (Thm.prop_of res)) |
178 |
end); |
|
179 |
val res = |
|
180 |
if immediate orelse #maxidx (Thm.rep_cterm stmt) >= 0 then result () |
|
28973
c549650d1442
future proofs: pass actual futures to facilitate composite computations;
wenzelm
parents:
28619
diff
changeset
|
181 |
else future_result ctxt' (Future.fork_background result) (Thm.term_of stmt); |
17980 | 182 |
in |
28340 | 183 |
Conjunction.elim_balanced (length props) res |
20290 | 184 |
|> map (Assumption.export false ctxt' ctxt) |
20056 | 185 |
|> Variable.export ctxt' ctxt |
20250
c3f209752749
prove: proper assumption context, more tactic arguments;
wenzelm
parents:
20228
diff
changeset
|
186 |
|> map Drule.zero_var_indexes |
17980 | 187 |
end; |
188 |
||
28341 | 189 |
val prove_multi = prove_common true; |
17980 | 190 |
|
28446
a01de3b3fa2e
renamed promise to future, tuned related interfaces;
wenzelm
parents:
28363
diff
changeset
|
191 |
fun prove_future ctxt xs asms prop tac = hd (prove_common false ctxt xs asms [prop] tac); |
28340 | 192 |
fun prove ctxt xs asms prop tac = hd (prove_common true ctxt xs asms [prop] tac); |
20056 | 193 |
|
194 |
fun prove_global thy xs asms prop tac = |
|
26713
1c6181def1d0
prove_global: Variable.set_body true, pass context;
wenzelm
parents:
26628
diff
changeset
|
195 |
Drule.standard (prove (ProofContext.init thy) xs asms prop tac); |
18027
09ab79d4e8e1
renamed Goal constant to prop, more general protect/unprotect interfaces;
wenzelm
parents:
17986
diff
changeset
|
196 |
|
09ab79d4e8e1
renamed Goal constant to prop, more general protect/unprotect interfaces;
wenzelm
parents:
17986
diff
changeset
|
197 |
|
17980 | 198 |
|
21687 | 199 |
(** goal structure **) |
200 |
||
201 |
(* nested goals *) |
|
18207 | 202 |
|
19184 | 203 |
fun extract i n st = |
204 |
(if i < 1 orelse n < 1 orelse i + n - 1 > Thm.nprems_of st then Seq.empty |
|
205 |
else if n = 1 then Seq.single (Thm.cprem_of st i) |
|
23418 | 206 |
else |
207 |
Seq.single (Conjunction.mk_conjunction_balanced (map (Thm.cprem_of st) (i upto i + n - 1)))) |
|
20260 | 208 |
|> Seq.map (Thm.adjust_maxidx_cterm ~1 #> init); |
17980 | 209 |
|
19221 | 210 |
fun retrofit i n st' st = |
211 |
(if n = 1 then st |
|
23418 | 212 |
else st |> Drule.with_subgoal i (Conjunction.uncurry_balanced n)) |
19221 | 213 |
|> Thm.compose_no_flatten false (conclude st', Thm.nprems_of st') i; |
18207 | 214 |
|
17980 | 215 |
fun SELECT_GOAL tac i st = |
19191 | 216 |
if Thm.nprems_of st = 1 andalso i = 1 then tac st |
19184 | 217 |
else Seq.lifts (retrofit i 1) (Seq.maps tac (extract i 1 st)) st; |
17980 | 218 |
|
21687 | 219 |
|
220 |
(* multiple goals *) |
|
221 |
||
23418 | 222 |
fun precise_conjunction_tac 0 i = eq_assume_tac i |
223 |
| precise_conjunction_tac 1 i = SUBGOAL (K all_tac) i |
|
224 |
| precise_conjunction_tac n i = PRIMITIVE (Drule.with_subgoal i (Conjunction.curry_balanced n)); |
|
23414
927203ad4b3a
tuned conjunction tactics: slightly smaller proof terms;
wenzelm
parents:
23356
diff
changeset
|
225 |
|
23418 | 226 |
val adhoc_conjunction_tac = REPEAT_ALL_NEW |
227 |
(SUBGOAL (fn (goal, i) => |
|
228 |
if can Logic.dest_conjunction goal then rtac Conjunction.conjunctionI i |
|
229 |
else no_tac)); |
|
21687 | 230 |
|
23418 | 231 |
val conjunction_tac = SUBGOAL (fn (goal, i) => |
232 |
precise_conjunction_tac (length (Logic.dest_conjunctions goal)) i ORELSE |
|
233 |
TRY (adhoc_conjunction_tac i)); |
|
21687 | 234 |
|
23418 | 235 |
val recover_conjunction_tac = PRIMITIVE (fn th => |
236 |
Conjunction.uncurry_balanced (Thm.nprems_of th) th); |
|
23414
927203ad4b3a
tuned conjunction tactics: slightly smaller proof terms;
wenzelm
parents:
23356
diff
changeset
|
237 |
|
927203ad4b3a
tuned conjunction tactics: slightly smaller proof terms;
wenzelm
parents:
23356
diff
changeset
|
238 |
fun PRECISE_CONJUNCTS n tac = |
927203ad4b3a
tuned conjunction tactics: slightly smaller proof terms;
wenzelm
parents:
23356
diff
changeset
|
239 |
SELECT_GOAL (precise_conjunction_tac n 1 |
927203ad4b3a
tuned conjunction tactics: slightly smaller proof terms;
wenzelm
parents:
23356
diff
changeset
|
240 |
THEN tac |
23418 | 241 |
THEN recover_conjunction_tac); |
23414
927203ad4b3a
tuned conjunction tactics: slightly smaller proof terms;
wenzelm
parents:
23356
diff
changeset
|
242 |
|
21687 | 243 |
fun CONJUNCTS tac = |
244 |
SELECT_GOAL (conjunction_tac 1 |
|
245 |
THEN tac |
|
23418 | 246 |
THEN recover_conjunction_tac); |
21687 | 247 |
|
248 |
||
249 |
(* hhf normal form *) |
|
250 |
||
251 |
val norm_hhf_tac = |
|
252 |
rtac Drule.asm_rl (*cheap approximation -- thanks to builtin Logic.flatten_params*) |
|
253 |
THEN' SUBGOAL (fn (t, i) => |
|
254 |
if Drule.is_norm_hhf t then all_tac |
|
28619
89f9dd800a22
prove_common: include all sorts from context into statement, check shyps of result;
wenzelm
parents:
28446
diff
changeset
|
255 |
else MetaSimplifier.rewrite_goal_tac Drule.norm_hhf_eqs i); |
21687 | 256 |
|
25301 | 257 |
fun compose_hhf_tac th i st = |
258 |
PRIMSEQ (Thm.bicompose false (false, Drule.lift_all (Thm.cprem_of st i) th, 0) i) st; |
|
21687 | 259 |
|
23237 | 260 |
|
261 |
(* non-atomic goal assumptions *) |
|
262 |
||
23356 | 263 |
fun non_atomic (Const ("==>", _) $ _ $ _) = true |
264 |
| non_atomic (Const ("all", _) $ _) = true |
|
265 |
| non_atomic _ = false; |
|
266 |
||
23237 | 267 |
fun assume_rule_tac ctxt = norm_hhf_tac THEN' CSUBGOAL (fn (goal, i) => |
268 |
let |
|
269 |
val ((_, goal'), ctxt') = Variable.focus goal ctxt; |
|
270 |
val goal'' = Drule.cterm_rule (singleton (Variable.export ctxt' ctxt)) goal'; |
|
23356 | 271 |
val Rs = filter (non_atomic o Thm.term_of) (Drule.strip_imp_prems goal''); |
23237 | 272 |
val tacs = Rs |> map (fn R => |
273 |
Tactic.etac (MetaSimplifier.norm_hhf (Thm.trivial R)) THEN_ALL_NEW assume_tac); |
|
274 |
in fold_rev (curry op APPEND') tacs (K no_tac) i end); |
|
275 |
||
18207 | 276 |
end; |
277 |
||
17980 | 278 |
structure BasicGoal: BASIC_GOAL = Goal; |
279 |
open BasicGoal; |