author | paulson |
Mon, 23 Jul 2001 17:47:49 +0200 | |
changeset 11448 | aa519e0cc050 |
parent 11442 | 8682a88c3d6a |
child 11469 | 57b072f00626 |
permissions | -rw-r--r-- |
7135 | 1 |
|
7167 | 2 |
\chapter{Generic Tools and Packages}\label{ch:gen-tools} |
3 |
||
8517 | 4 |
\section{Axiomatic Type Classes}\label{sec:axclass} |
7167 | 5 |
|
8904 | 6 |
%FIXME |
7 |
% - qualified names |
|
8 |
% - class intro rules; |
|
9 |
% - class axioms; |
|
10 |
||
8517 | 11 |
\indexisarcmd{axclass}\indexisarcmd{instance}\indexisarmeth{intro-classes} |
7167 | 12 |
\begin{matharray}{rcl} |
8517 | 13 |
\isarcmd{axclass} & : & \isartrans{theory}{theory} \\ |
14 |
\isarcmd{instance} & : & \isartrans{theory}{proof(prove)} \\ |
|
15 |
intro_classes & : & \isarmeth \\ |
|
7167 | 16 |
\end{matharray} |
17 |
||
8517 | 18 |
Axiomatic type classes are provided by Isabelle/Pure as a \emph{definitional} |
19 |
interface to type classes (cf.~\S\ref{sec:classes}). Thus any object logic |
|
8547 | 20 |
may make use of this light-weight mechanism of abstract theories |
8901 | 21 |
\cite{Wenzel:1997:TPHOL}. There is also a tutorial on using axiomatic type |
22 |
classes in isabelle \cite{isabelle-axclass} that is part of the standard |
|
23 |
Isabelle documentation. |
|
8517 | 24 |
|
7167 | 25 |
\begin{rail} |
8517 | 26 |
'axclass' classdecl (axmdecl prop comment? +) |
27 |
; |
|
11100
34d58b1818f4
\<subseteq> syntax for classes/classrel/axclass/instance;
wenzelm
parents:
11095
diff
changeset
|
28 |
'instance' (nameref ('<' | subseteq) nameref | nameref '::' simplearity) comment? |
7167 | 29 |
; |
30 |
\end{rail} |
|
31 |
||
32 |
\begin{descr} |
|
11100
34d58b1818f4
\<subseteq> syntax for classes/classrel/axclass/instance;
wenzelm
parents:
11095
diff
changeset
|
33 |
\item [$\AXCLASS~c \subseteq \vec c~axms$] defines an axiomatic type class as |
34d58b1818f4
\<subseteq> syntax for classes/classrel/axclass/instance;
wenzelm
parents:
11095
diff
changeset
|
34 |
the intersection of existing classes, with additional axioms holding. Class |
10223 | 35 |
axioms may not contain more than one type variable. The class axioms (with |
36 |
implicit sort constraints added) are bound to the given names. Furthermore |
|
37 |
a class introduction rule is generated, which is employed by method |
|
38 |
$intro_classes$ to support instantiation proofs of this class. |
|
39 |
||
11100
34d58b1818f4
\<subseteq> syntax for classes/classrel/axclass/instance;
wenzelm
parents:
11095
diff
changeset
|
40 |
\item [$\INSTANCE~c@1 \subseteq c@2$ and $\INSTANCE~t :: (\vec s)c$] setup a |
34d58b1818f4
\<subseteq> syntax for classes/classrel/axclass/instance;
wenzelm
parents:
11095
diff
changeset
|
41 |
goal stating a class relation or type arity. The proof would usually |
34d58b1818f4
\<subseteq> syntax for classes/classrel/axclass/instance;
wenzelm
parents:
11095
diff
changeset
|
42 |
proceed by $intro_classes$, and then establish the characteristic theorems |
34d58b1818f4
\<subseteq> syntax for classes/classrel/axclass/instance;
wenzelm
parents:
11095
diff
changeset
|
43 |
of the type classes involved. After finishing the proof, the theory will be |
34d58b1818f4
\<subseteq> syntax for classes/classrel/axclass/instance;
wenzelm
parents:
11095
diff
changeset
|
44 |
augmented by a type signature declaration corresponding to the resulting |
34d58b1818f4
\<subseteq> syntax for classes/classrel/axclass/instance;
wenzelm
parents:
11095
diff
changeset
|
45 |
theorem. |
8517 | 46 |
\item [$intro_classes$] repeatedly expands all class introduction rules of |
10858 | 47 |
this theory. Note that this method usually needs not be named explicitly, |
48 |
as it is already included in the default proof step (of $\PROOFNAME$, |
|
49 |
$\BYNAME$, etc.). In particular, instantiation of trivial (syntactic) |
|
50 |
classes may be performed by a single ``$\DDOT$'' proof step. |
|
7167 | 51 |
\end{descr} |
52 |
||
7315 | 53 |
|
54 |
\section{Calculational proof}\label{sec:calculation} |
|
55 |
||
8619 | 56 |
\indexisarcmd{also}\indexisarcmd{finally} |
57 |
\indexisarcmd{moreover}\indexisarcmd{ultimately} |
|
9606 | 58 |
\indexisarcmd{print-trans-rules}\indexisaratt{trans} |
7315 | 59 |
\begin{matharray}{rcl} |
60 |
\isarcmd{also} & : & \isartrans{proof(state)}{proof(state)} \\ |
|
61 |
\isarcmd{finally} & : & \isartrans{proof(state)}{proof(chain)} \\ |
|
8619 | 62 |
\isarcmd{moreover} & : & \isartrans{proof(state)}{proof(state)} \\ |
63 |
\isarcmd{ultimately} & : & \isartrans{proof(state)}{proof(chain)} \\ |
|
10154 | 64 |
\isarcmd{print_trans_rules}^* & : & \isarkeep{theory~|~proof} \\ |
7315 | 65 |
trans & : & \isaratt \\ |
66 |
\end{matharray} |
|
67 |
||
68 |
Calculational proof is forward reasoning with implicit application of |
|
11332 | 69 |
transitivity rules (such those of $=$, $\leq$, $<$). Isabelle/Isar maintains |
7391 | 70 |
an auxiliary register $calculation$\indexisarthm{calculation} for accumulating |
7897 | 71 |
results obtained by transitivity composed with the current result. Command |
72 |
$\ALSO$ updates $calculation$ involving $this$, while $\FINALLY$ exhibits the |
|
73 |
final $calculation$ by forward chaining towards the next goal statement. Both |
|
74 |
commands require valid current facts, i.e.\ may occur only after commands that |
|
75 |
produce theorems such as $\ASSUMENAME$, $\NOTENAME$, or some finished proof of |
|
8619 | 76 |
$\HAVENAME$, $\SHOWNAME$ etc. The $\MOREOVER$ and $\ULTIMATELY$ commands are |
77 |
similar to $\ALSO$ and $\FINALLY$, but only collect further results in |
|
78 |
$calculation$ without applying any rules yet. |
|
7315 | 79 |
|
80 |
Also note that the automatic term abbreviation ``$\dots$'' has its canonical |
|
8619 | 81 |
application with calculational proofs. It refers to the argument\footnote{The |
82 |
argument of a curried infix expression is its right-hand side.} of the |
|
83 |
preceding statement. |
|
7315 | 84 |
|
85 |
Isabelle/Isar calculations are implicitly subject to block structure in the |
|
86 |
sense that new threads of calculational reasoning are commenced for any new |
|
87 |
block (as opened by a local goal, for example). This means that, apart from |
|
88 |
being able to nest calculations, there is no separate \emph{begin-calculation} |
|
89 |
command required. |
|
90 |
||
8619 | 91 |
\medskip |
92 |
||
93 |
The Isar calculation proof commands may be defined as |
|
94 |
follows:\footnote{Internal bookkeeping such as proper handling of |
|
95 |
block-structure has been suppressed.} |
|
96 |
\begin{matharray}{rcl} |
|
97 |
\ALSO@0 & \equiv & \NOTE{calculation}{this} \\ |
|
9606 | 98 |
\ALSO@{n+1} & \equiv & \NOTE{calculation}{trans~[OF~calculation~this]} \\[0.5ex] |
8619 | 99 |
\FINALLY & \equiv & \ALSO~\FROM{calculation} \\ |
100 |
\MOREOVER & \equiv & \NOTE{calculation}{calculation~this} \\ |
|
101 |
\ULTIMATELY & \equiv & \MOREOVER~\FROM{calculation} \\ |
|
102 |
\end{matharray} |
|
103 |
||
7315 | 104 |
\begin{rail} |
105 |
('also' | 'finally') transrules? comment? |
|
106 |
; |
|
8619 | 107 |
('moreover' | 'ultimately') comment? |
108 |
; |
|
8507 | 109 |
'trans' (() | 'add' | 'del') |
7315 | 110 |
; |
111 |
||
112 |
transrules: '(' thmrefs ')' interest? |
|
113 |
; |
|
114 |
\end{rail} |
|
115 |
||
116 |
\begin{descr} |
|
8547 | 117 |
\item [$\ALSO~(\vec a)$] maintains the auxiliary $calculation$ register as |
7315 | 118 |
follows. The first occurrence of $\ALSO$ in some calculational thread |
7905 | 119 |
initializes $calculation$ by $this$. Any subsequent $\ALSO$ on the same |
7335 | 120 |
level of block-structure updates $calculation$ by some transitivity rule |
7458 | 121 |
applied to $calculation$ and $this$ (in that order). Transitivity rules are |
11095 | 122 |
picked from the current context, unless alternative rules are given as |
123 |
explicit arguments. |
|
9614 | 124 |
|
8547 | 125 |
\item [$\FINALLY~(\vec a)$] maintaining $calculation$ in the same way as |
7315 | 126 |
$\ALSO$, and concludes the current calculational thread. The final result |
127 |
is exhibited as fact for forward chaining towards the next goal. Basically, |
|
7987 | 128 |
$\FINALLY$ just abbreviates $\ALSO~\FROM{calculation}$. Note that |
129 |
``$\FINALLY~\SHOW{}{\Var{thesis}}~\DOT$'' and |
|
130 |
``$\FINALLY~\HAVE{}{\phi}~\DOT$'' are typical idioms for concluding |
|
131 |
calculational proofs. |
|
9614 | 132 |
|
8619 | 133 |
\item [$\MOREOVER$ and $\ULTIMATELY$] are analogous to $\ALSO$ and $\FINALLY$, |
134 |
but collect results only, without applying rules. |
|
9614 | 135 |
|
9606 | 136 |
\item [$\isarkeyword{print_trans_rules}$] prints the list of transitivity |
137 |
rules declared in the current context. |
|
9614 | 138 |
|
8547 | 139 |
\item [$trans$] declares theorems as transitivity rules. |
9614 | 140 |
|
7315 | 141 |
\end{descr} |
142 |
||
143 |
||
8483 | 144 |
\section{Named local contexts (cases)}\label{sec:cases} |
145 |
||
146 |
\indexisarcmd{case}\indexisarcmd{print-cases} |
|
10548 | 147 |
\indexisaratt{case-names}\indexisaratt{params}\indexisaratt{consumes} |
8483 | 148 |
\begin{matharray}{rcl} |
149 |
\isarcmd{case} & : & \isartrans{proof(state)}{proof(state)} \\ |
|
8517 | 150 |
\isarcmd{print_cases}^* & : & \isarkeep{proof} \\ |
8483 | 151 |
case_names & : & \isaratt \\ |
152 |
params & : & \isaratt \\ |
|
10548 | 153 |
consumes & : & \isaratt \\ |
8483 | 154 |
\end{matharray} |
155 |
||
156 |
Basically, Isar proof contexts are built up explicitly using commands like |
|
157 |
$\FIXNAME$, $\ASSUMENAME$ etc.\ (see \S\ref{sec:proof-context}). In typical |
|
158 |
verification tasks this can become hard to manage, though. In particular, a |
|
159 |
large number of local contexts may emerge from case analysis or induction over |
|
160 |
inductive sets and types. |
|
161 |
||
162 |
\medskip |
|
163 |
||
164 |
The $\CASENAME$ command provides a shorthand to refer to certain parts of |
|
165 |
logical context symbolically. Proof methods may provide an environment of |
|
8507 | 166 |
named ``cases'' of the form $c\colon \vec x, \vec \phi$. Then the effect of |
167 |
$\CASE{c}$ is exactly the same as $\FIX{\vec x}~\ASSUME{c}{\vec\phi}$. |
|
8483 | 168 |
|
169 |
It is important to note that $\CASENAME$ does \emph{not} provide any means to |
|
170 |
peek at the current goal state, which is treated as strictly non-observable in |
|
171 |
Isar! Instead, the cases considered here usually emerge in a canonical way |
|
172 |
from certain pieces of specification that appear in the theory somewhere else |
|
173 |
(e.g.\ in an inductive definition, or recursive function). See also |
|
174 |
\S\ref{sec:induct-method} for more details of how this works in HOL. |
|
175 |
||
176 |
\medskip |
|
177 |
||
178 |
Named cases may be exhibited in the current proof context only if both the |
|
8547 | 179 |
proof method and the rules involved support this. Case names and parameters |
180 |
of basic rules may be declared by hand as well, by using appropriate |
|
181 |
attributes. Thus variant versions of rules that have been derived manually |
|
182 |
may be used in advanced case analysis later. |
|
8483 | 183 |
|
184 |
\railalias{casenames}{case\_names} |
|
185 |
\railterm{casenames} |
|
186 |
||
187 |
\begin{rail} |
|
188 |
'case' nameref attributes? |
|
189 |
; |
|
190 |
casenames (name + ) |
|
191 |
; |
|
192 |
'params' ((name * ) + 'and') |
|
193 |
; |
|
10548 | 194 |
'consumes' nat? |
195 |
; |
|
8483 | 196 |
\end{rail} |
8547 | 197 |
%FIXME bug in rail |
8483 | 198 |
|
199 |
\begin{descr} |
|
8507 | 200 |
\item [$\CASE{c}$] invokes a named local context $c\colon \vec x, \vec \phi$, |
8547 | 201 |
as provided by an appropriate proof method (such as $cases$ and $induct$ in |
202 |
Isabelle/HOL, see \S\ref{sec:induct-method}). The command $\CASE{c}$ |
|
203 |
abbreviates $\FIX{\vec x}~\ASSUME{c}{\vec\phi}$. |
|
8483 | 204 |
\item [$\isarkeyword{print_cases}$] prints all local contexts of the current |
8547 | 205 |
state, using Isar proof language notation. This is a diagnostic command; |
206 |
$undo$ does not apply. |
|
8483 | 207 |
\item [$case_names~\vec c$] declares names for the local contexts of premises |
10627 | 208 |
of some theorem; $\vec c$ refers to the \emph{suffix} of the list of |
209 |
premises. |
|
8483 | 210 |
\item [$params~\vec p@1 \dots \vec p@n$] renames the innermost parameters of |
8547 | 211 |
premises $1, \dots, n$ of some theorem. An empty list of names may be given |
212 |
to skip positions, leaving the present parameters unchanged. |
|
9614 | 213 |
|
214 |
Note that the default usage of case rules does \emph{not} directly expose |
|
215 |
parameters to the proof context (see also \S\ref{sec:induct-method-proper}). |
|
10548 | 216 |
\item [$consumes~n$] declares the number of ``major premises'' of a rule, |
217 |
i.e.\ the number of facts to be consumed when it is applied by an |
|
218 |
appropriate proof method (cf.\ \S\ref{sec:induct-method}). The default |
|
219 |
value of $consumes$ is $n = 1$, which is appropriate for the usual kind of |
|
220 |
cases and induction rules for inductive sets (cf.\ \S\ref{sec:inductive}). |
|
221 |
Rules without any $consumes$ declaration given are treated as if |
|
222 |
$consumes~0$ had been specified. |
|
223 |
||
224 |
Note that explicit $consumes$ declarations are only rarely needed; this is |
|
225 |
already taken care of automatically by the higher-level $cases$ and $induct$ |
|
226 |
declarations, see also \S\ref{sec:induct-att}. |
|
8483 | 227 |
\end{descr} |
228 |
||
229 |
||
9614 | 230 |
\section{Generalized existence}\label{sec:obtain} |
7135 | 231 |
|
8517 | 232 |
\indexisarcmd{obtain} |
7135 | 233 |
\begin{matharray}{rcl} |
9480 | 234 |
\isarcmd{obtain} & : & \isartrans{proof(state)}{proof(prove)} \\ |
8517 | 235 |
\end{matharray} |
236 |
||
9480 | 237 |
Generalized existence means that additional elements with certain properties |
238 |
may introduced in the current context. Technically, the $\OBTAINNAME$ |
|
239 |
language element is like a declaration of $\FIXNAME$ and $\ASSUMENAME$ (see |
|
240 |
also see \S\ref{sec:proof-context}), together with a soundness proof of its |
|
241 |
additional claim. According to the nature of existential reasoning, |
|
242 |
assumptions get eliminated from any result exported from the context later, |
|
243 |
provided that the corresponding parameters do \emph{not} occur in the |
|
244 |
conclusion. |
|
8517 | 245 |
|
246 |
\begin{rail} |
|
247 |
'obtain' (vars + 'and') comment? \\ 'where' (assm comment? + 'and') |
|
248 |
; |
|
249 |
\end{rail} |
|
250 |
||
9480 | 251 |
$\OBTAINNAME$ is defined as a derived Isar command as follows, where $\vec b$ |
252 |
shall refer to (optional) facts indicated for forward chaining. |
|
8517 | 253 |
\begin{matharray}{l} |
9480 | 254 |
\langle facts~\vec b\rangle \\ |
255 |
\OBTAIN{\vec x}{a}{\vec \phi}~~\langle proof\rangle \equiv {} \\[1ex] |
|
256 |
\quad \BG \\ |
|
257 |
\qquad \FIX{thesis} \\ |
|
10160 | 258 |
\qquad \ASSUME{that~[simp, intro]}{\All{\vec x} \vec\phi \Imp thesis} \\ |
9480 | 259 |
\qquad \FROM{\vec b}~\HAVE{}{thesis}~~\langle proof\rangle \\ |
260 |
\quad \EN \\ |
|
10154 | 261 |
\quad \FIX{\vec x}~\ASSUMENAME^\ast~a\colon~\vec\phi \\ |
7135 | 262 |
\end{matharray} |
263 |
||
8517 | 264 |
Typically, the soundness proof is relatively straight-forward, often just by |
265 |
canonical automated tools such as $\BY{simp}$ (see \S\ref{sec:simp}) or |
|
9480 | 266 |
$\BY{blast}$ (see \S\ref{sec:classical-auto}). Accordingly, the ``$that$'' |
267 |
reduction above is declared as simplification and introduction rule. |
|
8517 | 268 |
|
269 |
\medskip |
|
270 |
||
271 |
In a sense, $\OBTAINNAME$ represents at the level of Isar proofs what would be |
|
272 |
meta-logical existential quantifiers and conjunctions. This concept has a |
|
273 |
broad range of useful applications, ranging from plain elimination (or even |
|
274 |
introduction) of object-level existentials and conjunctions, to elimination |
|
275 |
over results of symbolic evaluation of recursive definitions, for example. |
|
9480 | 276 |
Also note that $\OBTAINNAME$ without parameters acts much like $\HAVENAME$, |
277 |
where the result is treated as an assumption. |
|
8517 | 278 |
|
279 |
||
10031 | 280 |
\section{Miscellaneous methods and attributes}\label{sec:misc-methods} |
8517 | 281 |
|
9606 | 282 |
\indexisarmeth{unfold}\indexisarmeth{fold}\indexisarmeth{insert} |
8517 | 283 |
\indexisarmeth{erule}\indexisarmeth{drule}\indexisarmeth{frule} |
284 |
\indexisarmeth{fail}\indexisarmeth{succeed} |
|
285 |
\begin{matharray}{rcl} |
|
286 |
unfold & : & \isarmeth \\ |
|
10741 | 287 |
fold & : & \isarmeth \\ |
288 |
insert & : & \isarmeth \\[0.5ex] |
|
8517 | 289 |
erule^* & : & \isarmeth \\ |
290 |
drule^* & : & \isarmeth \\ |
|
291 |
frule^* & : & \isarmeth \\[0.5ex] |
|
292 |
succeed & : & \isarmeth \\ |
|
293 |
fail & : & \isarmeth \\ |
|
294 |
\end{matharray} |
|
7135 | 295 |
|
296 |
\begin{rail} |
|
10741 | 297 |
('fold' | 'unfold' | 'insert') thmrefs |
298 |
; |
|
299 |
('erule' | 'drule' | 'frule') ('('nat')')? thmrefs |
|
7135 | 300 |
; |
301 |
\end{rail} |
|
302 |
||
7167 | 303 |
\begin{descr} |
8547 | 304 |
\item [$unfold~\vec a$ and $fold~\vec a$] expand and fold back again the given |
8517 | 305 |
meta-level definitions throughout all goals; any facts provided are inserted |
306 |
into the goal and subject to rewriting as well. |
|
10741 | 307 |
\item [$insert~\vec a$] inserts theorems as facts into all goals of the proof |
308 |
state. Note that current facts indicated for forward chaining are ignored. |
|
8547 | 309 |
\item [$erule~\vec a$, $drule~\vec a$, and $frule~\vec a$] are similar to the |
310 |
basic $rule$ method (see \S\ref{sec:pure-meth-att}), but apply rules by |
|
8517 | 311 |
elim-resolution, destruct-resolution, and forward-resolution, respectively |
10741 | 312 |
\cite{isabelle-ref}. The optional natural number argument (default $0$) |
313 |
specifies additional assumption steps to be performed. |
|
314 |
||
315 |
Note that these methods are improper ones, mainly serving for |
|
316 |
experimentation and tactic script emulation. Different modes of basic rule |
|
317 |
application are usually expressed in Isar at the proof language level, |
|
318 |
rather than via implicit proof state manipulations. For example, a proper |
|
319 |
single-step elimination would be done using the basic $rule$ method, with |
|
320 |
forward chaining of current facts. |
|
8517 | 321 |
\item [$succeed$] yields a single (unchanged) result; it is the identity of |
322 |
the ``\texttt{,}'' method combinator (cf.\ \S\ref{sec:syn-meth}). |
|
323 |
\item [$fail$] yields an empty result sequence; it is the identity of the |
|
324 |
``\texttt{|}'' method combinator (cf.\ \S\ref{sec:syn-meth}). |
|
7167 | 325 |
\end{descr} |
7135 | 326 |
|
10318 | 327 |
\indexisaratt{tagged}\indexisaratt{untagged} |
9614 | 328 |
\indexisaratt{THEN}\indexisaratt{COMP} |
10318 | 329 |
\indexisaratt{where}\indexisaratt{unfolded}\indexisaratt{folded} |
330 |
\indexisaratt{standard}\indexisaratt{elim-format} |
|
331 |
\indexisaratt{no-vars}\indexisaratt{exported} |
|
8517 | 332 |
\begin{matharray}{rcl} |
9905 | 333 |
tagged & : & \isaratt \\ |
334 |
untagged & : & \isaratt \\[0.5ex] |
|
9614 | 335 |
THEN & : & \isaratt \\ |
8517 | 336 |
COMP & : & \isaratt \\[0.5ex] |
337 |
where & : & \isaratt \\[0.5ex] |
|
9905 | 338 |
unfolded & : & \isaratt \\ |
339 |
folded & : & \isaratt \\[0.5ex] |
|
8517 | 340 |
standard & : & \isaratt \\ |
9941
fe05af7ec816
renamed atts: rulify to rule_format, elimify to elim_format;
wenzelm
parents:
9936
diff
changeset
|
341 |
elim_format & : & \isaratt \\ |
9936 | 342 |
no_vars^* & : & \isaratt \\ |
9905 | 343 |
exported^* & : & \isaratt \\ |
8517 | 344 |
\end{matharray} |
345 |
||
346 |
\begin{rail} |
|
9905 | 347 |
'tagged' (nameref+) |
8517 | 348 |
; |
9905 | 349 |
'untagged' name |
8517 | 350 |
; |
10154 | 351 |
('THEN' | 'COMP') ('[' nat ']')? thmref |
8517 | 352 |
; |
353 |
'where' (name '=' term * 'and') |
|
354 |
; |
|
9905 | 355 |
('unfolded' | 'folded') thmrefs |
8517 | 356 |
; |
357 |
\end{rail} |
|
358 |
||
359 |
\begin{descr} |
|
9905 | 360 |
\item [$tagged~name~args$ and $untagged~name$] add and remove $tags$ of some |
8517 | 361 |
theorem. Tags may be any list of strings that serve as comment for some |
362 |
tools (e.g.\ $\LEMMANAME$ causes the tag ``$lemma$'' to be added to the |
|
363 |
result). The first string is considered the tag name, the rest its |
|
364 |
arguments. Note that untag removes any tags of the same name. |
|
9614 | 365 |
\item [$THEN~n~a$ and $COMP~n~a$] compose rules. $THEN$ resolves with the |
366 |
$n$-th premise of $a$; the $COMP$ version skips the automatic lifting |
|
8547 | 367 |
process that is normally intended (cf.\ \texttt{RS} and \texttt{COMP} in |
368 |
\cite[\S5]{isabelle-ref}). |
|
8517 | 369 |
\item [$where~\vec x = \vec t$] perform named instantiation of schematic |
9606 | 370 |
variables occurring in a theorem. Unlike instantiation tactics such as |
371 |
$rule_tac$ (see \S\ref{sec:tactic-commands}), actual schematic variables |
|
8517 | 372 |
have to be specified (e.g.\ $\Var{x@3}$). |
9905 | 373 |
\item [$unfolded~\vec a$ and $folded~\vec a$] expand and fold back again the |
374 |
given meta-level definitions throughout a rule. |
|
8517 | 375 |
\item [$standard$] puts a theorem into the standard form of object-rules, just |
376 |
as the ML function \texttt{standard} (see \cite[\S5]{isabelle-ref}). |
|
9941
fe05af7ec816
renamed atts: rulify to rule_format, elimify to elim_format;
wenzelm
parents:
9936
diff
changeset
|
377 |
\item [$elim_format$] turns a destruction rule into elimination rule format; |
fe05af7ec816
renamed atts: rulify to rule_format, elimify to elim_format;
wenzelm
parents:
9936
diff
changeset
|
378 |
see also the ML function \texttt{make\_elim} (see \cite{isabelle-ref}). |
9232 | 379 |
\item [$no_vars$] replaces schematic variables by free ones; this is mainly |
380 |
for tuning output of pretty printed theorems. |
|
9905 | 381 |
\item [$exported$] lifts a local result out of the current proof context, |
8517 | 382 |
generalizing all fixed variables and discharging all assumptions. Note that |
8547 | 383 |
proper incremental export is already done as part of the basic Isar |
384 |
machinery. This attribute is mainly for experimentation. |
|
8517 | 385 |
\end{descr} |
7135 | 386 |
|
387 |
||
9606 | 388 |
\section{Tactic emulations}\label{sec:tactics} |
389 |
||
390 |
The following improper proof methods emulate traditional tactics. These admit |
|
391 |
direct access to the goal state, which is normally considered harmful! In |
|
392 |
particular, this may involve both numbered goal addressing (default 1), and |
|
393 |
dynamic instantiation within the scope of some subgoal. |
|
394 |
||
395 |
\begin{warn} |
|
396 |
Dynamic instantiations are read and type-checked according to a subgoal of |
|
397 |
the current dynamic goal state, rather than the static proof context! In |
|
398 |
particular, locally fixed variables and term abbreviations may not be |
|
399 |
included in the term specifications. Thus schematic variables are left to |
|
400 |
be solved by unification with certain parts of the subgoal involved. |
|
401 |
\end{warn} |
|
402 |
||
403 |
Note that the tactic emulation proof methods in Isabelle/Isar are consistently |
|
404 |
named $foo_tac$. |
|
405 |
||
406 |
\indexisarmeth{rule-tac}\indexisarmeth{erule-tac} |
|
407 |
\indexisarmeth{drule-tac}\indexisarmeth{frule-tac} |
|
408 |
\indexisarmeth{cut-tac}\indexisarmeth{thin-tac} |
|
9642 | 409 |
\indexisarmeth{subgoal-tac}\indexisarmeth{rename-tac} |
9614 | 410 |
\indexisarmeth{rotate-tac}\indexisarmeth{tactic} |
9606 | 411 |
\begin{matharray}{rcl} |
412 |
rule_tac^* & : & \isarmeth \\ |
|
413 |
erule_tac^* & : & \isarmeth \\ |
|
414 |
drule_tac^* & : & \isarmeth \\ |
|
415 |
frule_tac^* & : & \isarmeth \\ |
|
416 |
cut_tac^* & : & \isarmeth \\ |
|
417 |
thin_tac^* & : & \isarmeth \\ |
|
418 |
subgoal_tac^* & : & \isarmeth \\ |
|
9614 | 419 |
rename_tac^* & : & \isarmeth \\ |
420 |
rotate_tac^* & : & \isarmeth \\ |
|
9606 | 421 |
tactic^* & : & \isarmeth \\ |
422 |
\end{matharray} |
|
423 |
||
424 |
\railalias{ruletac}{rule\_tac} |
|
425 |
\railterm{ruletac} |
|
426 |
||
427 |
\railalias{eruletac}{erule\_tac} |
|
428 |
\railterm{eruletac} |
|
429 |
||
430 |
\railalias{druletac}{drule\_tac} |
|
431 |
\railterm{druletac} |
|
432 |
||
433 |
\railalias{fruletac}{frule\_tac} |
|
434 |
\railterm{fruletac} |
|
435 |
||
436 |
\railalias{cuttac}{cut\_tac} |
|
437 |
\railterm{cuttac} |
|
438 |
||
439 |
\railalias{thintac}{thin\_tac} |
|
440 |
\railterm{thintac} |
|
441 |
||
442 |
\railalias{subgoaltac}{subgoal\_tac} |
|
443 |
\railterm{subgoaltac} |
|
444 |
||
9614 | 445 |
\railalias{renametac}{rename\_tac} |
446 |
\railterm{renametac} |
|
447 |
||
448 |
\railalias{rotatetac}{rotate\_tac} |
|
449 |
\railterm{rotatetac} |
|
450 |
||
9606 | 451 |
\begin{rail} |
452 |
( ruletac | eruletac | druletac | fruletac | cuttac | thintac ) goalspec? |
|
453 |
( insts thmref | thmrefs ) |
|
454 |
; |
|
455 |
subgoaltac goalspec? (prop +) |
|
456 |
; |
|
9614 | 457 |
renametac goalspec? (name +) |
458 |
; |
|
459 |
rotatetac goalspec? int? |
|
460 |
; |
|
9606 | 461 |
'tactic' text |
462 |
; |
|
463 |
||
464 |
insts: ((name '=' term) + 'and') 'in' |
|
465 |
; |
|
466 |
\end{rail} |
|
467 |
||
468 |
\begin{descr} |
|
469 |
\item [$rule_tac$ etc.] do resolution of rules with explicit instantiation. |
|
470 |
This works the same way as the ML tactics \texttt{res_inst_tac} etc. (see |
|
471 |
\cite[\S3]{isabelle-ref}). |
|
9614 | 472 |
|
9606 | 473 |
Note that multiple rules may be only given there is no instantiation. Then |
474 |
$rule_tac$ is the same as \texttt{resolve_tac} in ML (see |
|
475 |
\cite[\S3]{isabelle-ref}). |
|
476 |
\item [$cut_tac$] inserts facts into the proof state as assumption of a |
|
477 |
subgoal, see also \texttt{cut_facts_tac} in \cite[\S3]{isabelle-ref}. Note |
|
478 |
that the scope of schmatic variables is spread over the main goal statement. |
|
479 |
Instantiations may be given as well, see also ML tactic |
|
480 |
\texttt{cut_inst_tac} in \cite[\S3]{isabelle-ref}. |
|
481 |
\item [$thin_tac~\phi$] deletes the specified assumption from a subgoal; note |
|
482 |
that $\phi$ may contain schematic variables. See also \texttt{thin_tac} in |
|
483 |
\cite[\S3]{isabelle-ref}. |
|
484 |
\item [$subgoal_tac~\phi$] adds $\phi$ as an assumption to a subgoal. See |
|
485 |
also \texttt{subgoal_tac} and \texttt{subgoals_tac} in |
|
486 |
\cite[\S3]{isabelle-ref}. |
|
9614 | 487 |
\item [$rename_tac~\vec x$] renames parameters of a goal according to the list |
488 |
$\vec x$, which refers to the \emph{suffix} of variables. |
|
489 |
\item [$rotate_tac~n$] rotates the assumptions of a goal by $n$ positions: |
|
490 |
from right to left if $n$ is positive, and from left to right if $n$ is |
|
491 |
negative; the default value is $1$. See also \texttt{rotate_tac} in |
|
492 |
\cite[\S3]{isabelle-ref}. |
|
9606 | 493 |
\item [$tactic~text$] produces a proof method from any ML text of type |
494 |
\texttt{tactic}. Apart from the usual ML environment and the current |
|
495 |
implicit theory context, the ML code may refer to the following locally |
|
496 |
bound values: |
|
497 |
||
498 |
%%FIXME ttbox produces too much trailing space (why?) |
|
499 |
{\footnotesize\begin{verbatim} |
|
500 |
val ctxt : Proof.context |
|
501 |
val facts : thm list |
|
502 |
val thm : string -> thm |
|
503 |
val thms : string -> thm list |
|
504 |
\end{verbatim}} |
|
505 |
Here \texttt{ctxt} refers to the current proof context, \texttt{facts} |
|
506 |
indicates any current facts for forward-chaining, and |
|
507 |
\texttt{thm}~/~\texttt{thms} retrieve named facts (including global |
|
508 |
theorems) from the context. |
|
509 |
\end{descr} |
|
510 |
||
511 |
||
9614 | 512 |
\section{The Simplifier}\label{sec:simplifier} |
7135 | 513 |
|
7321 | 514 |
\subsection{Simplification methods}\label{sec:simp} |
7315 | 515 |
|
8483 | 516 |
\indexisarmeth{simp}\indexisarmeth{simp-all} |
7315 | 517 |
\begin{matharray}{rcl} |
518 |
simp & : & \isarmeth \\ |
|
8483 | 519 |
simp_all & : & \isarmeth \\ |
7315 | 520 |
\end{matharray} |
521 |
||
8483 | 522 |
\railalias{simpall}{simp\_all} |
523 |
\railterm{simpall} |
|
524 |
||
8704 | 525 |
\railalias{noasm}{no\_asm} |
526 |
\railterm{noasm} |
|
527 |
||
528 |
\railalias{noasmsimp}{no\_asm\_simp} |
|
529 |
\railterm{noasmsimp} |
|
530 |
||
531 |
\railalias{noasmuse}{no\_asm\_use} |
|
532 |
\railterm{noasmuse} |
|
533 |
||
11128 | 534 |
\indexouternonterm{simpmod} |
7315 | 535 |
\begin{rail} |
8706 | 536 |
('simp' | simpall) ('!' ?) opt? (simpmod * ) |
7315 | 537 |
; |
538 |
||
8811 | 539 |
opt: '(' (noasm | noasmsimp | noasmuse) ')' |
8704 | 540 |
; |
9711 | 541 |
simpmod: ('add' | 'del' | 'only' | 'cong' (() | 'add' | 'del') | |
9847 | 542 |
'split' (() | 'add' | 'del')) ':' thmrefs |
7315 | 543 |
; |
544 |
\end{rail} |
|
545 |
||
7321 | 546 |
\begin{descr} |
8547 | 547 |
\item [$simp$] invokes Isabelle's simplifier, after declaring additional rules |
8594 | 548 |
according to the arguments given. Note that the \railtterm{only} modifier |
8547 | 549 |
first removes all other rewrite rules, congruences, and looper tactics |
8594 | 550 |
(including splits), and then behaves like \railtterm{add}. |
9711 | 551 |
|
552 |
\medskip The \railtterm{cong} modifiers add or delete Simplifier congruence |
|
553 |
rules (see also \cite{isabelle-ref}), the default is to add. |
|
554 |
||
555 |
\medskip The \railtterm{split} modifiers add or delete rules for the |
|
556 |
Splitter (see also \cite{isabelle-ref}), the default is to add. This works |
|
557 |
only if the Simplifier method has been properly setup to include the |
|
558 |
Splitter (all major object logics such HOL, HOLCF, FOL, ZF do this already). |
|
8483 | 559 |
\item [$simp_all$] is similar to $simp$, but acts on all goals. |
7321 | 560 |
\end{descr} |
561 |
||
8704 | 562 |
By default, the Simplifier methods are based on \texttt{asm_full_simp_tac} |
8706 | 563 |
internally \cite[\S10]{isabelle-ref}, which means that assumptions are both |
564 |
simplified as well as used in simplifying the conclusion. In structured |
|
565 |
proofs this is usually quite well behaved in practice: just the local premises |
|
566 |
of the actual goal are involved, additional facts may inserted via explicit |
|
567 |
forward-chaining (using $\THEN$, $\FROMNAME$ etc.). The full context of |
|
568 |
assumptions is only included if the ``$!$'' (bang) argument is given, which |
|
569 |
should be used with some care, though. |
|
7321 | 570 |
|
8704 | 571 |
Additional Simplifier options may be specified to tune the behavior even |
9614 | 572 |
further: $(no_asm)$ means assumptions are ignored completely (cf.\ |
8811 | 573 |
\texttt{simp_tac}), $(no_asm_simp)$ means assumptions are used in the |
9614 | 574 |
simplification of the conclusion but are not themselves simplified (cf.\ |
8811 | 575 |
\texttt{asm_simp_tac}), and $(no_asm_use)$ means assumptions are simplified |
576 |
but are not used in the simplification of each other or the conclusion (cf. |
|
8704 | 577 |
\texttt{full_simp_tac}). |
578 |
||
579 |
\medskip |
|
580 |
||
581 |
The Splitter package is usually configured to work as part of the Simplifier. |
|
9711 | 582 |
The effect of repeatedly applying \texttt{split_tac} can be simulated by |
583 |
$(simp~only\colon~split\colon~\vec a)$. There is also a separate $split$ |
|
584 |
method available for single-step case splitting, see \S\ref{sec:basic-eq}. |
|
8483 | 585 |
|
586 |
||
587 |
\subsection{Declaring rules} |
|
588 |
||
8667 | 589 |
\indexisarcmd{print-simpset} |
8638 | 590 |
\indexisaratt{simp}\indexisaratt{split}\indexisaratt{cong} |
7321 | 591 |
\begin{matharray}{rcl} |
10154 | 592 |
print_simpset^* & : & \isarkeep{theory~|~proof} \\ |
7321 | 593 |
simp & : & \isaratt \\ |
9711 | 594 |
cong & : & \isaratt \\ |
8483 | 595 |
split & : & \isaratt \\ |
7321 | 596 |
\end{matharray} |
597 |
||
598 |
\begin{rail} |
|
9711 | 599 |
('simp' | 'cong' | 'split') (() | 'add' | 'del') |
7321 | 600 |
; |
601 |
\end{rail} |
|
602 |
||
603 |
\begin{descr} |
|
8667 | 604 |
\item [$print_simpset$] prints the collection of rules declared to the |
605 |
Simplifier, which is also known as ``simpset'' internally |
|
606 |
\cite{isabelle-ref}. This is a diagnostic command; $undo$ does not apply. |
|
8547 | 607 |
\item [$simp$] declares simplification rules. |
8638 | 608 |
\item [$cong$] declares congruence rules. |
9711 | 609 |
\item [$split$] declares case split rules. |
7321 | 610 |
\end{descr} |
7319 | 611 |
|
7315 | 612 |
|
613 |
\subsection{Forward simplification} |
|
614 |
||
9905 | 615 |
\indexisaratt{simplified} |
7315 | 616 |
\begin{matharray}{rcl} |
9905 | 617 |
simplified & : & \isaratt \\ |
7315 | 618 |
\end{matharray} |
619 |
||
9905 | 620 |
\begin{rail} |
621 |
'simplified' opt? |
|
622 |
; |
|
623 |
||
624 |
opt: '(' (noasm | noasmsimp | noasmuse) ')' |
|
625 |
; |
|
626 |
\end{rail} |
|
7905 | 627 |
|
9905 | 628 |
\begin{descr} |
629 |
\item [$simplified$] causes a theorem to be simplified according to the |
|
630 |
current Simplifier context (there are no separate arguments for declaring |
|
631 |
additional rules). By default the result is fully simplified, including |
|
632 |
assumptions and conclusion. The options $no_asm$ etc.\ restrict the |
|
633 |
Simplifier in the same way as the for the $simp$ method (see |
|
634 |
\S\ref{sec:simp}). |
|
635 |
||
636 |
The $simplified$ operation should be used only very rarely, usually for |
|
637 |
experimentation only. |
|
638 |
\end{descr} |
|
7315 | 639 |
|
640 |
||
9711 | 641 |
\section{Basic equational reasoning}\label{sec:basic-eq} |
9614 | 642 |
|
9703 | 643 |
\indexisarmeth{subst}\indexisarmeth{hypsubst}\indexisarmeth{split}\indexisaratt{symmetric} |
9614 | 644 |
\begin{matharray}{rcl} |
645 |
subst & : & \isarmeth \\ |
|
646 |
hypsubst^* & : & \isarmeth \\ |
|
9703 | 647 |
split & : & \isarmeth \\ |
9614 | 648 |
symmetric & : & \isaratt \\ |
649 |
\end{matharray} |
|
650 |
||
651 |
\begin{rail} |
|
652 |
'subst' thmref |
|
653 |
; |
|
9799 | 654 |
'split' ('(' 'asm' ')')? thmrefs |
9703 | 655 |
; |
9614 | 656 |
\end{rail} |
657 |
||
658 |
These methods and attributes provide basic facilities for equational reasoning |
|
659 |
that are intended for specialized applications only. Normally, single step |
|
660 |
reasoning would be performed by calculation (see \S\ref{sec:calculation}), |
|
661 |
while the Simplifier is the canonical tool for automated normalization (see |
|
662 |
\S\ref{sec:simplifier}). |
|
663 |
||
664 |
\begin{descr} |
|
665 |
\item [$subst~thm$] performs a single substitution step using rule $thm$, |
|
666 |
which may be either a meta or object equality. |
|
667 |
\item [$hypsubst$] performs substitution using some assumption. |
|
9703 | 668 |
\item [$split~thms$] performs single-step case splitting using rules $thms$. |
9799 | 669 |
By default, splitting is performed in the conclusion of a goal; the $asm$ |
670 |
option indicates to operate on assumptions instead. |
|
671 |
||
9703 | 672 |
Note that the $simp$ method already involves repeated application of split |
673 |
rules as declared in the current context (see \S\ref{sec:simp}). |
|
9614 | 674 |
\item [$symmetric$] applies the symmetry rule of meta or object equality. |
675 |
\end{descr} |
|
676 |
||
677 |
||
9847 | 678 |
\section{The Classical Reasoner}\label{sec:classical} |
7135 | 679 |
|
7335 | 680 |
\subsection{Basic methods}\label{sec:classical-basic} |
7321 | 681 |
|
7974 | 682 |
\indexisarmeth{rule}\indexisarmeth{intro} |
683 |
\indexisarmeth{elim}\indexisarmeth{default}\indexisarmeth{contradiction} |
|
7321 | 684 |
\begin{matharray}{rcl} |
685 |
rule & : & \isarmeth \\ |
|
686 |
intro & : & \isarmeth \\ |
|
687 |
elim & : & \isarmeth \\ |
|
688 |
contradiction & : & \isarmeth \\ |
|
689 |
\end{matharray} |
|
690 |
||
691 |
\begin{rail} |
|
8547 | 692 |
('rule' | 'intro' | 'elim') thmrefs? |
7321 | 693 |
; |
694 |
\end{rail} |
|
695 |
||
696 |
\begin{descr} |
|
7466 | 697 |
\item [$rule$] as offered by the classical reasoner is a refinement over the |
8517 | 698 |
primitive one (see \S\ref{sec:pure-meth-att}). In case that no rules are |
7466 | 699 |
provided as arguments, it automatically determines elimination and |
7321 | 700 |
introduction rules from the context (see also \S\ref{sec:classical-mod}). |
8517 | 701 |
This is made the default method for basic proof steps, such as $\PROOFNAME$ |
702 |
and ``$\DDOT$'' (two dots), see also \S\ref{sec:proof-steps} and |
|
703 |
\S\ref{sec:pure-meth-att}. |
|
9614 | 704 |
|
7466 | 705 |
\item [$intro$ and $elim$] repeatedly refine some goal by intro- or |
7905 | 706 |
elim-resolution, after having inserted any facts. Omitting the arguments |
8547 | 707 |
refers to any suitable rules declared in the context, otherwise only the |
708 |
explicitly given ones may be applied. The latter form admits better control |
|
709 |
of what actually happens, thus it is very appropriate as an initial method |
|
710 |
for $\PROOFNAME$ that splits up certain connectives of the goal, before |
|
711 |
entering the actual sub-proof. |
|
9614 | 712 |
|
7466 | 713 |
\item [$contradiction$] solves some goal by contradiction, deriving any result |
714 |
from both $\neg A$ and $A$. Facts, which are guaranteed to participate, may |
|
715 |
appear in either order. |
|
7321 | 716 |
\end{descr} |
717 |
||
718 |
||
7981 | 719 |
\subsection{Automated methods}\label{sec:classical-auto} |
7315 | 720 |
|
9799 | 721 |
\indexisarmeth{blast}\indexisarmeth{fast}\indexisarmeth{slow} |
722 |
\indexisarmeth{best}\indexisarmeth{safe}\indexisarmeth{clarify} |
|
7321 | 723 |
\begin{matharray}{rcl} |
9780 | 724 |
blast & : & \isarmeth \\ |
725 |
fast & : & \isarmeth \\ |
|
9799 | 726 |
slow & : & \isarmeth \\ |
9780 | 727 |
best & : & \isarmeth \\ |
728 |
safe & : & \isarmeth \\ |
|
729 |
clarify & : & \isarmeth \\ |
|
7321 | 730 |
\end{matharray} |
731 |
||
11128 | 732 |
\indexouternonterm{clamod} |
7321 | 733 |
\begin{rail} |
7905 | 734 |
'blast' ('!' ?) nat? (clamod * ) |
7321 | 735 |
; |
9799 | 736 |
('fast' | 'slow' | 'best' | 'safe' | 'clarify') ('!' ?) (clamod * ) |
7321 | 737 |
; |
738 |
||
9408 | 739 |
clamod: (('intro' | 'elim' | 'dest') ('!' | () | '?') | 'del') ':' thmrefs |
7321 | 740 |
; |
741 |
\end{rail} |
|
742 |
||
743 |
\begin{descr} |
|
744 |
\item [$blast$] refers to the classical tableau prover (see \texttt{blast_tac} |
|
7335 | 745 |
in \cite[\S11]{isabelle-ref}). The optional argument specifies a |
10858 | 746 |
user-supplied search bound (default 20). |
9799 | 747 |
\item [$fast$, $slow$, $best$, $safe$, and $clarify$] refer to the generic |
748 |
classical reasoner. See \texttt{fast_tac}, \texttt{slow_tac}, |
|
749 |
\texttt{best_tac}, \texttt{safe_tac}, and \texttt{clarify_tac} in |
|
750 |
\cite[\S11]{isabelle-ref} for more information. |
|
7321 | 751 |
\end{descr} |
752 |
||
753 |
Any of above methods support additional modifiers of the context of classical |
|
8517 | 754 |
rules. Their semantics is analogous to the attributes given in |
8547 | 755 |
\S\ref{sec:classical-mod}. Facts provided by forward chaining are |
756 |
inserted\footnote{These methods usually cannot make proper use of actual rules |
|
757 |
inserted that way, though.} into the goal before doing the search. The |
|
758 |
``!''~argument causes the full context of assumptions to be included as well. |
|
759 |
This is slightly less hazardous than for the Simplifier (see |
|
760 |
\S\ref{sec:simp}). |
|
7321 | 761 |
|
7315 | 762 |
|
9847 | 763 |
\subsection{Combined automated methods}\label{sec:clasimp} |
7315 | 764 |
|
9799 | 765 |
\indexisarmeth{auto}\indexisarmeth{force}\indexisarmeth{clarsimp} |
766 |
\indexisarmeth{fastsimp}\indexisarmeth{slowsimp}\indexisarmeth{bestsimp} |
|
7321 | 767 |
\begin{matharray}{rcl} |
9606 | 768 |
auto & : & \isarmeth \\ |
7321 | 769 |
force & : & \isarmeth \\ |
9438 | 770 |
clarsimp & : & \isarmeth \\ |
9606 | 771 |
fastsimp & : & \isarmeth \\ |
9799 | 772 |
slowsimp & : & \isarmeth \\ |
773 |
bestsimp & : & \isarmeth \\ |
|
7321 | 774 |
\end{matharray} |
775 |
||
11128 | 776 |
\indexouternonterm{clasimpmod} |
7321 | 777 |
\begin{rail} |
9780 | 778 |
'auto' '!'? (nat nat)? (clasimpmod * ) |
779 |
; |
|
9799 | 780 |
('force' | 'clarsimp' | 'fastsimp' | 'slowsimp' | 'bestsimp') '!'? (clasimpmod * ) |
7321 | 781 |
; |
7315 | 782 |
|
9711 | 783 |
clasimpmod: ('simp' (() | 'add' | 'del' | 'only') | |
10031 | 784 |
('cong' | 'split') (() | 'add' | 'del') | |
785 |
'iff' (((() | 'add') '?'?) | 'del') | |
|
9408 | 786 |
(('intro' | 'elim' | 'dest') ('!' | () | '?') | 'del')) ':' thmrefs |
7321 | 787 |
\end{rail} |
7315 | 788 |
|
7321 | 789 |
\begin{descr} |
9799 | 790 |
\item [$auto$, $force$, $clarsimp$, $fastsimp$, $slowsimp$, and $bestsimp$] |
791 |
provide access to Isabelle's combined simplification and classical reasoning |
|
792 |
tactics. These correspond to \texttt{auto_tac}, \texttt{force_tac}, |
|
793 |
\texttt{clarsimp_tac}, and Classical Reasoner tactics with the Simplifier |
|
794 |
added as wrapper, see \cite[\S11]{isabelle-ref} for more information. The |
|
795 |
modifier arguments correspond to those given in \S\ref{sec:simp} and |
|
9606 | 796 |
\S\ref{sec:classical-auto}. Just note that the ones related to the |
797 |
Simplifier are prefixed by \railtterm{simp} here. |
|
9614 | 798 |
|
7987 | 799 |
Facts provided by forward chaining are inserted into the goal before doing |
800 |
the search. The ``!''~argument causes the full context of assumptions to be |
|
801 |
included as well. |
|
7321 | 802 |
\end{descr} |
803 |
||
7987 | 804 |
|
8483 | 805 |
\subsection{Declaring rules}\label{sec:classical-mod} |
7135 | 806 |
|
8667 | 807 |
\indexisarcmd{print-claset} |
7391 | 808 |
\indexisaratt{intro}\indexisaratt{elim}\indexisaratt{dest} |
9936 | 809 |
\indexisaratt{iff}\indexisaratt{rule} |
7321 | 810 |
\begin{matharray}{rcl} |
10154 | 811 |
print_claset^* & : & \isarkeep{theory~|~proof} \\ |
7321 | 812 |
intro & : & \isaratt \\ |
813 |
elim & : & \isaratt \\ |
|
814 |
dest & : & \isaratt \\ |
|
9936 | 815 |
rule & : & \isaratt \\ |
7391 | 816 |
iff & : & \isaratt \\ |
7321 | 817 |
\end{matharray} |
7135 | 818 |
|
7321 | 819 |
\begin{rail} |
9408 | 820 |
('intro' | 'elim' | 'dest') ('!' | () | '?') |
7321 | 821 |
; |
9936 | 822 |
'rule' 'del' |
823 |
; |
|
10031 | 824 |
'iff' (((() | 'add') '?'?) | 'del') |
9936 | 825 |
; |
7321 | 826 |
\end{rail} |
7135 | 827 |
|
7321 | 828 |
\begin{descr} |
8667 | 829 |
\item [$print_claset$] prints the collection of rules declared to the |
830 |
Classical Reasoner, which is also known as ``simpset'' internally |
|
831 |
\cite{isabelle-ref}. This is a diagnostic command; $undo$ does not apply. |
|
8517 | 832 |
\item [$intro$, $elim$, and $dest$] declare introduction, elimination, and |
11332 | 833 |
destruction rules, respectively. By default, rules are considered as |
9408 | 834 |
\emph{unsafe} (i.e.\ not applied blindly without backtracking), while a |
835 |
single ``!'' classifies as \emph{safe}, and ``?'' as \emph{extra} (i.e.\ not |
|
836 |
applied in the search-oriented automated methods, but only in single-step |
|
837 |
methods such as $rule$). |
|
11332 | 838 |
\item [$rule~del$] deletes introduction, elimination, or destruction rules from |
9936 | 839 |
the context. |
11442 | 840 |
\item [$iff$] declares a (possibly conditional) ``safe'' rule to the context in |
841 |
several ways. The rule is declared as a rewrite rule to the Simplifier. |
|
842 |
Furthermore, it is |
|
11332 | 843 |
declared in several ways (depending on its structure) to the Classical |
844 |
Reasoner for aggressive use, which would normally be indicated by ``!''). |
|
845 |
If the rule is an equivalence, the two corresponding implications are |
|
11333 | 846 |
declared as introduction and destruction rules. Otherwise, a warning is issued |
847 |
and if the rule is an inequality, the corresponding negation elimination rule |
|
11442 | 848 |
is declared, else the rule itself is declared as an introduction rule. |
10031 | 849 |
|
850 |
The ``?'' version of $iff$ declares ``extra'' Classical Reasoner rules only, |
|
851 |
and omits the Simplifier declaration. Thus the declaration does not have |
|
852 |
any effect on automated proof tools, but only on simple methods such as |
|
853 |
$rule$ (see \S\ref{sec:misc-methods}). |
|
7321 | 854 |
\end{descr} |
7135 | 855 |
|
8203
2fcc6017cb72
intro/elim/dest attributes: changed ! / !! flags to ? / ??;
wenzelm
parents:
8195
diff
changeset
|
856 |
|
9614 | 857 |
%%% Local Variables: |
7135 | 858 |
%%% mode: latex |
859 |
%%% TeX-master: "isar-ref" |
|
9614 | 860 |
%%% End: |