author | wenzelm |
Wed, 07 May 2008 15:32:31 +0200 | |
changeset 26846 | 2e6726015771 |
child 26852 | a31203f58b20 |
permissions | -rw-r--r-- |
26846
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
1 |
(* $Id$ *) |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
2 |
|
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
3 |
theory ML_Tactic |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
4 |
imports Main |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
5 |
begin |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
6 |
|
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
7 |
chapter {* ML tactic expressions \label{sec:conv-tac} *} |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
8 |
|
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
9 |
text {* |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
10 |
Isar Proof methods closely resemble traditional tactics, when used |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
11 |
in unstructured sequences of @{command "apply"} commands. |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
12 |
Isabelle/Isar provides emulations for all major ML tactics of |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
13 |
classic Isabelle --- mostly for the sake of easy porting of existing |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
14 |
developments, as actual Isar proof texts would demand much less |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
15 |
diversity of proof methods. |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
16 |
|
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
17 |
Unlike tactic expressions in ML, Isar proof methods provide proper |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
18 |
concrete syntax for additional arguments, options, modifiers etc. |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
19 |
Thus a typical method text is usually more concise than the |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
20 |
corresponding ML tactic. Furthermore, the Isar versions of classic |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
21 |
Isabelle tactics often cover several variant forms by a single |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
22 |
method with separate options to tune the behavior. For example, |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
23 |
method @{method simp} replaces all of @{ML simp_tac}~/ @{ML |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
24 |
asm_simp_tac}~/ @{ML full_simp_tac}~/ @{ML asm_full_simp_tac}, there |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
25 |
is also concrete syntax for augmenting the Simplifier context (the |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
26 |
current ``simpset'') in a convenient way. |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
27 |
*} |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
28 |
|
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
29 |
|
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
30 |
section {* Resolution tactics *} |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
31 |
|
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
32 |
text {* |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
33 |
Classic Isabelle provides several variant forms of tactics for |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
34 |
single-step rule applications (based on higher-order resolution). |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
35 |
The space of resolution tactics has the following main dimensions. |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
36 |
|
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
37 |
\begin{enumerate} |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
38 |
|
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
39 |
\item The ``mode'' of resolution: intro, elim, destruct, or forward |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
40 |
(e.g.\ @{ML resolve_tac}, @{ML eresolve_tac}, @{ML dresolve_tac}, |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
41 |
@{ML forward_tac}). |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
42 |
|
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
43 |
\item Optional explicit instantiation (e.g.\ @{ML resolve_tac} vs.\ |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
44 |
@{ML res_inst_tac}). |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
45 |
|
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
46 |
\item Abbreviations for singleton arguments (e.g.\ @{ML resolve_tac} |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
47 |
vs.\ @{ML rtac}). |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
48 |
|
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
49 |
\end{enumerate} |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
50 |
|
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
51 |
Basically, the set of Isar tactic emulations @{method rule_tac}, |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
52 |
@{method erule_tac}, @{method drule_tac}, @{method frule_tac} (see |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
53 |
\secref{sec:tactics}) would be sufficient to cover the four modes, |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
54 |
either with or without instantiation, and either with single or |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
55 |
multiple arguments. Although it is more convenient in most cases to |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
56 |
use the plain @{method rule} method (see |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
57 |
\secref{sec:pure-meth-att}), or any of its ``improper'' variants |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
58 |
@{method erule}, @{method drule}, @{method frule} (see |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
59 |
\secref{sec:misc-meth-att}). Note that explicit goal addressing is |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
60 |
only supported by the actual @{method rule_tac} version. |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
61 |
|
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
62 |
With this in mind, plain resolution tactics correspond to Isar |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
63 |
methods as follows. |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
64 |
|
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
65 |
\medskip |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
66 |
\begin{tabular}{lll} |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
67 |
@{ML rtac}~@{text "a 1"} & & @{text "rule a"} \\ |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
68 |
@{ML resolve_tac}~@{text "[a\<^sub>1, \<dots>] 1"} & & @{text "rule a\<^sub>1 \<dots>"} \\ |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
69 |
@{ML res_inst_tac}~@{text "[(x\<^sub>1, t\<^sub>1), \<dots>] a 1"} & & |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
70 |
@{text "rule_tac x\<^sub>1 = t\<^sub>1 \<AND> \<dots> \<IN> a"} \\[0.5ex] |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
71 |
@{ML rtac}~@{text "a i"} & & @{text "rule_tac [i] a"} \\ |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
72 |
@{ML resolve_tac}~@{text "[a\<^sub>1, \<dots>] i"} & & @{text "rule_tac [i] a\<^sub>1 \<dots>"} \\ |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
73 |
@{ML res_inst_tac}~@{text "[(x\<^sub>1, t\<^sub>1), \<dots>] a i"} & & |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
74 |
@{text "rule_tac [i] x\<^sub>1 = t\<^sub>1 \<AND> \<dots> \<IN> a"} \\ |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
75 |
\end{tabular} |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
76 |
\medskip |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
77 |
|
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
78 |
Note that explicit goal addressing may be usually avoided by |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
79 |
changing the order of subgoals with @{command "defer"} or @{command |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
80 |
"prefer"} (see \secref{sec:tactic-commands}). |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
81 |
*} |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
82 |
|
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
83 |
|
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
84 |
section {* Simplifier tactics *} |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
85 |
|
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
86 |
text {* |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
87 |
The main Simplifier tactics @{ML simp_tac} and variants (cf.\ |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
88 |
\cite{isabelle-ref}) are all covered by the @{method simp} and |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
89 |
@{method simp_all} methods (see \secref{sec:simplifier}). Note that |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
90 |
there is no individual goal addressing available, simplification |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
91 |
acts either on the first goal (@{method simp}) or all goals |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
92 |
(@{method simp_all}). |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
93 |
|
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
94 |
\medskip |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
95 |
\begin{tabular}{lll} |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
96 |
@{ML asm_full_simp_tac}~@{text "@{simpset} 1"} & & @{method simp} \\ |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
97 |
@{ML ALLGOALS}~(@{ML asm_full_simp_tac}~@{text "@{simpset}"}) & & @{method simp_all} \\[0.5ex] |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
98 |
@{ML simp_tac}~@{text "@{simpset} 1"} & & @{method simp}~@{text "(no_asm)"} \\ |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
99 |
@{ML asm_simp_tac}~@{text "@{simpset} 1"} & & @{method simp}~@{text "(no_asm_simp)"} \\ |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
100 |
@{ML full_simp_tac}~@{text "@{simpset} 1"} & & @{method simp}~@{text "(no_asm_use)"} \\ |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
101 |
@{ML asm_lr_simp_tac}~@{text "@{simpset} 1"} & & @{method simp}~@{text "(asm_lr)"} \\ |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
102 |
\end{tabular} |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
103 |
\medskip |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
104 |
*} |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
105 |
|
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
106 |
|
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
107 |
section {* Classical Reasoner tactics *} |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
108 |
|
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
109 |
text {* |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
110 |
The Classical Reasoner provides a rather large number of variations |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
111 |
of automated tactics, such as @{ML blast_tac}, @{ML fast_tac}, @{ML |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
112 |
clarify_tac} etc.\ (see \cite{isabelle-ref}). The corresponding |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
113 |
Isar methods usually share the same base name, such as @{method |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
114 |
blast}, @{method fast}, @{method clarify} etc.\ (see |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
115 |
\secref{sec:classical}). |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
116 |
*} |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
117 |
|
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
118 |
|
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
119 |
section {* Miscellaneous tactics *} |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
120 |
|
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
121 |
text {* |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
122 |
There are a few additional tactics defined in various theories of |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
123 |
Isabelle/HOL, some of these also in Isabelle/FOL or Isabelle/ZF. |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
124 |
The most common ones of these may be ported to Isar as follows. |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
125 |
|
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
126 |
\medskip |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
127 |
\begin{tabular}{lll} |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
128 |
@{ML stac}~@{text "a 1"} & & @{text "subst a"} \\ |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
129 |
@{ML hyp_subst_tac}~@{text 1} & & @{text hypsubst} \\ |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
130 |
@{ML strip_tac}~@{text 1} & @{text "\<approx>"} & @{text "intro strip"} \\ |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
131 |
@{ML split_all_tac}~@{text 1} & & @{text "simp (no_asm_simp) only: split_tupled_all"} \\ |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
132 |
& @{text "\<approx>"} & @{text "simp only: split_tupled_all"} \\ |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
133 |
& @{text "\<lless>"} & @{text "clarify"} \\ |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
134 |
\end{tabular} |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
135 |
*} |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
136 |
|
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
137 |
|
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
138 |
section {* Tacticals *} |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
139 |
|
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
140 |
text {* |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
141 |
Classic Isabelle provides a huge amount of tacticals for combination |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
142 |
and modification of existing tactics. This has been greatly reduced |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
143 |
in Isar, providing the bare minimum of combinators only: ``@{text |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
144 |
","}'' (sequential composition), ``@{text "|"}'' (alternative |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
145 |
choices), ``@{text "?"}'' (try), ``@{text "+"}'' (repeat at least |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
146 |
once). These are usually sufficient in practice; if all fails, |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
147 |
arbitrary ML tactic code may be invoked via the @{method tactic} |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
148 |
method (see \secref{sec:tactics}). |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
149 |
|
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
150 |
\medskip Common ML tacticals may be expressed directly in Isar as |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
151 |
follows: |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
152 |
|
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
153 |
\medskip |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
154 |
\begin{tabular}{lll} |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
155 |
@{text "tac\<^sub>1"}~@{ML_text THEN}~@{text "tac\<^sub>2"} & & @{text "meth\<^sub>1, meth\<^sub>2"} \\ |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
156 |
@{text "tac\<^sub>1"}~@{ML_text ORELSE}~@{text "tac\<^sub>2"} & & @{text "meth\<^sub>1 | meth\<^sub>2"} \\ |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
157 |
@{ML TRY}~@{text tac} & & @{text "meth?"} \\ |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
158 |
@{ML REPEAT1}~@{text tac} & & @{text "meth+"} \\ |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
159 |
@{ML REPEAT}~@{text tac} & & @{text "(meth+)?"} \\ |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
160 |
@{ML EVERY}~@{text "[tac\<^sub>1, \<dots>]"} & & @{text "meth\<^sub>1, \<dots>"} \\ |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
161 |
@{ML FIRST}~@{text "[tac\<^sub>1, \<dots>]"} & & @{text "meth\<^sub>1 | \<dots>"} \\ |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
162 |
\end{tabular} |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
163 |
\medskip |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
164 |
|
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
165 |
\medskip @{ML CHANGED} (see \cite{isabelle-ref}) is usually not |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
166 |
required in Isar, since most basic proof methods already fail unless |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
167 |
there is an actual change in the goal state. Nevertheless, ``@{text |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
168 |
"?"}'' (try) may be used to accept \emph{unchanged} results as |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
169 |
well. |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
170 |
|
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
171 |
\medskip @{ML ALLGOALS}, @{ML SOMEGOAL} etc.\ (see |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
172 |
\cite{isabelle-ref}) are not available in Isar, since there is no |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
173 |
direct goal addressing. Nevertheless, some basic methods address |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
174 |
all goals internally, notably @{method simp_all} (see |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
175 |
\secref{sec:simplifier}). Also note that @{ML ALLGOALS} can be |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
176 |
often replaced by ``@{text "+"}'' (repeat at least once), although |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
177 |
this usually has a different operational behavior, such as solving |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
178 |
goals in a different order. |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
179 |
|
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
180 |
\medskip Iterated resolution, such as @{ML_text "REPEAT (FIRSTGOAL |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
181 |
(resolve_tac \<dots>))"}, is usually better expressed using the @{method |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
182 |
intro} and @{method elim} methods of Isar (see |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
183 |
\secref{sec:classical}). |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
184 |
*} |
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
185 |
|
2e6726015771
removed obsolete conversion guide -- converted only section on tactics;
wenzelm
parents:
diff
changeset
|
186 |
end |