author | wenzelm |
Mon, 23 Oct 2000 22:10:36 +0200 | |
changeset 10309 | a7f961fb62c6 |
parent 10034 | 4bca6b2d2589 |
child 10378 | 98c95ebf804f |
permissions | -rw-r--r-- |
5824 | 1 |
(* Title: Pure/Isar/method.ML |
2 |
ID: $Id$ |
|
3 |
Author: Markus Wenzel, TU Muenchen |
|
8807 | 4 |
License: GPL (GNU GENERAL PUBLIC LICENSE) |
5824 | 5 |
|
6 |
Proof methods. |
|
7 |
*) |
|
8 |
||
9 |
signature BASIC_METHOD = |
|
10 |
sig |
|
11 |
val print_methods: theory -> unit |
|
12 |
val Method: bstring -> (Args.src -> Proof.context -> Proof.method) -> string -> unit |
|
13 |
end; |
|
14 |
||
15 |
signature METHOD = |
|
16 |
sig |
|
17 |
include BASIC_METHOD |
|
8153
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
18 |
val print_global_rules: theory -> unit |
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
19 |
val print_local_rules: Proof.context -> unit |
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
20 |
val dest_global: theory attribute |
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
21 |
val elim_global: theory attribute |
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
22 |
val intro_global: theory attribute |
9938 | 23 |
val rule_del_global: theory attribute |
8153
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
24 |
val dest_local: Proof.context attribute |
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
25 |
val elim_local: Proof.context attribute |
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
26 |
val intro_local: Proof.context attribute |
9938 | 27 |
val rule_del_local: Proof.context attribute |
6091 | 28 |
val METHOD: (thm list -> tactic) -> Proof.method |
8372 | 29 |
val METHOD_CASES: |
30 |
(thm list -> thm -> (thm * (string * RuleCases.T) list) Seq.seq) -> Proof.method |
|
9706 | 31 |
val SIMPLE_METHOD: tactic -> Proof.method |
32 |
val SIMPLE_METHOD': ((int -> tactic) -> tactic) -> (int -> tactic) -> Proof.method |
|
5824 | 33 |
val fail: Proof.method |
34 |
val succeed: Proof.method |
|
8167 | 35 |
val defer: int option -> Proof.method |
36 |
val prefer: int -> Proof.method |
|
7419 | 37 |
val insert_tac: thm list -> int -> tactic |
7574 | 38 |
val insert: thm list -> Proof.method |
7555 | 39 |
val insert_facts: Proof.method |
7601 | 40 |
val unfold: thm list -> Proof.method |
7419 | 41 |
val fold: thm list -> Proof.method |
9484 | 42 |
val atomize_tac: thm list -> int -> tactic |
9485 | 43 |
val atomize_goal: thm list -> int -> thm -> thm |
7419 | 44 |
val multi_resolve: thm list -> thm -> thm Seq.seq |
45 |
val multi_resolves: thm list -> thm list -> thm Seq.seq |
|
8335 | 46 |
val resolveq_tac: thm Seq.seq -> int -> tactic |
9294 | 47 |
val resolveq_cases_tac: bool -> (thm * string list) Seq.seq |
8372 | 48 |
-> int -> thm -> (thm * (string * RuleCases.T) list) Seq.seq |
6091 | 49 |
val rule_tac: thm list -> thm list -> int -> tactic |
9587 | 50 |
val erule_tac: thm list -> thm list -> int -> tactic |
10309 | 51 |
val some_rule_tac: thm list -> Proof.context -> thm list -> int -> tactic |
6091 | 52 |
val rule: thm list -> Proof.method |
7130 | 53 |
val erule: thm list -> Proof.method |
8220 | 54 |
val drule: thm list -> Proof.method |
55 |
val frule: thm list -> Proof.method |
|
8195 | 56 |
val this: Proof.method |
7555 | 57 |
val assumption: Proof.context -> Proof.method |
8351 | 58 |
val set_tactic: (Proof.context -> thm list -> tactic) -> unit |
59 |
val tactic: string -> Proof.context -> Proof.method |
|
5916 | 60 |
exception METHOD_FAIL of (string * Position.T) * exn |
5824 | 61 |
val method: theory -> Args.src -> Proof.context -> Proof.method |
9539 | 62 |
val add_method: bstring * (Args.src -> Proof.context -> Proof.method) * string |
63 |
-> theory -> theory |
|
5824 | 64 |
val add_methods: (bstring * (Args.src -> Proof.context -> Proof.method) * string) list |
65 |
-> theory -> theory |
|
5884 | 66 |
val syntax: (Proof.context * Args.T list -> 'a * (Proof.context * Args.T list)) -> |
8282 | 67 |
Args.src -> Proof.context -> Proof.context * 'a |
8351 | 68 |
val simple_args: (Args.T list -> 'a * Args.T list) |
69 |
-> ('a -> Proof.context -> Proof.method) -> Args.src -> Proof.context -> Proof.method |
|
7555 | 70 |
val ctxt_args: (Proof.context -> Proof.method) -> Args.src -> Proof.context -> Proof.method |
5884 | 71 |
val no_args: Proof.method -> Args.src -> Proof.context -> Proof.method |
7268 | 72 |
type modifier |
7601 | 73 |
val sectioned_args: (Proof.context * Args.T list -> 'a * (Proof.context * Args.T list)) -> |
7268 | 74 |
(Args.T list -> modifier * Args.T list) list -> |
9864 | 75 |
('a -> Proof.context -> 'b) -> Args.src -> Proof.context -> 'b |
7601 | 76 |
val bang_sectioned_args: |
77 |
(Args.T list -> modifier * Args.T list) list -> |
|
9864 | 78 |
(thm list -> Proof.context -> 'a) -> Args.src -> Proof.context -> 'a |
9777 | 79 |
val bang_sectioned_args': |
80 |
(Args.T list -> modifier * Args.T list) list -> |
|
81 |
(Proof.context * Args.T list -> 'a * (Proof.context * Args.T list)) -> |
|
9864 | 82 |
('a -> thm list -> Proof.context -> 'b) -> Args.src -> Proof.context -> 'b |
7601 | 83 |
val only_sectioned_args: |
84 |
(Args.T list -> modifier * Args.T list) list -> |
|
9864 | 85 |
(Proof.context -> 'a) -> Args.src -> Proof.context -> 'a |
86 |
val thms_ctxt_args: (thm list -> Proof.context -> 'a) -> Args.src -> Proof.context -> 'a |
|
87 |
val thms_args: (thm list -> 'a) -> Args.src -> Proof.context -> 'a |
|
88 |
val thm_args: (thm -> 'a) -> Args.src -> Proof.context -> 'a |
|
5824 | 89 |
datatype text = |
90 |
Basic of (Proof.context -> Proof.method) | |
|
91 |
Source of Args.src | |
|
92 |
Then of text list | |
|
93 |
Orelse of text list | |
|
94 |
Try of text | |
|
95 |
Repeat1 of text |
|
96 |
val refine: text -> Proof.state -> Proof.state Seq.seq |
|
8238 | 97 |
val refine_end: text -> Proof.state -> Proof.state Seq.seq |
5824 | 98 |
val proof: text option -> Proof.state -> Proof.state Seq.seq |
8966 | 99 |
val local_qed: bool -> text option |
6981 | 100 |
-> ({kind: string, name: string, thm: thm} -> unit) * (thm -> unit) |
6736 | 101 |
-> Proof.state -> Proof.state Seq.seq |
6981 | 102 |
val local_terminal_proof: text * text option |
103 |
-> ({kind: string, name: string, thm: thm} -> unit) * (thm -> unit) |
|
6736 | 104 |
-> Proof.state -> Proof.state Seq.seq |
6981 | 105 |
val local_default_proof: ({kind: string, name: string, thm: thm} -> unit) * (thm -> unit) |
6736 | 106 |
-> Proof.state -> Proof.state Seq.seq |
8966 | 107 |
val local_immediate_proof: ({kind: string, name: string, thm: thm} -> unit) * (thm -> unit) |
108 |
-> Proof.state -> Proof.state Seq.seq |
|
109 |
val local_done_proof: ({kind: string, name: string, thm: thm} -> unit) * (thm -> unit) |
|
110 |
-> Proof.state -> Proof.state Seq.seq |
|
111 |
val global_qed: bool -> text option |
|
112 |
-> Proof.state -> theory * {kind: string, name: string, thm: thm} |
|
6934 | 113 |
val global_terminal_proof: text * text option |
114 |
-> Proof.state -> theory * {kind: string, name: string, thm: thm} |
|
8966 | 115 |
val global_default_proof: Proof.state -> theory * {kind: string, name: string, thm: thm} |
6532 | 116 |
val global_immediate_proof: Proof.state -> theory * {kind: string, name: string, thm: thm} |
8966 | 117 |
val global_done_proof: Proof.state -> theory * {kind: string, name: string, thm: thm} |
9539 | 118 |
val goal_args: (Args.T list -> 'a * Args.T list) -> ('a -> int -> tactic) |
119 |
-> Args.src -> Proof.context -> Proof.method |
|
120 |
val goal_args': (Proof.context * Args.T list -> 'a * (Proof.context * Args.T list)) |
|
121 |
-> ('a -> int -> tactic) -> Args.src -> Proof.context -> Proof.method |
|
5824 | 122 |
val setup: (theory -> theory) list |
123 |
end; |
|
124 |
||
125 |
structure Method: METHOD = |
|
126 |
struct |
|
127 |
||
128 |
||
8153
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
129 |
(** global and local rule data **) |
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
130 |
|
10008 | 131 |
local |
132 |
fun prt_rules kind sg ths = |
|
133 |
Pretty.writeln (Pretty.big_list ("standard " ^ kind ^ " rules:") |
|
134 |
(map (Display.pretty_thm_sg sg) ths)); |
|
135 |
in |
|
136 |
fun print_rules sg (intro, elim) = |
|
137 |
(prt_rules "introduction" sg intro; prt_rules "elimination" sg elim); |
|
138 |
end; |
|
8153
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
139 |
|
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
140 |
|
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
141 |
(* theory data kind 'Isar/rules' *) |
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
142 |
|
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
143 |
structure GlobalRulesArgs = |
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
144 |
struct |
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
145 |
val name = "Isar/rules"; |
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
146 |
type T = thm list * thm list; |
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
147 |
|
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
148 |
val empty = ([], []); |
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
149 |
val copy = I; |
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
150 |
val prep_ext = I; |
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
151 |
fun merge ((intro1, elim1), (intro2, elim2)) = |
9418 | 152 |
(Drule.merge_rules (intro1, intro2), Drule.merge_rules (elim1, elim2)); |
10008 | 153 |
val print = print_rules; |
8153
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
154 |
end; |
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
155 |
|
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
156 |
structure GlobalRules = TheoryDataFun(GlobalRulesArgs); |
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
157 |
val print_global_rules = GlobalRules.print; |
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
158 |
|
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
159 |
|
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
160 |
(* proof data kind 'Isar/rules' *) |
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
161 |
|
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
162 |
structure LocalRulesArgs = |
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
163 |
struct |
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
164 |
val name = "Isar/rules"; |
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
165 |
type T = thm list * thm list; |
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
166 |
|
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
167 |
val init = GlobalRules.get; |
10008 | 168 |
val print = print_rules o ProofContext.sign_of; |
8153
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
169 |
end; |
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
170 |
|
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
171 |
structure LocalRules = ProofDataFun(LocalRulesArgs); |
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
172 |
val print_local_rules = LocalRules.print; |
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
173 |
|
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
174 |
|
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
175 |
|
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
176 |
(** attributes **) |
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
177 |
|
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
178 |
(* add rules *) |
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
179 |
|
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
180 |
local |
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
181 |
|
9938 | 182 |
fun add_dest th (intro, elim) = (intro, Drule.add_rules [Tactic.make_elim th] elim); |
183 |
fun add_elim th (intro, elim) = (intro, Drule.add_rules [th] elim); |
|
184 |
fun add_intro th (intro, elim) = (Drule.add_rules [th] intro, elim); |
|
8153
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
185 |
|
9938 | 186 |
fun del_rule th (intro, elim) = |
187 |
let |
|
188 |
val th' = Tactic.make_elim th; |
|
189 |
val del = Drule.del_rules [th'] o Drule.del_rules [th]; |
|
190 |
in (del intro, del elim) end; |
|
8153
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
191 |
|
9938 | 192 |
fun mk_att f g (x, th) = (f (g th) x, th); |
8153
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
193 |
|
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
194 |
in |
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
195 |
|
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
196 |
val dest_global = mk_att GlobalRules.map add_dest; |
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
197 |
val elim_global = mk_att GlobalRules.map add_elim; |
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
198 |
val intro_global = mk_att GlobalRules.map add_intro; |
9938 | 199 |
val rule_del_global = mk_att GlobalRules.map del_rule; |
8153
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
200 |
|
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
201 |
val dest_local = mk_att LocalRules.map add_dest; |
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
202 |
val elim_local = mk_att LocalRules.map add_elim; |
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
203 |
val intro_local = mk_att LocalRules.map add_intro; |
9938 | 204 |
val rule_del_local = mk_att LocalRules.map del_rule; |
205 |
||
10034 | 206 |
fun del_args att = Attrib.syntax (Scan.lift Args.del >> K att); |
8153
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
207 |
|
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
208 |
end; |
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
209 |
|
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
210 |
|
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
211 |
(* concrete syntax *) |
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
212 |
|
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
213 |
val rule_atts = |
9900 | 214 |
[("dest", (Attrib.no_args dest_global, Attrib.no_args dest_local), |
215 |
"declaration of destruction rule"), |
|
216 |
("elim", (Attrib.no_args elim_global, Attrib.no_args elim_local), |
|
217 |
"declaration of elimination rule"), |
|
218 |
("intro", (Attrib.no_args intro_global, Attrib.no_args intro_local), |
|
219 |
"declaration of introduction rule"), |
|
9938 | 220 |
("rule", (del_args rule_del_global, del_args rule_del_local), |
9900 | 221 |
"remove declaration of elim/intro rule")]; |
8153
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
222 |
|
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
223 |
|
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
224 |
|
5824 | 225 |
(** proof methods **) |
226 |
||
8372 | 227 |
(* make methods *) |
5824 | 228 |
|
6849 | 229 |
val METHOD = Proof.method; |
8372 | 230 |
val METHOD_CASES = Proof.method_cases; |
231 |
||
5824 | 232 |
|
233 |
(* primitive *) |
|
234 |
||
235 |
val fail = METHOD (K no_tac); |
|
236 |
val succeed = METHOD (K all_tac); |
|
237 |
||
238 |
||
8167 | 239 |
(* shuffle *) |
240 |
||
8240 | 241 |
fun prefer i = METHOD (K (Tactic.defer_tac i THEN PRIMITIVE (Thm.permute_prems 0 ~1))); |
8167 | 242 |
fun defer opt_i = METHOD (K (Tactic.defer_tac (if_none opt_i 1))); |
243 |
||
244 |
||
7419 | 245 |
(* insert *) |
246 |
||
247 |
local |
|
5824 | 248 |
|
6981 | 249 |
fun cut_rule_tac raw_rule = |
250 |
let |
|
251 |
val rule = Drule.forall_intr_vars raw_rule; |
|
252 |
val revcut_rl = Drule.incr_indexes_wrt [] [] [] [rule] Drule.revcut_rl; |
|
7555 | 253 |
in Tactic.rtac (rule COMP revcut_rl) end; |
6981 | 254 |
|
7419 | 255 |
in |
5824 | 256 |
|
7419 | 257 |
fun insert_tac [] i = all_tac |
258 |
| insert_tac facts i = EVERY (map (fn th => cut_rule_tac th i) facts); |
|
6981 | 259 |
|
7555 | 260 |
val insert_facts = METHOD (ALLGOALS o insert_tac); |
7664 | 261 |
fun insert thms = METHOD (fn _ => ALLGOALS (insert_tac thms)); |
7419 | 262 |
|
263 |
end; |
|
5824 | 264 |
|
265 |
||
9706 | 266 |
(* simple methods *) |
267 |
||
268 |
fun SIMPLE_METHOD tac = METHOD (fn facts => ALLGOALS (insert_tac facts) THEN tac); |
|
269 |
fun SIMPLE_METHOD' quant tac = METHOD (fn facts => quant (insert_tac facts THEN' tac)); |
|
270 |
||
271 |
||
7601 | 272 |
(* unfold / fold definitions *) |
6532 | 273 |
|
9706 | 274 |
fun unfold thms = SIMPLE_METHOD (CHANGED (rewrite_goals_tac thms)); |
275 |
fun fold thms = SIMPLE_METHOD (CHANGED (fold_goals_tac thms)); |
|
9484 | 276 |
|
277 |
||
278 |
(* atomize meta-connectives *) |
|
279 |
||
9485 | 280 |
fun atomize_tac rews i thm = |
281 |
if Logic.has_meta_prems (#prop (Thm.rep_thm thm)) i then |
|
282 |
Tactic.asm_rewrite_goal_tac (true, false, false) (K no_tac) (Thm.mss_of rews) i thm |
|
283 |
else all_tac thm; |
|
284 |
||
285 |
fun atomize_goal rews i thm = |
|
286 |
(case Seq.pull (atomize_tac rews i thm) of |
|
287 |
None => thm |
|
288 |
| Some (thm', _) => thm'); |
|
6532 | 289 |
|
290 |
||
7419 | 291 |
(* multi_resolve *) |
292 |
||
293 |
local |
|
294 |
||
295 |
fun res th i rule = |
|
296 |
Thm.biresolution false [(false, th)] i rule handle THM _ => Seq.empty; |
|
297 |
||
298 |
fun multi_res _ [] rule = Seq.single rule |
|
299 |
| multi_res i (th :: ths) rule = Seq.flat (Seq.map (res th i) (multi_res (i + 1) ths rule)); |
|
300 |
||
301 |
in |
|
302 |
||
303 |
val multi_resolve = multi_res 1; |
|
8372 | 304 |
fun multi_resolves facts rules = Seq.flat (Seq.map (multi_resolve facts) (Seq.of_list rules)); |
7419 | 305 |
|
306 |
end; |
|
307 |
||
308 |
||
8372 | 309 |
(* general rule *) |
5824 | 310 |
|
8335 | 311 |
fun gen_resolveq_tac tac rules i st = |
8372 | 312 |
Seq.flat (Seq.map (fn rule => tac rule i st) rules); |
313 |
||
314 |
val resolveq_tac = gen_resolveq_tac Tactic.rtac; |
|
8335 | 315 |
|
9631 | 316 |
fun resolveq_cases_tac open_parms = gen_resolveq_tac (fn (rule, cases) => fn i => fn st => |
9653 | 317 |
Seq.map (rpair (RuleCases.make (not open_parms) rule cases)) (Tactic.rtac rule i st)); |
8335 | 318 |
|
319 |
||
8372 | 320 |
(* simple rule *) |
321 |
||
7419 | 322 |
local |
5824 | 323 |
|
7130 | 324 |
fun gen_rule_tac tac rules [] = tac rules |
8372 | 325 |
| gen_rule_tac tac erules facts = gen_resolveq_tac (tac o single) (multi_resolves facts erules); |
7130 | 326 |
|
10309 | 327 |
fun gen_some_rule_tac tac arg_rules ctxt facts = |
8153
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
328 |
let val rules = |
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
329 |
if not (null arg_rules) then arg_rules |
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
330 |
else if null facts then #1 (LocalRules.get ctxt) |
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
331 |
else op @ (LocalRules.get ctxt); |
10309 | 332 |
in tac rules facts end; |
333 |
||
334 |
fun gen_rule tac rules = METHOD (HEADGOAL o tac rules); |
|
335 |
fun gen_rule' tac arg_rules ctxt = METHOD (HEADGOAL o gen_some_rule_tac tac arg_rules ctxt); |
|
8153
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
336 |
|
8220 | 337 |
fun setup raw_tac = |
338 |
let val tac = gen_rule_tac raw_tac |
|
339 |
in (tac, gen_rule tac, gen_rule' tac) end; |
|
340 |
||
7419 | 341 |
in |
342 |
||
10309 | 343 |
val some_rule_tac = gen_some_rule_tac (gen_rule_tac Tactic.resolve_tac); |
8220 | 344 |
val (rule_tac, rule, some_rule) = setup Tactic.resolve_tac; |
345 |
val (erule_tac, erule, some_erule) = setup Tactic.eresolve_tac; |
|
346 |
val (drule_tac, drule, some_drule) = setup Tactic.dresolve_tac; |
|
347 |
val (frule_tac, frule, some_frule) = setup Tactic.forward_tac; |
|
5824 | 348 |
|
7419 | 349 |
end; |
350 |
||
351 |
||
8195 | 352 |
(* this *) |
353 |
||
8671 | 354 |
val this = METHOD (EVERY o map (HEADGOAL o Tactic.rtac)); |
8195 | 355 |
|
356 |
||
357 |
(* assumption *) |
|
7555 | 358 |
|
359 |
fun assm_tac ctxt = |
|
360 |
assume_tac APPEND' resolve_tac (filter Thm.no_prems (ProofContext.prems_of ctxt)); |
|
7419 | 361 |
|
7555 | 362 |
fun assumption_tac ctxt [] = assm_tac ctxt |
363 |
| assumption_tac _ [fact] = resolve_tac [fact] |
|
364 |
| assumption_tac _ _ = K no_tac; |
|
7419 | 365 |
|
8671 | 366 |
fun assumption ctxt = METHOD (HEADGOAL o assumption_tac ctxt); |
7419 | 367 |
|
368 |
||
9539 | 369 |
(* res_inst_tac etc. *) |
8238 | 370 |
|
9539 | 371 |
(*Note: insts refer to the implicit (!!) goal context; use at your own risk*) |
9565
3eb2ea15cc69
res_inst: include non-inst versions with multiple thms;
wenzelm
parents:
9539
diff
changeset
|
372 |
fun gen_res_inst _ tac (quant, ([], thms)) = |
3eb2ea15cc69
res_inst: include non-inst versions with multiple thms;
wenzelm
parents:
9539
diff
changeset
|
373 |
METHOD (fn facts => (quant (insert_tac facts THEN' tac thms))) |
3eb2ea15cc69
res_inst: include non-inst versions with multiple thms;
wenzelm
parents:
9539
diff
changeset
|
374 |
| gen_res_inst tac _ (quant, (insts, [thm])) = |
3eb2ea15cc69
res_inst: include non-inst versions with multiple thms;
wenzelm
parents:
9539
diff
changeset
|
375 |
METHOD (fn facts => (quant (insert_tac facts THEN' tac insts thm))) |
3eb2ea15cc69
res_inst: include non-inst versions with multiple thms;
wenzelm
parents:
9539
diff
changeset
|
376 |
| gen_res_inst _ _ _ = error "Cannot have instantiations with multiple rules"; |
8238 | 377 |
|
9565
3eb2ea15cc69
res_inst: include non-inst versions with multiple thms;
wenzelm
parents:
9539
diff
changeset
|
378 |
val res_inst = gen_res_inst Tactic.res_inst_tac Tactic.resolve_tac; |
3eb2ea15cc69
res_inst: include non-inst versions with multiple thms;
wenzelm
parents:
9539
diff
changeset
|
379 |
val eres_inst = gen_res_inst Tactic.eres_inst_tac Tactic.eresolve_tac; |
3eb2ea15cc69
res_inst: include non-inst versions with multiple thms;
wenzelm
parents:
9539
diff
changeset
|
380 |
val dres_inst = gen_res_inst Tactic.dres_inst_tac Tactic.dresolve_tac; |
3eb2ea15cc69
res_inst: include non-inst versions with multiple thms;
wenzelm
parents:
9539
diff
changeset
|
381 |
val forw_inst = gen_res_inst Tactic.forw_inst_tac Tactic.forward_tac; |
3eb2ea15cc69
res_inst: include non-inst versions with multiple thms;
wenzelm
parents:
9539
diff
changeset
|
382 |
val cut_inst = gen_res_inst Tactic.cut_inst_tac Tactic.cut_facts_tac; |
8238 | 383 |
|
384 |
||
8329 | 385 |
(* simple Prolog interpreter *) |
386 |
||
387 |
fun prolog_tac rules facts = |
|
388 |
DEPTH_SOLVE_1 (HEADGOAL (Tactic.assume_tac APPEND' Tactic.resolve_tac (facts @ rules))); |
|
389 |
||
390 |
val prolog = METHOD o prolog_tac; |
|
391 |
||
392 |
||
8351 | 393 |
(* ML tactics *) |
394 |
||
395 |
val tactic_ref = ref ((fn _ => raise Match): Proof.context -> thm list -> tactic); |
|
396 |
fun set_tactic f = tactic_ref := f; |
|
397 |
||
398 |
fun tactic txt ctxt = METHOD (fn facts => |
|
9631 | 399 |
(Context.use_mltext |
400 |
("let fun tactic (ctxt: PureIsar.Proof.context) (facts: thm list) : tactic = \ |
|
401 |
\let val thm = PureIsar.ProofContext.get_thm_closure ctxt\n\ |
|
402 |
\ and thms = PureIsar.ProofContext.get_thms_closure ctxt in\n" |
|
403 |
^ txt ^ |
|
404 |
"\nend in PureIsar.Method.set_tactic tactic end") |
|
405 |
false None; |
|
406 |
Context.setmp (Some (ProofContext.theory_of ctxt)) (! tactic_ref ctxt) facts)); |
|
8351 | 407 |
|
408 |
||
5824 | 409 |
|
410 |
(** methods theory data **) |
|
411 |
||
412 |
(* data kind 'Isar/methods' *) |
|
413 |
||
414 |
structure MethodsDataArgs = |
|
415 |
struct |
|
416 |
val name = "Isar/methods"; |
|
417 |
type T = |
|
418 |
{space: NameSpace.T, |
|
419 |
meths: (((Args.src -> Proof.context -> Proof.method) * string) * stamp) Symtab.table}; |
|
420 |
||
421 |
val empty = {space = NameSpace.empty, meths = Symtab.empty}; |
|
6546 | 422 |
val copy = I; |
5824 | 423 |
val prep_ext = I; |
424 |
fun merge ({space = space1, meths = meths1}, {space = space2, meths = meths2}) = |
|
425 |
{space = NameSpace.merge (space1, space2), |
|
426 |
meths = Symtab.merge eq_snd (meths1, meths2) handle Symtab.DUPS dups => |
|
427 |
error ("Attempt to merge different versions of methods " ^ commas_quote dups)}; |
|
428 |
||
9222 | 429 |
fun print _ {space, meths} = |
5824 | 430 |
let |
431 |
fun prt_meth (name, ((_, comment), _)) = Pretty.block |
|
6849 | 432 |
[Pretty.str (name ^ ":"), Pretty.brk 2, Pretty.str comment]; |
5824 | 433 |
in |
8720 | 434 |
[Pretty.big_list "methods:" (map prt_meth (NameSpace.cond_extern_table space meths))] |
9222 | 435 |
|> Pretty.chunks |> Pretty.writeln |
5824 | 436 |
end; |
437 |
end; |
|
438 |
||
439 |
structure MethodsData = TheoryDataFun(MethodsDataArgs); |
|
440 |
val print_methods = MethodsData.print; |
|
7611 | 441 |
|
5824 | 442 |
|
443 |
(* get methods *) |
|
444 |
||
5916 | 445 |
exception METHOD_FAIL of (string * Position.T) * exn; |
446 |
||
5824 | 447 |
fun method thy = |
448 |
let |
|
449 |
val {space, meths} = MethodsData.get thy; |
|
450 |
||
5884 | 451 |
fun meth src = |
452 |
let |
|
453 |
val ((raw_name, _), pos) = Args.dest_src src; |
|
454 |
val name = NameSpace.intern space raw_name; |
|
455 |
in |
|
5824 | 456 |
(case Symtab.lookup (meths, name) of |
457 |
None => error ("Unknown proof method: " ^ quote name ^ Position.str_of pos) |
|
5916 | 458 |
| Some ((mth, _), _) => transform_failure (curry METHOD_FAIL (name, pos)) (mth src)) |
5824 | 459 |
end; |
460 |
in meth end; |
|
461 |
||
462 |
||
9194 | 463 |
(* add_method(s) *) |
5824 | 464 |
|
465 |
fun add_methods raw_meths thy = |
|
466 |
let |
|
467 |
val full = Sign.full_name (Theory.sign_of thy); |
|
468 |
val new_meths = |
|
469 |
map (fn (name, f, comment) => (full name, ((f, comment), stamp ()))) raw_meths; |
|
470 |
||
471 |
val {space, meths} = MethodsData.get thy; |
|
472 |
val space' = NameSpace.extend (space, map fst new_meths); |
|
473 |
val meths' = Symtab.extend (meths, new_meths) handle Symtab.DUPS dups => |
|
474 |
error ("Duplicate declaration of method(s) " ^ commas_quote dups); |
|
475 |
in |
|
476 |
thy |> MethodsData.put {space = space', meths = meths'} |
|
477 |
end; |
|
478 |
||
9194 | 479 |
val add_method = add_methods o Library.single; |
480 |
||
5824 | 481 |
(*implicit version*) |
482 |
fun Method name meth cmt = Context.>> (add_methods [(name, meth, cmt)]); |
|
483 |
||
484 |
||
5884 | 485 |
|
486 |
(** method syntax **) |
|
5824 | 487 |
|
5884 | 488 |
(* basic *) |
489 |
||
490 |
fun syntax (scan: (Proof.context * Args.T list -> 'a * (Proof.context * Args.T list))) = |
|
491 |
Args.syntax "method" scan; |
|
5824 | 492 |
|
8351 | 493 |
fun simple_args scan f src ctxt : Proof.method = |
494 |
#2 (syntax (Scan.lift (scan >> (fn x => f x ctxt))) src ctxt); |
|
495 |
||
7555 | 496 |
fun ctxt_args (f: Proof.context -> Proof.method) src ctxt = |
8282 | 497 |
#2 (syntax (Scan.succeed (f ctxt)) src ctxt); |
7555 | 498 |
|
499 |
fun no_args m = ctxt_args (K m); |
|
5884 | 500 |
|
501 |
||
8351 | 502 |
|
5884 | 503 |
(* sections *) |
5824 | 504 |
|
7268 | 505 |
type modifier = (Proof.context -> Proof.context) * Proof.context attribute; |
506 |
||
507 |
local |
|
508 |
||
8381 | 509 |
fun sect ss = Scan.first (map Scan.lift ss); |
5884 | 510 |
fun thms ss = Scan.unless (sect ss) Attrib.local_thms; |
511 |
fun thmss ss = Scan.repeat (thms ss) >> flat; |
|
512 |
||
7268 | 513 |
fun apply (f, att) (ctxt, ths) = Thm.applys_attributes ((f ctxt, ths), [att]); |
5824 | 514 |
|
7268 | 515 |
fun section ss = (sect ss -- thmss ss) :-- (fn (m, ths) => Scan.depend (fn ctxt => |
516 |
Scan.succeed (apply m (ctxt, ths)))) >> #2; |
|
5884 | 517 |
|
7601 | 518 |
fun sectioned args ss = args -- Scan.repeat (section ss); |
5884 | 519 |
|
7268 | 520 |
in |
5824 | 521 |
|
5884 | 522 |
fun sectioned_args args ss f src ctxt = |
8282 | 523 |
let val (ctxt', (x, _)) = syntax (sectioned args ss) src ctxt |
5921 | 524 |
in f x ctxt' end; |
5884 | 525 |
|
7601 | 526 |
fun bang_sectioned_args ss f = sectioned_args Args.bang_facts ss f; |
9777 | 527 |
fun bang_sectioned_args' ss scan f = |
528 |
sectioned_args (Args.bang_facts -- scan >> swap) ss (uncurry f); |
|
7601 | 529 |
fun only_sectioned_args ss f = sectioned_args (Scan.succeed ()) ss (fn () => f); |
7268 | 530 |
|
8093 | 531 |
fun thms_ctxt_args f = sectioned_args (thmss []) [] f; |
532 |
fun thms_args f = thms_ctxt_args (K o f); |
|
9706 | 533 |
fun thm_args f = thms_args (fn [thm] => f thm | _ => error "Single theorem expected"); |
5824 | 534 |
|
7268 | 535 |
end; |
536 |
||
5824 | 537 |
|
9539 | 538 |
(* tactic syntax *) |
8238 | 539 |
|
540 |
val insts = |
|
9539 | 541 |
Scan.optional |
9565
3eb2ea15cc69
res_inst: include non-inst versions with multiple thms;
wenzelm
parents:
9539
diff
changeset
|
542 |
(Args.enum1 "and" (Scan.lift (Args.name -- (Args.$$$ "=" |-- Args.!!! Args.name))) --| |
3eb2ea15cc69
res_inst: include non-inst versions with multiple thms;
wenzelm
parents:
9539
diff
changeset
|
543 |
Scan.lift (Args.$$$ "in")) [] -- Attrib.local_thmss; |
8238 | 544 |
|
8537 | 545 |
fun inst_args f = f oo (#2 oo syntax (Args.goal_spec HEADGOAL -- insts)); |
546 |
||
547 |
||
9539 | 548 |
fun goal_args' args tac = #2 oo syntax (Args.goal_spec HEADGOAL -- args >> |
9706 | 549 |
(fn (quant, s) => SIMPLE_METHOD' quant (tac s))); |
8537 | 550 |
|
9539 | 551 |
fun goal_args args tac = goal_args' (Scan.lift args) tac; |
8238 | 552 |
|
553 |
||
5824 | 554 |
|
555 |
(** method text **) |
|
556 |
||
557 |
(* datatype text *) |
|
558 |
||
559 |
datatype text = |
|
560 |
Basic of (Proof.context -> Proof.method) | |
|
561 |
Source of Args.src | |
|
562 |
Then of text list | |
|
563 |
Orelse of text list | |
|
564 |
Try of text | |
|
565 |
Repeat1 of text; |
|
566 |
||
567 |
||
568 |
(* refine *) |
|
569 |
||
8238 | 570 |
fun gen_refine f text state = |
5824 | 571 |
let |
572 |
val thy = Proof.theory_of state; |
|
573 |
||
8238 | 574 |
fun eval (Basic mth) = f mth |
575 |
| eval (Source src) = f (method thy src) |
|
5824 | 576 |
| eval (Then txts) = Seq.EVERY (map eval txts) |
577 |
| eval (Orelse txts) = Seq.FIRST (map eval txts) |
|
578 |
| eval (Try txt) = Seq.TRY (eval txt) |
|
579 |
| eval (Repeat1 txt) = Seq.REPEAT1 (eval txt); |
|
580 |
in eval text state end; |
|
581 |
||
8238 | 582 |
val refine = gen_refine Proof.refine; |
583 |
val refine_end = gen_refine Proof.refine_end; |
|
6404 | 584 |
|
5824 | 585 |
|
6404 | 586 |
(* structured proof steps *) |
5824 | 587 |
|
7506 | 588 |
val default_text = Source (Args.src (("default", []), Position.none)); |
8195 | 589 |
val this_text = Basic (K this); |
9706 | 590 |
val done_text = Basic (K (SIMPLE_METHOD all_tac)); |
7555 | 591 |
|
8966 | 592 |
fun close_text asm = Basic (fn ctxt => METHOD (K |
593 |
(FILTER Thm.no_prems ((if asm then ALLGOALS (assm_tac ctxt) else all_tac) THEN flexflex_tac)))); |
|
594 |
||
595 |
fun finish_text asm None = close_text asm |
|
596 |
| finish_text asm (Some txt) = Then [txt, close_text asm]; |
|
6872 | 597 |
|
5824 | 598 |
fun proof opt_text state = |
599 |
state |
|
600 |
|> Proof.assert_backward |
|
6404 | 601 |
|> refine (if_none opt_text default_text) |
8242 | 602 |
|> Seq.map (Proof.goal_facts (K [])) |
5824 | 603 |
|> Seq.map Proof.enter_forward; |
604 |
||
8966 | 605 |
fun local_qed asm opt_text = Proof.local_qed (refine (finish_text asm opt_text)); |
606 |
fun local_terminal_proof (text, opt_text) pr = |
|
607 |
Seq.THEN (proof (Some text), local_qed true opt_text pr); |
|
608 |
val local_default_proof = local_terminal_proof (default_text, None); |
|
8195 | 609 |
val local_immediate_proof = local_terminal_proof (this_text, None); |
8966 | 610 |
fun local_done_proof pr = Seq.THEN (proof (Some done_text), local_qed false None pr); |
5824 | 611 |
|
6872 | 612 |
|
8966 | 613 |
fun global_qeds asm opt_text = Proof.global_qed (refine (finish_text asm opt_text)); |
5824 | 614 |
|
8966 | 615 |
fun global_qed asm opt_text state = |
6872 | 616 |
state |
8966 | 617 |
|> global_qeds asm opt_text |
6872 | 618 |
|> Proof.check_result "Failed to finish proof" state |
619 |
|> Seq.hd; |
|
620 |
||
8966 | 621 |
fun global_term_proof asm (text, opt_text) state = |
6872 | 622 |
state |
623 |
|> proof (Some text) |
|
624 |
|> Proof.check_result "Terminal proof method failed" state |
|
8966 | 625 |
|> (Seq.flat o Seq.map (global_qeds asm opt_text)) |
6872 | 626 |
|> Proof.check_result "Failed to finish proof (after successful terminal method)" state |
627 |
|> Seq.hd; |
|
628 |
||
8966 | 629 |
val global_terminal_proof = global_term_proof true; |
6934 | 630 |
val global_default_proof = global_terminal_proof (default_text, None); |
8966 | 631 |
val global_immediate_proof = global_terminal_proof (this_text, None); |
632 |
val global_done_proof = global_term_proof false (done_text, None); |
|
5824 | 633 |
|
634 |
||
635 |
(** theory setup **) |
|
636 |
||
9539 | 637 |
(* misc tactic emulations *) |
638 |
||
639 |
val subgoal_meth = goal_args (Scan.repeat1 Args.name) Tactic.subgoals_tac; |
|
640 |
val thin_meth = goal_args Args.name Tactic.thin_tac; |
|
641 |
val rename_meth = goal_args (Scan.repeat1 Args.name) Tactic.rename_params_tac; |
|
9631 | 642 |
val rotate_meth = goal_args (Scan.optional Args.int 1) Tactic.rotate_tac; |
9539 | 643 |
|
644 |
||
5824 | 645 |
(* pure_methods *) |
646 |
||
647 |
val pure_methods = |
|
648 |
[("fail", no_args fail, "force failure"), |
|
649 |
("succeed", no_args succeed, "succeed"), |
|
9587 | 650 |
("-", no_args insert_facts, "do nothing (insert current facts only)"), |
9539 | 651 |
("insert", thms_args insert, "insert theorems, ignoring facts (improper)"), |
7601 | 652 |
("unfold", thms_args unfold, "unfold definitions"), |
653 |
("fold", thms_args fold, "fold definitions"), |
|
8153
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
654 |
("rule", thms_ctxt_args some_rule, "apply some rule"), |
9539 | 655 |
("erule", thms_ctxt_args some_erule, "apply some rule in elimination manner (improper)"), |
656 |
("drule", thms_ctxt_args some_drule, "apply some rule in destruct manner (improper)"), |
|
657 |
("frule", thms_ctxt_args some_frule, "apply some rule in forward manner (improper)"), |
|
8195 | 658 |
("this", no_args this, "apply current facts as rules"), |
8238 | 659 |
("assumption", ctxt_args assumption, "proof by assumption, preferring facts"), |
9539 | 660 |
("rule_tac", inst_args res_inst, "apply rule (dynamic instantiation!)"), |
661 |
("erule_tac", inst_args eres_inst, "apply rule in elimination manner (dynamic instantiation!)"), |
|
662 |
("drule_tac", inst_args dres_inst, "apply rule in destruct manner (dynamic instantiation!)"), |
|
663 |
("frule_tac", inst_args forw_inst, "apply rule in forward manner (dynamic instantiation!)"), |
|
664 |
("cut_tac", inst_args cut_inst, "cut rule (dynamic instantiation!)"), |
|
9565
3eb2ea15cc69
res_inst: include non-inst versions with multiple thms;
wenzelm
parents:
9539
diff
changeset
|
665 |
("subgoal_tac", subgoal_meth, "insert subgoal (dynamic instantiation!)"), |
3eb2ea15cc69
res_inst: include non-inst versions with multiple thms;
wenzelm
parents:
9539
diff
changeset
|
666 |
("thin_tac", thin_meth, "remove premise (dynamic instantiation!)"), |
9631 | 667 |
("rename_tac", rename_meth, "rename parameters of goal (dynamic instantiation!)"), |
668 |
("rotate_tac", rotate_meth, "rotate assumptions of goal"), |
|
8351 | 669 |
("prolog", thms_args prolog, "simple prolog interpreter"), |
670 |
("tactic", simple_args Args.name tactic, "ML tactic as proof method")]; |
|
5824 | 671 |
|
672 |
||
673 |
(* setup *) |
|
674 |
||
8153
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
675 |
val setup = |
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
676 |
[GlobalRules.init, LocalRules.init, Attrib.add_attributes rule_atts, |
9bdbcb71dc56
maintain standard rules (beware: classical provers provides another version!);
wenzelm
parents:
8093
diff
changeset
|
677 |
MethodsData.init, add_methods pure_methods]; |
5824 | 678 |
|
679 |
||
680 |
end; |
|
681 |
||
682 |
||
683 |
structure BasicMethod: BASIC_METHOD = Method; |
|
684 |
open BasicMethod; |