| author | haftmann |
| Wed, 18 Feb 2009 19:18:32 +0100 | |
| changeset 29970 | cbf46080ea3a |
| parent 29857 | 2cc976ed8a3c |
| child 30165 | 6ee87f67d9cd |
| child 30240 | 5b25fee0362c |
| permissions | -rw-r--r-- |
| 5824 | 1 |
(* Title: Pure/Isar/method.ML |
2 |
Author: Markus Wenzel, TU Muenchen |
|
3 |
||
| 17110 | 4 |
Isar proof methods. |
| 5824 | 5 |
*) |
6 |
||
7 |
signature BASIC_METHOD = |
|
8 |
sig |
|
| 17110 | 9 |
val FINDGOAL: (int -> thm -> 'a Seq.seq) -> thm -> 'a Seq.seq |
10 |
val HEADGOAL: (int -> thm -> 'a Seq.seq) -> thm -> 'a Seq.seq |
|
11 |
type method |
|
| 11731 | 12 |
val trace_rules: bool ref |
| 5824 | 13 |
end; |
14 |
||
15 |
signature METHOD = |
|
16 |
sig |
|
17 |
include BASIC_METHOD |
|
|
25957
2cfb703fa8d8
improved apply: handle thread position, apply to context here;
wenzelm
parents:
25699
diff
changeset
|
18 |
val apply: Position.T -> (Proof.context -> method) -> Proof.context -> thm list -> cases_tactic |
| 18227 | 19 |
val RAW_METHOD_CASES: (thm list -> cases_tactic) -> method |
| 17110 | 20 |
val RAW_METHOD: (thm list -> tactic) -> method |
| 18227 | 21 |
val METHOD_CASES: (thm list -> cases_tactic) -> method |
| 17110 | 22 |
val METHOD: (thm list -> tactic) -> method |
23 |
val fail: method |
|
24 |
val succeed: method |
|
25 |
val insert_tac: thm list -> int -> tactic |
|
26 |
val insert: thm list -> method |
|
27 |
val insert_facts: method |
|
28 |
val SIMPLE_METHOD: tactic -> method |
|
| 21592 | 29 |
val SIMPLE_METHOD': (int -> tactic) -> method |
30 |
val SIMPLE_METHOD'': ((int -> tactic) -> tactic) -> (int -> tactic) -> method |
|
| 17110 | 31 |
val defer: int option -> method |
32 |
val prefer: int -> method |
|
| 20289 | 33 |
val cheating: bool -> Proof.context -> method |
| 17110 | 34 |
val intro: thm list -> method |
35 |
val elim: thm list -> method |
|
| 20289 | 36 |
val unfold: thm list -> Proof.context -> method |
37 |
val fold: thm list -> Proof.context -> method |
|
| 17110 | 38 |
val atomize: bool -> method |
39 |
val this: method |
|
| 20289 | 40 |
val fact: thm list -> Proof.context -> method |
|
29857
2cc976ed8a3c
FindTheorems: add solves feature; tidy up const name subsettin; patch by Timothy Bourke
kleing
parents:
29301
diff
changeset
|
41 |
val assumption_tac: Proof.context -> int -> tactic |
| 20289 | 42 |
val assumption: Proof.context -> method |
43 |
val close: bool -> Proof.context -> method |
|
44 |
val trace: Proof.context -> thm list -> unit |
|
| 6091 | 45 |
val rule_tac: thm list -> thm list -> int -> tactic |
| 20289 | 46 |
val some_rule_tac: thm list -> Proof.context -> thm list -> int -> tactic |
| 25270 | 47 |
val intros_tac: thm list -> thm list -> tactic |
| 17110 | 48 |
val rule: thm list -> method |
49 |
val erule: int -> thm list -> method |
|
50 |
val drule: int -> thm list -> method |
|
51 |
val frule: int -> thm list -> method |
|
| 20289 | 52 |
val iprover_tac: Proof.context -> int option -> int -> tactic |
| 27235 | 53 |
val set_tactic: (thm list -> tactic) -> Proof.context -> Proof.context |
|
26385
ae7564661e76
ML runtime compilation: pass position, tuned signature;
wenzelm
parents:
26291
diff
changeset
|
54 |
val tactic: string * Position.T -> Proof.context -> method |
| 27235 | 55 |
val raw_tactic: string * Position.T -> Proof.context -> method |
| 27729 | 56 |
type src = Args.src |
| 5824 | 57 |
datatype text = |
| 23349 | 58 |
Basic of (Proof.context -> method) * Position.T | |
| 15703 | 59 |
Source of src | |
| 20030 | 60 |
Source_i of src | |
| 5824 | 61 |
Then of text list | |
62 |
Orelse of text list | |
|
63 |
Try of text | |
|
| 19186 | 64 |
Repeat1 of text | |
65 |
SelectGoals of int * text |
|
| 17857 | 66 |
val primitive_text: (thm -> thm) -> text |
67 |
val succeed_text: text |
|
| 17110 | 68 |
val default_text: text |
69 |
val this_text: text |
|
70 |
val done_text: text |
|
|
17356
09afdf37cdb3
added cheating, sorry_text (from skip_proofs.ML);
wenzelm
parents:
17314
diff
changeset
|
71 |
val sorry_text: bool -> text |
| 23349 | 72 |
val finish_text: text option * bool -> Position.T -> text |
| 27729 | 73 |
val print_methods: theory -> unit |
| 26892 | 74 |
val intern: theory -> xstring -> string |
75 |
val defined: theory -> string -> bool |
|
| 20289 | 76 |
val method: theory -> src -> Proof.context -> method |
77 |
val method_i: theory -> src -> Proof.context -> method |
|
78 |
val add_methods: (bstring * (src -> Proof.context -> method) * string) list |
|
| 17110 | 79 |
-> theory -> theory |
| 20289 | 80 |
val add_method: bstring * (src -> Proof.context -> method) * string |
| 17110 | 81 |
-> theory -> theory |
|
26385
ae7564661e76
ML runtime compilation: pass position, tuned signature;
wenzelm
parents:
26291
diff
changeset
|
82 |
val method_setup: bstring -> string * Position.T -> string -> theory -> theory |
| 18999 | 83 |
val syntax: (Context.generic * Args.T list -> 'a * (Context.generic * Args.T list)) |
| 21879 | 84 |
-> src -> Proof.context -> 'a * Proof.context |
| 17110 | 85 |
val simple_args: (Args.T list -> 'a * Args.T list) |
| 20289 | 86 |
-> ('a -> Proof.context -> method) -> src -> Proof.context -> method
|
87 |
val ctxt_args: (Proof.context -> method) -> src -> Proof.context -> method |
|
88 |
val no_args: method -> src -> Proof.context -> method |
|
| 17110 | 89 |
type modifier |
| 18999 | 90 |
val sectioned_args: (Context.generic * Args.T list -> 'a * (Context.generic * Args.T list)) -> |
| 17110 | 91 |
(Args.T list -> modifier * Args.T list) list -> |
| 20289 | 92 |
('a -> Proof.context -> 'b) -> src -> Proof.context -> 'b
|
| 17110 | 93 |
val bang_sectioned_args: |
94 |
(Args.T list -> modifier * Args.T list) list -> |
|
| 20289 | 95 |
(thm list -> Proof.context -> 'a) -> src -> Proof.context -> 'a |
| 17110 | 96 |
val bang_sectioned_args': |
97 |
(Args.T list -> modifier * Args.T list) list -> |
|
| 18999 | 98 |
(Context.generic * Args.T list -> 'a * (Context.generic * Args.T list)) -> |
| 20289 | 99 |
('a -> thm list -> Proof.context -> 'b) -> src -> Proof.context -> 'b
|
| 17110 | 100 |
val only_sectioned_args: |
101 |
(Args.T list -> modifier * Args.T list) list -> |
|
| 20289 | 102 |
(Proof.context -> 'a) -> src -> Proof.context -> 'a |
103 |
val thms_ctxt_args: (thm list -> Proof.context -> 'a) -> src -> |
|
104 |
Proof.context -> 'a |
|
105 |
val thms_args: (thm list -> 'a) -> src -> Proof.context -> 'a |
|
106 |
val thm_args: (thm -> 'a) -> src -> Proof.context -> 'a |
|
| 9539 | 107 |
val goal_args: (Args.T list -> 'a * Args.T list) -> ('a -> int -> tactic)
|
| 20289 | 108 |
-> src -> Proof.context -> method |
| 18999 | 109 |
val goal_args': (Context.generic * Args.T list -> 'a * (Context.generic * Args.T list)) |
| 20289 | 110 |
-> ('a -> int -> tactic) -> src -> Proof.context -> method
|
| 17110 | 111 |
val goal_args_ctxt: (Args.T list -> 'a * Args.T list) -> |
| 20289 | 112 |
(Proof.context -> 'a -> int -> tactic) -> src -> Proof.context -> method |
| 18999 | 113 |
val goal_args_ctxt': (Context.generic * Args.T list -> 'a * (Context.generic * Args.T list)) -> |
| 20289 | 114 |
(Proof.context -> 'a -> int -> tactic) -> src -> Proof.context -> method |
| 22118 | 115 |
val parse: OuterLex.token list -> text * OuterLex.token list |
| 5824 | 116 |
end; |
117 |
||
118 |
structure Method: METHOD = |
|
119 |
struct |
|
120 |
||
| 17110 | 121 |
(** generic tools **) |
122 |
||
123 |
(* goal addressing *) |
|
124 |
||
125 |
fun FINDGOAL tac st = |
|
126 |
let fun find i n = if i > n then Seq.fail else Seq.APPEND (tac i, find (i + 1) n) |
|
127 |
in find 1 (Thm.nprems_of st) st end; |
|
128 |
||
129 |
fun HEADGOAL tac = tac 1; |
|
130 |
||
131 |
||
| 5824 | 132 |
|
|
12324
5db4b4596d1a
rule context and attributes moved to rule_context.ML;
wenzelm
parents:
12311
diff
changeset
|
133 |
(** proof methods **) |
|
5db4b4596d1a
rule context and attributes moved to rule_context.ML;
wenzelm
parents:
12311
diff
changeset
|
134 |
|
| 17110 | 135 |
(* datatype method *) |
| 11731 | 136 |
|
| 18227 | 137 |
datatype method = Meth of thm list -> cases_tactic; |
| 11731 | 138 |
|
|
25957
2cfb703fa8d8
improved apply: handle thread position, apply to context here;
wenzelm
parents:
25699
diff
changeset
|
139 |
fun apply pos meth_fun ctxt facts goal = Position.setmp_thread_data_seq pos |
|
2cfb703fa8d8
improved apply: handle thread position, apply to context here;
wenzelm
parents:
25699
diff
changeset
|
140 |
(fn () => let val Meth meth = meth_fun ctxt in meth facts goal end) (); |
| 11731 | 141 |
|
| 17756 | 142 |
val RAW_METHOD_CASES = Meth; |
| 11731 | 143 |
|
| 17110 | 144 |
fun RAW_METHOD tac = RAW_METHOD_CASES (NO_CASES o tac); |
| 12144 | 145 |
|
| 17110 | 146 |
fun METHOD_CASES tac = RAW_METHOD_CASES (fn facts => |
| 21687 | 147 |
Seq.THEN (ALLGOALS Goal.conjunction_tac, tac facts)); |
| 8372 | 148 |
|
| 21687 | 149 |
fun METHOD tac = RAW_METHOD (fn facts => ALLGOALS Goal.conjunction_tac THEN tac facts); |
| 5824 | 150 |
|
151 |
val fail = METHOD (K no_tac); |
|
152 |
val succeed = METHOD (K all_tac); |
|
153 |
||
154 |
||
| 17110 | 155 |
(* insert facts *) |
| 7419 | 156 |
|
157 |
local |
|
| 5824 | 158 |
|
| 21579 | 159 |
fun cut_rule_tac rule = |
160 |
Tactic.rtac (Drule.forall_intr_vars rule COMP_INCR revcut_rl); |
|
| 6981 | 161 |
|
| 7419 | 162 |
in |
| 5824 | 163 |
|
| 7419 | 164 |
fun insert_tac [] i = all_tac |
165 |
| insert_tac facts i = EVERY (map (fn th => cut_rule_tac th i) facts); |
|
| 6981 | 166 |
|
| 7555 | 167 |
val insert_facts = METHOD (ALLGOALS o insert_tac); |
| 7664 | 168 |
fun insert thms = METHOD (fn _ => ALLGOALS (insert_tac thms)); |
| 7419 | 169 |
|
| 9706 | 170 |
fun SIMPLE_METHOD tac = METHOD (fn facts => ALLGOALS (insert_tac facts) THEN tac); |
| 21592 | 171 |
fun SIMPLE_METHOD'' quant tac = METHOD (fn facts => quant (insert_tac facts THEN' tac)); |
172 |
val SIMPLE_METHOD' = SIMPLE_METHOD'' HEADGOAL; |
|
| 9706 | 173 |
|
|
12324
5db4b4596d1a
rule context and attributes moved to rule_context.ML;
wenzelm
parents:
12311
diff
changeset
|
174 |
end; |
|
5db4b4596d1a
rule context and attributes moved to rule_context.ML;
wenzelm
parents:
12311
diff
changeset
|
175 |
|
| 9706 | 176 |
|
| 17110 | 177 |
(* shuffle subgoals *) |
178 |
||
179 |
fun prefer i = METHOD (K (Tactic.defer_tac i THEN PRIMITIVE (Thm.permute_prems 0 ~1))); |
|
| 18939 | 180 |
fun defer opt_i = METHOD (K (Tactic.defer_tac (the_default 1 opt_i))); |
| 17110 | 181 |
|
182 |
||
|
17356
09afdf37cdb3
added cheating, sorry_text (from skip_proofs.ML);
wenzelm
parents:
17314
diff
changeset
|
183 |
(* cheating *) |
|
09afdf37cdb3
added cheating, sorry_text (from skip_proofs.ML);
wenzelm
parents:
17314
diff
changeset
|
184 |
|
|
09afdf37cdb3
added cheating, sorry_text (from skip_proofs.ML);
wenzelm
parents:
17314
diff
changeset
|
185 |
fun cheating int ctxt = METHOD (K (setmp quick_and_dirty (int orelse ! quick_and_dirty) |
|
09afdf37cdb3
added cheating, sorry_text (from skip_proofs.ML);
wenzelm
parents:
17314
diff
changeset
|
186 |
(SkipProof.cheat_tac (ProofContext.theory_of ctxt)))); |
|
09afdf37cdb3
added cheating, sorry_text (from skip_proofs.ML);
wenzelm
parents:
17314
diff
changeset
|
187 |
|
|
09afdf37cdb3
added cheating, sorry_text (from skip_proofs.ML);
wenzelm
parents:
17314
diff
changeset
|
188 |
|
| 17110 | 189 |
(* unfold intro/elim rules *) |
190 |
||
| 21592 | 191 |
fun intro ths = SIMPLE_METHOD' (CHANGED_PROP o REPEAT_ALL_NEW (Tactic.match_tac ths)); |
192 |
fun elim ths = SIMPLE_METHOD' (CHANGED_PROP o REPEAT_ALL_NEW (Tactic.ematch_tac ths)); |
|
| 17110 | 193 |
|
194 |
||
| 12384 | 195 |
(* unfold/fold definitions *) |
196 |
||
| 18877 | 197 |
fun unfold_meth ths ctxt = SIMPLE_METHOD (CHANGED_PROP (LocalDefs.unfold_tac ctxt ths)); |
198 |
fun fold_meth ths ctxt = SIMPLE_METHOD (CHANGED_PROP (LocalDefs.fold_tac ctxt ths)); |
|
| 6532 | 199 |
|
| 12384 | 200 |
|
| 12829 | 201 |
(* atomize rule statements *) |
202 |
||
|
23590
ad95084a5c63
renamed ObjectLogic.atomize_tac to ObjectLogic.atomize_prems_tac;
wenzelm
parents:
23577
diff
changeset
|
203 |
fun atomize false = SIMPLE_METHOD' (CHANGED_PROP o ObjectLogic.atomize_prems_tac) |
| 12829 | 204 |
| atomize true = RAW_METHOD (K (HEADGOAL (CHANGED_PROP o ObjectLogic.full_atomize_tac))); |
205 |
||
206 |
||
| 18039 | 207 |
(* this -- resolve facts directly *) |
| 12384 | 208 |
|
| 17110 | 209 |
val this = METHOD (EVERY o map (HEADGOAL o Tactic.rtac)); |
| 9484 | 210 |
|
211 |
||
| 18039 | 212 |
(* fact -- composition by facts from context *) |
213 |
||
| 21592 | 214 |
fun fact [] ctxt = SIMPLE_METHOD' (ProofContext.some_fact_tac ctxt) |
215 |
| fact rules _ = SIMPLE_METHOD' (ProofContext.fact_tac rules); |
|
| 18039 | 216 |
|
217 |
||
| 17110 | 218 |
(* assumption *) |
| 7419 | 219 |
|
220 |
local |
|
221 |
||
| 19778 | 222 |
fun cond_rtac cond rule = SUBGOAL (fn (prop, i) => |
223 |
if cond (Logic.strip_assums_concl prop) |
|
224 |
then Tactic.rtac rule i else no_tac); |
|
| 7419 | 225 |
|
|
29857
2cc976ed8a3c
FindTheorems: add solves feature; tidy up const name subsettin; patch by Timothy Bourke
kleing
parents:
29301
diff
changeset
|
226 |
in |
|
2cc976ed8a3c
FindTheorems: add solves feature; tidy up const name subsettin; patch by Timothy Bourke
kleing
parents:
29301
diff
changeset
|
227 |
|
|
2cc976ed8a3c
FindTheorems: add solves feature; tidy up const name subsettin; patch by Timothy Bourke
kleing
parents:
29301
diff
changeset
|
228 |
fun assumption_tac ctxt = |
| 17110 | 229 |
assume_tac APPEND' |
| 23349 | 230 |
Goal.assume_rule_tac ctxt APPEND' |
| 19778 | 231 |
cond_rtac (can Logic.dest_equals) Drule.reflexive_thm APPEND' |
232 |
cond_rtac (can Logic.dest_term) Drule.termI; |
|
| 17110 | 233 |
|
| 23349 | 234 |
fun assumption ctxt = METHOD (HEADGOAL o |
|
29857
2cc976ed8a3c
FindTheorems: add solves feature; tidy up const name subsettin; patch by Timothy Bourke
kleing
parents:
29301
diff
changeset
|
235 |
(fn [] => assumption_tac ctxt |
| 23349 | 236 |
| [fact] => solve_tac [fact] |
237 |
| _ => K no_tac)); |
|
238 |
||
|
17356
09afdf37cdb3
added cheating, sorry_text (from skip_proofs.ML);
wenzelm
parents:
17314
diff
changeset
|
239 |
fun close immed ctxt = METHOD (K |
| 23349 | 240 |
(FILTER Thm.no_prems |
|
29857
2cc976ed8a3c
FindTheorems: add solves feature; tidy up const name subsettin; patch by Timothy Bourke
kleing
parents:
29301
diff
changeset
|
241 |
((if immed then ALLGOALS (assumption_tac ctxt) else all_tac) THEN flexflex_tac))); |
| 7419 | 242 |
|
243 |
end; |
|
244 |
||
245 |
||
| 17110 | 246 |
(* rule etc. -- single-step refinements *) |
| 12347 | 247 |
|
| 17110 | 248 |
val trace_rules = ref false; |
| 12347 | 249 |
|
| 17110 | 250 |
fun trace ctxt rules = |
| 21962 | 251 |
if ! trace_rules andalso not (null rules) then |
| 17110 | 252 |
Pretty.big_list "rules:" (map (ProofContext.pretty_thm ctxt) rules) |
| 21962 | 253 |
|> Pretty.string_of |> tracing |
254 |
else (); |
|
| 12347 | 255 |
|
256 |
local |
|
257 |
||
| 18841 | 258 |
fun gen_rule_tac tac rules facts = |
259 |
(fn i => fn st => |
|
260 |
if null facts then tac rules i st |
|
261 |
else Seq.maps (fn rule => (tac o single) rule i st) (Drule.multi_resolves facts rules)) |
|
| 21687 | 262 |
THEN_ALL_NEW Goal.norm_hhf_tac; |
| 7130 | 263 |
|
| 10744 | 264 |
fun gen_arule_tac tac j rules facts = |
265 |
EVERY' (gen_rule_tac tac rules facts :: replicate j Tactic.assume_tac); |
|
266 |
||
| 11785 | 267 |
fun gen_some_rule_tac tac arg_rules ctxt facts = SUBGOAL (fn (goal, i) => |
268 |
let |
|
269 |
val rules = |
|
270 |
if not (null arg_rules) then arg_rules |
|
|
19482
9f11af8f7ef9
tuned basic list operators (flat, maps, map_filter);
wenzelm
parents:
19307
diff
changeset
|
271 |
else flat (ContextRules.find_rules false facts goal ctxt) |
| 12055 | 272 |
in trace ctxt rules; tac rules facts i end); |
| 10309 | 273 |
|
| 10744 | 274 |
fun meth tac x = METHOD (HEADGOAL o tac x); |
275 |
fun meth' tac x y = METHOD (HEADGOAL o tac x y); |
|
| 8220 | 276 |
|
| 7419 | 277 |
in |
278 |
||
| 10744 | 279 |
val rule_tac = gen_rule_tac Tactic.resolve_tac; |
280 |
val rule = meth rule_tac; |
|
281 |
val some_rule_tac = gen_some_rule_tac rule_tac; |
|
282 |
val some_rule = meth' some_rule_tac; |
|
283 |
||
284 |
val erule = meth' (gen_arule_tac Tactic.eresolve_tac); |
|
285 |
val drule = meth' (gen_arule_tac Tactic.dresolve_tac); |
|
286 |
val frule = meth' (gen_arule_tac Tactic.forward_tac); |
|
| 5824 | 287 |
|
| 7419 | 288 |
end; |
289 |
||
290 |
||
| 25270 | 291 |
(* intros_tac -- pervasive search spanned by intro rules *) |
292 |
||
293 |
fun intros_tac intros facts = |
|
294 |
ALLGOALS (insert_tac facts THEN' |
|
295 |
REPEAT_ALL_NEW (resolve_tac intros)) |
|
296 |
THEN Tactic.distinct_subgoals_tac; |
|
297 |
||
298 |
||
| 17587 | 299 |
(* iprover -- intuitionistic proof search *) |
| 17110 | 300 |
|
301 |
local |
|
302 |
||
303 |
val remdups_tac = SUBGOAL (fn (g, i) => |
|
304 |
let val prems = Logic.strip_assums_hyp g in |
|
|
19046
bc5c6c9b114e
removed distinct, renamed gen_distinct to distinct;
wenzelm
parents:
18999
diff
changeset
|
305 |
REPEAT_DETERM_N (length prems - length (distinct op aconv prems)) |
| 17110 | 306 |
(Tactic.ematch_tac [Drule.remdups_rl] i THEN Tactic.eq_assume_tac i) |
307 |
end); |
|
308 |
||
309 |
fun REMDUPS tac = tac THEN_ALL_NEW remdups_tac; |
|
310 |
||
311 |
val bires_tac = Tactic.biresolution_from_nets_tac ContextRules.orderlist; |
|
312 |
||
313 |
fun safe_step_tac ctxt = |
|
314 |
ContextRules.Swrap ctxt |
|
315 |
(eq_assume_tac ORELSE' |
|
316 |
bires_tac true (ContextRules.netpair_bang ctxt)); |
|
| 8195 | 317 |
|
| 17110 | 318 |
fun unsafe_step_tac ctxt = |
319 |
ContextRules.wrap ctxt |
|
320 |
(assume_tac APPEND' |
|
321 |
bires_tac false (ContextRules.netpair_bang ctxt) APPEND' |
|
322 |
bires_tac false (ContextRules.netpair ctxt)); |
|
323 |
||
324 |
fun step_tac ctxt i = |
|
325 |
REPEAT_DETERM1 (REMDUPS (safe_step_tac ctxt) i) ORELSE |
|
326 |
REMDUPS (unsafe_step_tac ctxt) i; |
|
327 |
||
328 |
fun intprover_tac ctxt gs d lim = SUBGOAL (fn (g, i) => if d > lim then no_tac else |
|
329 |
let |
|
330 |
val ps = Logic.strip_assums_hyp g; |
|
331 |
val c = Logic.strip_assums_concl g; |
|
332 |
in |
|
| 18921 | 333 |
if member (fn ((ps1, c1), (ps2, c2)) => |
| 19307 | 334 |
c1 aconv c2 andalso |
335 |
length ps1 = length ps2 andalso |
|
336 |
gen_eq_set (op aconv) (ps1, ps2)) gs (ps, c) then no_tac |
|
| 17110 | 337 |
else (step_tac ctxt THEN_ALL_NEW intprover_tac ctxt ((ps, c) :: gs) (d + 1) lim) i |
338 |
end); |
|
339 |
||
340 |
in |
|
341 |
||
| 17587 | 342 |
fun iprover_tac ctxt opt_lim = |
| 18939 | 343 |
SELECT_GOAL (DEEPEN (2, the_default 20 opt_lim) (intprover_tac ctxt [] 0) 4 1); |
| 17110 | 344 |
|
345 |
end; |
|
| 8195 | 346 |
|
347 |
||
| 8351 | 348 |
(* ML tactics *) |
349 |
||
|
26472
9afdd61cf528
ml_tactic: non-critical version via proof data and thread data;
wenzelm
parents:
26463
diff
changeset
|
350 |
structure TacticData = ProofDataFun |
|
9afdd61cf528
ml_tactic: non-critical version via proof data and thread data;
wenzelm
parents:
26463
diff
changeset
|
351 |
( |
| 27235 | 352 |
type T = thm list -> tactic; |
|
26472
9afdd61cf528
ml_tactic: non-critical version via proof data and thread data;
wenzelm
parents:
26463
diff
changeset
|
353 |
fun init _ = undefined; |
|
9afdd61cf528
ml_tactic: non-critical version via proof data and thread data;
wenzelm
parents:
26463
diff
changeset
|
354 |
); |
|
9afdd61cf528
ml_tactic: non-critical version via proof data and thread data;
wenzelm
parents:
26463
diff
changeset
|
355 |
|
|
9afdd61cf528
ml_tactic: non-critical version via proof data and thread data;
wenzelm
parents:
26463
diff
changeset
|
356 |
val set_tactic = TacticData.put; |
| 8351 | 357 |
|
|
26472
9afdd61cf528
ml_tactic: non-critical version via proof data and thread data;
wenzelm
parents:
26463
diff
changeset
|
358 |
fun ml_tactic (txt, pos) ctxt = |
|
9afdd61cf528
ml_tactic: non-critical version via proof data and thread data;
wenzelm
parents:
26463
diff
changeset
|
359 |
let |
|
9afdd61cf528
ml_tactic: non-critical version via proof data and thread data;
wenzelm
parents:
26463
diff
changeset
|
360 |
val ctxt' = ctxt |> Context.proof_map |
| 27235 | 361 |
(ML_Context.expression pos |
362 |
"fun tactic (facts: thm list) : tactic" |
|
|
26472
9afdd61cf528
ml_tactic: non-critical version via proof data and thread data;
wenzelm
parents:
26463
diff
changeset
|
363 |
"Context.map_proof (Method.set_tactic tactic)" txt); |
| 27235 | 364 |
in Context.setmp_thread_data (SOME (Context.Proof ctxt)) (TacticData.get ctxt') end; |
| 23425 | 365 |
|
366 |
fun tactic txt ctxt = METHOD (ml_tactic txt ctxt); |
|
367 |
fun raw_tactic txt ctxt = RAW_METHOD (ml_tactic txt ctxt); |
|
| 8351 | 368 |
|
369 |
||
| 5824 | 370 |
|
| 17110 | 371 |
(** method syntax **) |
372 |
||
373 |
(* method text *) |
|
374 |
||
375 |
type src = Args.src; |
|
| 5824 | 376 |
|
| 17110 | 377 |
datatype text = |
| 23349 | 378 |
Basic of (Proof.context -> method) * Position.T | |
| 17110 | 379 |
Source of src | |
| 20030 | 380 |
Source_i of src | |
| 17110 | 381 |
Then of text list | |
382 |
Orelse of text list | |
|
383 |
Try of text | |
|
| 19186 | 384 |
Repeat1 of text | |
385 |
SelectGoals of int * text; |
|
| 17110 | 386 |
|
| 23349 | 387 |
fun primitive_text r = Basic (K (SIMPLE_METHOD (PRIMITIVE r)), Position.none); |
388 |
val succeed_text = Basic (K succeed, Position.none); |
|
| 17110 | 389 |
val default_text = Source (Args.src (("default", []), Position.none));
|
| 23349 | 390 |
val this_text = Basic (K this, Position.none); |
391 |
val done_text = Basic (K (SIMPLE_METHOD all_tac), Position.none); |
|
392 |
fun sorry_text int = Basic (cheating int, Position.none); |
|
| 17110 | 393 |
|
| 23349 | 394 |
fun finish_text (NONE, immed) pos = Basic (close immed, pos) |
395 |
| finish_text (SOME txt, immed) pos = Then [txt, Basic (close immed, pos)]; |
|
| 17110 | 396 |
|
397 |
||
398 |
(* method definitions *) |
|
| 5824 | 399 |
|
| 24116 | 400 |
structure Methods = TheoryDataFun |
| 22846 | 401 |
( |
| 20289 | 402 |
type T = (((src -> Proof.context -> method) * string) * stamp) NameSpace.table; |
| 16347 | 403 |
val empty = NameSpace.empty_table; |
| 6546 | 404 |
val copy = I; |
| 16448 | 405 |
val extend = I; |
|
23655
d2d1138e0ddc
replaced exception TableFun/GraphFun.DUPS by TableFun/GraphFun.DUP;
wenzelm
parents:
23590
diff
changeset
|
406 |
fun merge _ tables : T = NameSpace.merge_tables (eq_snd (op =)) tables handle Symtab.DUP dup => |
|
d2d1138e0ddc
replaced exception TableFun/GraphFun.DUPS by TableFun/GraphFun.DUP;
wenzelm
parents:
23590
diff
changeset
|
407 |
error ("Attempt to merge different versions of method " ^ quote dup);
|
| 22846 | 408 |
); |
| 5824 | 409 |
|
| 22846 | 410 |
fun print_methods thy = |
411 |
let |
|
| 24116 | 412 |
val meths = Methods.get thy; |
| 22846 | 413 |
fun prt_meth (name, ((_, comment), _)) = Pretty.block |
414 |
[Pretty.str (name ^ ":"), Pretty.brk 2, Pretty.str comment]; |
|
415 |
in |
|
416 |
[Pretty.big_list "methods:" (map prt_meth (NameSpace.extern_table meths))] |
|
417 |
|> Pretty.chunks |> Pretty.writeln |
|
418 |
end; |
|
| 7611 | 419 |
|
| 5824 | 420 |
|
421 |
(* get methods *) |
|
422 |
||
| 26892 | 423 |
val intern = NameSpace.intern o #1 o Methods.get; |
424 |
val defined = Symtab.defined o #2 o Methods.get; |
|
425 |
||
| 20030 | 426 |
fun method_i thy = |
| 5824 | 427 |
let |
| 24116 | 428 |
val meths = #2 (Methods.get thy); |
| 5884 | 429 |
fun meth src = |
| 20030 | 430 |
let val ((name, _), pos) = Args.dest_src src in |
| 17412 | 431 |
(case Symtab.lookup meths name of |
| 15531 | 432 |
NONE => error ("Unknown proof method: " ^ quote name ^ Position.str_of pos)
|
| 27751 | 433 |
| SOME ((mth, _), _) => (Position.report (Markup.method name) pos; mth src)) |
| 5824 | 434 |
end; |
435 |
in meth end; |
|
436 |
||
| 24116 | 437 |
fun method thy = method_i thy o Args.map_name (NameSpace.intern (#1 (Methods.get thy))); |
| 20030 | 438 |
|
| 5824 | 439 |
|
| 17110 | 440 |
(* add method *) |
| 5824 | 441 |
|
442 |
fun add_methods raw_meths thy = |
|
443 |
let |
|
| 16145 | 444 |
val new_meths = raw_meths |> map (fn (name, f, comment) => |
| 29004 | 445 |
(Binding.name name, ((f, comment), stamp ()))); |
| 5824 | 446 |
|
| 29004 | 447 |
fun add meths = fold (snd oo NameSpace.bind (Sign.naming_of thy)) new_meths meths |
|
23655
d2d1138e0ddc
replaced exception TableFun/GraphFun.DUPS by TableFun/GraphFun.DUP;
wenzelm
parents:
23590
diff
changeset
|
448 |
handle Symtab.DUP dup => error ("Duplicate declaration of method " ^ quote dup);
|
| 24116 | 449 |
in Methods.map add thy end; |
| 5824 | 450 |
|
| 9194 | 451 |
val add_method = add_methods o Library.single; |
452 |
||
| 5824 | 453 |
|
|
17356
09afdf37cdb3
added cheating, sorry_text (from skip_proofs.ML);
wenzelm
parents:
17314
diff
changeset
|
454 |
(* method_setup *) |
|
09afdf37cdb3
added cheating, sorry_text (from skip_proofs.ML);
wenzelm
parents:
17314
diff
changeset
|
455 |
|
|
26385
ae7564661e76
ML runtime compilation: pass position, tuned signature;
wenzelm
parents:
26291
diff
changeset
|
456 |
fun method_setup name (txt, pos) cmt = |
|
26472
9afdd61cf528
ml_tactic: non-critical version via proof data and thread data;
wenzelm
parents:
26463
diff
changeset
|
457 |
Context.theory_map (ML_Context.expression pos |
| 22118 | 458 |
"val method: bstring * (Method.src -> Proof.context -> Proof.method) * string" |
| 22086 | 459 |
"Context.map_theory (Method.add_method method)" |
|
26472
9afdd61cf528
ml_tactic: non-critical version via proof data and thread data;
wenzelm
parents:
26463
diff
changeset
|
460 |
("(" ^ quote name ^ ", " ^ txt ^ ", " ^ quote cmt ^ ")"));
|
|
17356
09afdf37cdb3
added cheating, sorry_text (from skip_proofs.ML);
wenzelm
parents:
17314
diff
changeset
|
461 |
|
|
09afdf37cdb3
added cheating, sorry_text (from skip_proofs.ML);
wenzelm
parents:
17314
diff
changeset
|
462 |
|
| 5884 | 463 |
|
| 17110 | 464 |
(** concrete syntax **) |
| 5824 | 465 |
|
|
27813
96fbe385a0d0
unified Args.T with OuterLex.token, renamed some operations;
wenzelm
parents:
27751
diff
changeset
|
466 |
structure P = OuterParse; |
|
96fbe385a0d0
unified Args.T with OuterLex.token, renamed some operations;
wenzelm
parents:
27751
diff
changeset
|
467 |
|
|
96fbe385a0d0
unified Args.T with OuterLex.token, renamed some operations;
wenzelm
parents:
27751
diff
changeset
|
468 |
|
| 5884 | 469 |
(* basic *) |
470 |
||
| 18999 | 471 |
fun syntax scan = Args.context_syntax "method" scan; |
| 5824 | 472 |
|
| 17110 | 473 |
fun simple_args scan f src ctxt : method = |
| 21879 | 474 |
fst (syntax (Scan.lift (scan >> (fn x => f x ctxt))) src ctxt); |
| 8351 | 475 |
|
| 20289 | 476 |
fun ctxt_args (f: Proof.context -> method) src ctxt = |
| 21879 | 477 |
fst (syntax (Scan.succeed (f ctxt)) src ctxt); |
| 7555 | 478 |
|
479 |
fun no_args m = ctxt_args (K m); |
|
| 5884 | 480 |
|
481 |
||
482 |
(* sections *) |
|
| 5824 | 483 |
|
| 20289 | 484 |
type modifier = (Proof.context -> Proof.context) * attribute; |
| 7268 | 485 |
|
486 |
local |
|
487 |
||
|
24010
2ef318813e1a
method section scanners: added [[declaration]] syntax, ignore sid-effects of thms;
wenzelm
parents:
23937
diff
changeset
|
488 |
fun thms ss = Scan.repeat (Scan.unless (Scan.lift (Scan.first ss)) Attrib.multi_thm) >> flat; |
| 19186 | 489 |
fun app (f, att) (context, ths) = foldl_map att (Context.map_proof f context, ths); |
| 5824 | 490 |
|
| 24022 | 491 |
fun section ss = Scan.depend (fn context => (Scan.first ss -- Scan.pass context (thms ss)) :|-- |
492 |
(fn (m, ths) => Scan.succeed (app m (context, ths)))); |
|
| 5884 | 493 |
|
| 7601 | 494 |
fun sectioned args ss = args -- Scan.repeat (section ss); |
| 5884 | 495 |
|
| 7268 | 496 |
in |
| 5824 | 497 |
|
| 5884 | 498 |
fun sectioned_args args ss f src ctxt = |
| 21879 | 499 |
let val ((x, _), ctxt') = syntax (sectioned args ss) src ctxt |
| 5921 | 500 |
in f x ctxt' end; |
| 5884 | 501 |
|
| 7601 | 502 |
fun bang_sectioned_args ss f = sectioned_args Args.bang_facts ss f; |
| 9777 | 503 |
fun bang_sectioned_args' ss scan f = |
504 |
sectioned_args (Args.bang_facts -- scan >> swap) ss (uncurry f); |
|
| 7601 | 505 |
fun only_sectioned_args ss f = sectioned_args (Scan.succeed ()) ss (fn () => f); |
| 7268 | 506 |
|
| 18999 | 507 |
fun thms_ctxt_args f = sectioned_args (thms []) [] f; |
| 8093 | 508 |
fun thms_args f = thms_ctxt_args (K o f); |
| 9706 | 509 |
fun thm_args f = thms_args (fn [thm] => f thm | _ => error "Single theorem expected"); |
| 5824 | 510 |
|
| 7268 | 511 |
end; |
512 |
||
| 5824 | 513 |
|
| 17587 | 514 |
(* iprover syntax *) |
| 12347 | 515 |
|
516 |
local |
|
517 |
||
518 |
val introN = "intro"; |
|
519 |
val elimN = "elim"; |
|
520 |
val destN = "dest"; |
|
521 |
val ruleN = "rule"; |
|
522 |
||
523 |
fun modifier name kind kind' att = |
|
|
27813
96fbe385a0d0
unified Args.T with OuterLex.token, renamed some operations;
wenzelm
parents:
27751
diff
changeset
|
524 |
Args.$$$ name |-- (kind >> K NONE || kind' |-- P.nat --| Args.colon >> SOME) |
| 20289 | 525 |
>> (pair (I: Proof.context -> Proof.context) o att); |
| 12347 | 526 |
|
| 17587 | 527 |
val iprover_modifiers = |
| 18728 | 528 |
[modifier destN Args.bang_colon Args.bang ContextRules.dest_bang, |
529 |
modifier destN Args.colon (Scan.succeed ()) ContextRules.dest, |
|
530 |
modifier elimN Args.bang_colon Args.bang ContextRules.elim_bang, |
|
531 |
modifier elimN Args.colon (Scan.succeed ()) ContextRules.elim, |
|
532 |
modifier introN Args.bang_colon Args.bang ContextRules.intro_bang, |
|
533 |
modifier introN Args.colon (Scan.succeed ()) ContextRules.intro, |
|
534 |
Args.del -- Args.colon >> K (I, ContextRules.rule_del)]; |
|
| 12347 | 535 |
|
536 |
in |
|
537 |
||
| 18640 | 538 |
val iprover_meth = |
|
27813
96fbe385a0d0
unified Args.T with OuterLex.token, renamed some operations;
wenzelm
parents:
27751
diff
changeset
|
539 |
bang_sectioned_args' iprover_modifiers (Scan.lift (Scan.option P.nat)) |
| 18640 | 540 |
(fn n => fn prems => fn ctxt => METHOD (fn facts => |
541 |
HEADGOAL (insert_tac (prems @ facts) THEN' |
|
|
23590
ad95084a5c63
renamed ObjectLogic.atomize_tac to ObjectLogic.atomize_prems_tac;
wenzelm
parents:
23577
diff
changeset
|
542 |
ObjectLogic.atomize_prems_tac THEN' iprover_tac ctxt n))); |
| 12347 | 543 |
|
544 |
end; |
|
545 |
||
546 |
||
| 9539 | 547 |
(* tactic syntax *) |
| 8238 | 548 |
|
| 10744 | 549 |
fun nat_thms_args f = uncurry f oo |
|
27813
96fbe385a0d0
unified Args.T with OuterLex.token, renamed some operations;
wenzelm
parents:
27751
diff
changeset
|
550 |
(fst oo syntax (Scan.lift (Scan.optional (Args.parens P.nat) 0) -- Attrib.thms)); |
| 10744 | 551 |
|
| 21879 | 552 |
fun goal_args' args tac src ctxt = fst (syntax (Args.goal_spec HEADGOAL -- args >> |
| 21592 | 553 |
(fn (quant, s) => SIMPLE_METHOD'' quant (tac s))) src ctxt); |
| 8537 | 554 |
|
| 9539 | 555 |
fun goal_args args tac = goal_args' (Scan.lift args) tac; |
| 8238 | 556 |
|
|
14174
f3cafd2929d5
Methods rule_tac etc support static (Isar) contexts.
ballarin
parents:
13650
diff
changeset
|
557 |
fun goal_args_ctxt' args tac src ctxt = |
| 21879 | 558 |
fst (syntax (Args.goal_spec HEADGOAL -- args >> |
| 21592 | 559 |
(fn (quant, s) => SIMPLE_METHOD'' quant (tac ctxt s))) src ctxt); |
| 8238 | 560 |
|
|
14174
f3cafd2929d5
Methods rule_tac etc support static (Isar) contexts.
ballarin
parents:
13650
diff
changeset
|
561 |
fun goal_args_ctxt args tac = goal_args_ctxt' (Scan.lift args) tac; |
| 5824 | 562 |
|
| 14718 | 563 |
|
|
27813
96fbe385a0d0
unified Args.T with OuterLex.token, renamed some operations;
wenzelm
parents:
27751
diff
changeset
|
564 |
(* outer parser *) |
|
96fbe385a0d0
unified Args.T with OuterLex.token, renamed some operations;
wenzelm
parents:
27751
diff
changeset
|
565 |
|
|
96fbe385a0d0
unified Args.T with OuterLex.token, renamed some operations;
wenzelm
parents:
27751
diff
changeset
|
566 |
fun is_symid_meth s = |
|
96fbe385a0d0
unified Args.T with OuterLex.token, renamed some operations;
wenzelm
parents:
27751
diff
changeset
|
567 |
s <> "|" andalso s <> "?" andalso s <> "+" andalso OuterLex.ident_or_symbolic s; |
|
96fbe385a0d0
unified Args.T with OuterLex.token, renamed some operations;
wenzelm
parents:
27751
diff
changeset
|
568 |
|
|
96fbe385a0d0
unified Args.T with OuterLex.token, renamed some operations;
wenzelm
parents:
27751
diff
changeset
|
569 |
local |
|
96fbe385a0d0
unified Args.T with OuterLex.token, renamed some operations;
wenzelm
parents:
27751
diff
changeset
|
570 |
|
|
96fbe385a0d0
unified Args.T with OuterLex.token, renamed some operations;
wenzelm
parents:
27751
diff
changeset
|
571 |
fun meth4 x = |
|
96fbe385a0d0
unified Args.T with OuterLex.token, renamed some operations;
wenzelm
parents:
27751
diff
changeset
|
572 |
(P.position (P.xname >> rpair []) >> (Source o Args.src) || |
|
96fbe385a0d0
unified Args.T with OuterLex.token, renamed some operations;
wenzelm
parents:
27751
diff
changeset
|
573 |
P.$$$ "(" |-- P.!!! (meth0 --| P.$$$ ")")) x
|
|
96fbe385a0d0
unified Args.T with OuterLex.token, renamed some operations;
wenzelm
parents:
27751
diff
changeset
|
574 |
and meth3 x = |
|
96fbe385a0d0
unified Args.T with OuterLex.token, renamed some operations;
wenzelm
parents:
27751
diff
changeset
|
575 |
(meth4 --| P.$$$ "?" >> Try || |
|
96fbe385a0d0
unified Args.T with OuterLex.token, renamed some operations;
wenzelm
parents:
27751
diff
changeset
|
576 |
meth4 --| P.$$$ "+" >> Repeat1 || |
|
96fbe385a0d0
unified Args.T with OuterLex.token, renamed some operations;
wenzelm
parents:
27751
diff
changeset
|
577 |
meth4 -- (P.$$$ "[" |-- Scan.optional P.nat 1 --| P.$$$ "]") >> (SelectGoals o swap) || |
|
96fbe385a0d0
unified Args.T with OuterLex.token, renamed some operations;
wenzelm
parents:
27751
diff
changeset
|
578 |
meth4) x |
|
96fbe385a0d0
unified Args.T with OuterLex.token, renamed some operations;
wenzelm
parents:
27751
diff
changeset
|
579 |
and meth2 x = |
|
96fbe385a0d0
unified Args.T with OuterLex.token, renamed some operations;
wenzelm
parents:
27751
diff
changeset
|
580 |
(P.position (P.xname -- Args.parse1 is_symid_meth) >> (Source o Args.src) || |
|
96fbe385a0d0
unified Args.T with OuterLex.token, renamed some operations;
wenzelm
parents:
27751
diff
changeset
|
581 |
meth3) x |
|
96fbe385a0d0
unified Args.T with OuterLex.token, renamed some operations;
wenzelm
parents:
27751
diff
changeset
|
582 |
and meth1 x = (P.enum1 "," meth2 >> (fn [m] => m | ms => Then ms)) x |
|
96fbe385a0d0
unified Args.T with OuterLex.token, renamed some operations;
wenzelm
parents:
27751
diff
changeset
|
583 |
and meth0 x = (P.enum1 "|" meth1 >> (fn [m] => m | ms => Orelse ms)) x; |
|
96fbe385a0d0
unified Args.T with OuterLex.token, renamed some operations;
wenzelm
parents:
27751
diff
changeset
|
584 |
|
|
96fbe385a0d0
unified Args.T with OuterLex.token, renamed some operations;
wenzelm
parents:
27751
diff
changeset
|
585 |
in val parse = meth3 end; |
|
96fbe385a0d0
unified Args.T with OuterLex.token, renamed some operations;
wenzelm
parents:
27751
diff
changeset
|
586 |
|
|
96fbe385a0d0
unified Args.T with OuterLex.token, renamed some operations;
wenzelm
parents:
27751
diff
changeset
|
587 |
|
| 18708 | 588 |
(* theory setup *) |
| 5824 | 589 |
|
| 26463 | 590 |
val _ = Context.>> (Context.map_theory |
591 |
(add_methods |
|
592 |
[("fail", no_args fail, "force failure"),
|
|
593 |
("succeed", no_args succeed, "succeed"),
|
|
594 |
("-", no_args insert_facts, "do nothing (insert current facts only)"),
|
|
595 |
("insert", thms_args insert, "insert theorems, ignoring facts (improper)"),
|
|
596 |
("intro", thms_args intro, "repeatedly apply introduction rules"),
|
|
597 |
("elim", thms_args elim, "repeatedly apply elimination rules"),
|
|
598 |
("unfold", thms_ctxt_args unfold_meth, "unfold definitions"),
|
|
599 |
("fold", thms_ctxt_args fold_meth, "fold definitions"),
|
|
600 |
("atomize", (atomize o fst) oo syntax (Args.mode "full"),
|
|
601 |
"present local premises as object-level statements"), |
|
602 |
("iprover", iprover_meth, "intuitionistic proof search"),
|
|
603 |
("rule", thms_ctxt_args some_rule, "apply some intro/elim rule"),
|
|
604 |
("erule", nat_thms_args erule, "apply rule in elimination manner (improper)"),
|
|
605 |
("drule", nat_thms_args drule, "apply rule in destruct manner (improper)"),
|
|
606 |
("frule", nat_thms_args frule, "apply rule in forward manner (improper)"),
|
|
607 |
("this", no_args this, "apply current facts as rules"),
|
|
608 |
("fact", thms_ctxt_args fact, "composition by facts from context"),
|
|
609 |
("assumption", ctxt_args assumption, "proof by assumption, preferring facts"),
|
|
| 27244 | 610 |
("rename_tac", goal_args (Scan.repeat1 Args.name) Tactic.rename_tac,
|
| 26463 | 611 |
"rename parameters of goal"), |
|
27813
96fbe385a0d0
unified Args.T with OuterLex.token, renamed some operations;
wenzelm
parents:
27751
diff
changeset
|
612 |
("rotate_tac", goal_args (Scan.optional P.int 1) Tactic.rotate_tac,
|
| 26463 | 613 |
"rotate assumptions of goal"), |
|
27813
96fbe385a0d0
unified Args.T with OuterLex.token, renamed some operations;
wenzelm
parents:
27751
diff
changeset
|
614 |
("tactic", simple_args (P.position Args.name) tactic, "ML tactic as proof method"),
|
|
96fbe385a0d0
unified Args.T with OuterLex.token, renamed some operations;
wenzelm
parents:
27751
diff
changeset
|
615 |
("raw_tactic", simple_args (P.position Args.name) raw_tactic,
|
| 26463 | 616 |
"ML tactic as raw proof method")])); |
| 5824 | 617 |
|
618 |
||
| 16145 | 619 |
(*final declarations of this structure!*) |
620 |
val unfold = unfold_meth; |
|
621 |
val fold = fold_meth; |
|
622 |
||
| 5824 | 623 |
end; |
624 |
||
625 |
structure BasicMethod: BASIC_METHOD = Method; |
|
626 |
open BasicMethod; |