author | wenzelm |
Mon, 11 Sep 2000 17:54:22 +0200 | |
changeset 9921 | 7acefd99e748 |
parent 9905 | 14a71104a498 |
child 9935 | a87965201c34 |
permissions | -rw-r--r-- |
7046 | 1 |
|
7167 | 2 |
\chapter{Isabelle/HOL Tools and Packages}\label{ch:hol-tools} |
7135 | 3 |
|
7990 | 4 |
\section{Miscellaneous attributes} |
5 |
||
9905 | 6 |
\indexisaratt{rulified} |
7990 | 7 |
\begin{matharray}{rcl} |
9905 | 8 |
rulified & : & \isaratt \\ |
7990 | 9 |
\end{matharray} |
10 |
||
9905 | 11 |
\begin{rail} |
12 |
'rulified' ('(' noasm ')')? |
|
13 |
; |
|
14 |
\end{rail} |
|
15 |
||
7990 | 16 |
\begin{descr} |
9848 | 17 |
|
9905 | 18 |
\item [$rulified$] causes a theorem to be put into standard object-rule form, |
19 |
replacing implication and (bounded) universal quantification of HOL by the |
|
20 |
corresponding meta-logical connectives. By default, the result is fully |
|
21 |
normalized, including assumptions and conclusions at any depth. The |
|
22 |
$no_asm$ option restricts the transformation to the conclusion of a rule. |
|
7990 | 23 |
\end{descr} |
24 |
||
25 |
||
7135 | 26 |
\section{Primitive types} |
27 |
||
7141 | 28 |
\indexisarcmd{typedecl}\indexisarcmd{typedef} |
29 |
\begin{matharray}{rcl} |
|
30 |
\isarcmd{typedecl} & : & \isartrans{theory}{theory} \\ |
|
31 |
\isarcmd{typedef} & : & \isartrans{theory}{proof(prove)} \\ |
|
32 |
\end{matharray} |
|
33 |
||
34 |
\begin{rail} |
|
35 |
'typedecl' typespec infix? comment? |
|
36 |
; |
|
37 |
'typedef' parname? typespec infix? \\ '=' term comment? |
|
38 |
; |
|
39 |
\end{rail} |
|
40 |
||
7167 | 41 |
\begin{descr} |
7141 | 42 |
\item [$\isarkeyword{typedecl}~(\vec\alpha)t$] is similar to the original |
43 |
$\isarkeyword{typedecl}$ of Isabelle/Pure (see \S\ref{sec:types-pure}), but |
|
44 |
also declares type arity $t :: (term, \dots, term) term$, making $t$ an |
|
45 |
actual HOL type constructor. |
|
46 |
\item [$\isarkeyword{typedef}~(\vec\alpha)t = A$] sets up a goal stating |
|
47 |
non-emptiness of the set $A$. After finishing the proof, the theory will be |
|
7175 | 48 |
augmented by a Gordon/HOL-style type definition. See \cite{isabelle-HOL} |
7335 | 49 |
for more information. Note that user-level theories usually do not directly |
50 |
refer to the HOL $\isarkeyword{typedef}$ primitive, but use more advanced |
|
51 |
packages such as $\isarkeyword{record}$ (see \S\ref{sec:record}) and |
|
7175 | 52 |
$\isarkeyword{datatype}$ (see \S\ref{sec:datatype}). |
7167 | 53 |
\end{descr} |
7141 | 54 |
|
55 |
||
56 |
\section{Records}\label{sec:record} |
|
57 |
||
58 |
\indexisarcmd{record} |
|
59 |
\begin{matharray}{rcl} |
|
60 |
\isarcmd{record} & : & \isartrans{theory}{theory} \\ |
|
61 |
\end{matharray} |
|
62 |
||
63 |
\begin{rail} |
|
64 |
'record' typespec '=' (type '+')? (field +) |
|
65 |
; |
|
7135 | 66 |
|
7141 | 67 |
field: name '::' type comment? |
68 |
; |
|
69 |
\end{rail} |
|
70 |
||
7167 | 71 |
\begin{descr} |
7141 | 72 |
\item [$\isarkeyword{record}~(\vec\alpha)t = \tau + \vec c :: \vec\sigma$] |
73 |
defines extensible record type $(\vec\alpha)t$, derived from the optional |
|
74 |
parent record $\tau$ by adding new field components $\vec c :: \vec\sigma$. |
|
7335 | 75 |
See \cite{isabelle-HOL,NaraschewskiW-TPHOLs98} for more information only |
76 |
simply-typed extensible records. |
|
7167 | 77 |
\end{descr} |
7141 | 78 |
|
79 |
||
80 |
\section{Datatypes}\label{sec:datatype} |
|
81 |
||
7167 | 82 |
\indexisarcmd{datatype}\indexisarcmd{rep-datatype} |
7141 | 83 |
\begin{matharray}{rcl} |
84 |
\isarcmd{datatype} & : & \isartrans{theory}{theory} \\ |
|
85 |
\isarcmd{rep_datatype} & : & \isartrans{theory}{theory} \\ |
|
86 |
\end{matharray} |
|
87 |
||
88 |
\railalias{repdatatype}{rep\_datatype} |
|
89 |
\railterm{repdatatype} |
|
90 |
||
91 |
\begin{rail} |
|
9848 | 92 |
'datatype' (dtspec + 'and') |
7141 | 93 |
; |
9848 | 94 |
repdatatype (name * ) dtrules |
7141 | 95 |
; |
96 |
||
9848 | 97 |
dtspec: parname? typespec infix? '=' (cons + '|') |
7141 | 98 |
; |
9848 | 99 |
cons: name (type * ) mixfix? comment? |
100 |
; |
|
101 |
dtrules: 'distinct' thmrefs 'inject' thmrefs 'induction' thmrefs |
|
7141 | 102 |
\end{rail} |
103 |
||
7167 | 104 |
\begin{descr} |
7319 | 105 |
\item [$\isarkeyword{datatype}$] defines inductive datatypes in HOL. |
106 |
\item [$\isarkeyword{rep_datatype}$] represents existing types as inductive |
|
107 |
ones, generating the standard infrastructure of derived concepts (primitive |
|
108 |
recursion etc.). |
|
7167 | 109 |
\end{descr} |
7141 | 110 |
|
8449 | 111 |
The induction and exhaustion theorems generated provide case names according |
112 |
to the constructors involved, while parameters are named after the types (see |
|
113 |
also \S\ref{sec:induct-method}). |
|
114 |
||
7319 | 115 |
See \cite{isabelle-HOL} for more details on datatypes. Note that the theory |
7335 | 116 |
syntax above has been slightly simplified over the old version, usually |
8531 | 117 |
requiring more quotes and less parentheses. Apart from proper proof methods |
118 |
for case-analysis and induction, there are also emulations of ML tactics |
|
8945 | 119 |
\texttt{case_tac} and \texttt{induct_tac} available, see |
8665 | 120 |
\S\ref{sec:induct_tac}. |
7319 | 121 |
|
7135 | 122 |
|
123 |
\section{Recursive functions} |
|
124 |
||
7141 | 125 |
\indexisarcmd{primrec}\indexisarcmd{recdef} |
9848 | 126 |
\indexisaratt{recdef-simp}\indexisaratt{recdef-cong}\indexisaratt{recdef-wf} |
7141 | 127 |
\begin{matharray}{rcl} |
128 |
\isarcmd{primrec} & : & \isartrans{theory}{theory} \\ |
|
129 |
\isarcmd{recdef} & : & \isartrans{theory}{theory} \\ |
|
9848 | 130 |
recdef_simp & : & \isaratt \\ |
131 |
recdef_cong & : & \isaratt \\ |
|
132 |
recdef_wf & : & \isaratt \\ |
|
7141 | 133 |
%FIXME |
134 |
% \isarcmd{defer_recdef} & : & \isartrans{theory}{theory} \\ |
|
135 |
\end{matharray} |
|
136 |
||
9848 | 137 |
\railalias{recdefsimp}{recdef\_simp} |
138 |
\railterm{recdefsimp} |
|
139 |
||
140 |
\railalias{recdefcong}{recdef\_cong} |
|
141 |
\railterm{recdefcong} |
|
142 |
||
143 |
\railalias{recdefwf}{recdef\_wf} |
|
144 |
\railterm{recdefwf} |
|
145 |
||
7141 | 146 |
\begin{rail} |
8657 | 147 |
'primrec' parname? (equation + ) |
148 |
; |
|
9848 | 149 |
'recdef' name term (eqn + ) hints? |
150 |
; |
|
151 |
(recdefsimp | recdefcong | recdefwf) (() | 'add' | 'del') |
|
7141 | 152 |
; |
8657 | 153 |
|
9848 | 154 |
equation: thmdecl? eqn |
155 |
; |
|
156 |
eqn: prop comment? |
|
8657 | 157 |
; |
9848 | 158 |
hints: '(' 'hints' (recdefmod * ) ')' |
159 |
; |
|
160 |
recdefmod: (('simp' | 'cong' | 'wf' | 'split' | 'iff') (() | 'add' | 'del') ':' thmrefs) | clamod |
|
7141 | 161 |
; |
162 |
\end{rail} |
|
163 |
||
7167 | 164 |
\begin{descr} |
7319 | 165 |
\item [$\isarkeyword{primrec}$] defines primitive recursive functions over |
9848 | 166 |
datatypes, see also \cite{isabelle-HOL}. |
7319 | 167 |
\item [$\isarkeyword{recdef}$] defines general well-founded recursive |
9848 | 168 |
functions (using the TFL package), see also \cite{isabelle-HOL}. The |
169 |
$simp$, $cong$, and $wf$ hints refer to auxiliary rules to be used in the |
|
170 |
internal automated proof process of TFL; the other declarations refer to the |
|
171 |
Simplifier and Classical reasoner (\S\ref{sec:simplifier}, |
|
172 |
\S\ref{sec:classical}, \S\ref{sec:clasimp}) that are used internally. |
|
173 |
||
174 |
\item [$recdef_simps$, $recdef_cong$, and $recdef_wf$] declare global hints |
|
175 |
for $\isarkeyword{recdef}$. |
|
7167 | 176 |
\end{descr} |
7141 | 177 |
|
9848 | 178 |
Both kinds of recursive definitions accommodate reasoning by induction (cf.\ |
8449 | 179 |
\S\ref{sec:induct-method}): rule $c\mathord{.}induct$ (where $c$ is the name |
180 |
of the function definition) refers to a specific induction rule, with |
|
181 |
parameters named according to the user-specified equations. Case names of |
|
182 |
$\isarkeyword{primrec}$ are that of the datatypes involved, while those of |
|
183 |
$\isarkeyword{recdef}$ are numbered (starting from $1$). |
|
184 |
||
8657 | 185 |
The equations provided by these packages may be referred later as theorem list |
186 |
$f\mathord.simps$, where $f$ is the (collective) name of the functions |
|
187 |
defined. Individual equations may be named explicitly as well; note that for |
|
188 |
$\isarkeyword{recdef}$ each specification given by the user may result in |
|
189 |
several theorems. |
|
190 |
||
7141 | 191 |
|
7135 | 192 |
\section{(Co)Inductive sets} |
193 |
||
9602 | 194 |
\indexisarcmd{inductive}\indexisarcmd{coinductive}\indexisaratt{mono} |
7141 | 195 |
\begin{matharray}{rcl} |
196 |
\isarcmd{inductive} & : & \isartrans{theory}{theory} \\ |
|
9848 | 197 |
\isarcmd{coinductive} & : & \isartrans{theory}{theory} \\ |
7990 | 198 |
mono & : & \isaratt \\ |
7141 | 199 |
\end{matharray} |
200 |
||
201 |
\railalias{condefs}{con\_defs} |
|
9602 | 202 |
\railterm{condefs} |
7141 | 203 |
|
204 |
\begin{rail} |
|
9848 | 205 |
('inductive' | 'coinductive') sets intros monos? |
7141 | 206 |
; |
7990 | 207 |
'mono' (() | 'add' | 'del') |
208 |
; |
|
9848 | 209 |
|
210 |
sets: (term comment? +) |
|
211 |
; |
|
212 |
intros: 'intros' attributes? (thmdecl? prop comment? +) |
|
213 |
; |
|
214 |
monos: 'monos' thmrefs comment? |
|
215 |
; |
|
7141 | 216 |
\end{rail} |
217 |
||
7167 | 218 |
\begin{descr} |
7319 | 219 |
\item [$\isarkeyword{inductive}$ and $\isarkeyword{coinductive}$] define |
220 |
(co)inductive sets from the given introduction rules. |
|
8547 | 221 |
\item [$mono$] declares monotonicity rules. These rule are involved in the |
222 |
automated monotonicity proof of $\isarkeyword{inductive}$. |
|
7167 | 223 |
\end{descr} |
7141 | 224 |
|
8449 | 225 |
See \cite{isabelle-HOL} for further information on inductive definitions in |
226 |
HOL. |
|
7319 | 227 |
|
7141 | 228 |
|
8449 | 229 |
\section{Proof by cases and induction}\label{sec:induct-method} |
230 |
||
8666 | 231 |
\subsection{Proof methods}\label{sec:induct-method-proper} |
7141 | 232 |
|
8449 | 233 |
\indexisarmeth{cases}\indexisarmeth{induct} |
7319 | 234 |
\begin{matharray}{rcl} |
8449 | 235 |
cases & : & \isarmeth \\ |
7319 | 236 |
induct & : & \isarmeth \\ |
237 |
\end{matharray} |
|
238 |
||
8449 | 239 |
The $cases$ and $induct$ methods provide a uniform interface to case analysis |
240 |
and induction over datatypes, inductive sets, and recursive functions. The |
|
241 |
corresponding rules may be specified and instantiated in a casual manner. |
|
242 |
Furthermore, these methods provide named local contexts that may be invoked |
|
243 |
via the $\CASENAME$ proof command within the subsequent proof text (cf.\ |
|
8484 | 244 |
\S\ref{sec:cases}). This accommodates compact proof texts even when reasoning |
245 |
about large specifications. |
|
7319 | 246 |
|
247 |
\begin{rail} |
|
9848 | 248 |
'cases' simplified? open? args rule? |
249 |
; |
|
250 |
'induct' stripped? open? args rule? |
|
7319 | 251 |
; |
252 |
||
9848 | 253 |
simplified: '(' 'simplified' ')' |
254 |
; |
|
255 |
stripped: '(' 'stripped' ')' |
|
256 |
; |
|
257 |
open: '(' 'open' ')' |
|
258 |
; |
|
259 |
args: (insts * 'and') |
|
260 |
; |
|
8449 | 261 |
rule: ('type' | 'set') ':' nameref | 'rule' ':' thmref |
7319 | 262 |
; |
263 |
\end{rail} |
|
264 |
||
265 |
\begin{descr} |
|
9602 | 266 |
\item [$cases~insts~R$] applies method $rule$ with an appropriate case |
267 |
distinction theorem, instantiated to the subjects $insts$. Symbolic case |
|
268 |
names are bound according to the rule's local contexts. |
|
8449 | 269 |
|
270 |
The rule is determined as follows, according to the facts and arguments |
|
271 |
passed to the $cases$ method: |
|
272 |
\begin{matharray}{llll} |
|
9695 | 273 |
\Text{facts} & & \Text{arguments} & \Text{rule} \\\hline |
274 |
& cases & & \Text{classical case split} \\ |
|
275 |
& cases & t & \Text{datatype exhaustion (type of $t$)} \\ |
|
276 |
\edrv a \in A & cases & \dots & \Text{inductive set elimination (of $A$)} \\ |
|
277 |
\dots & cases & \dots ~ R & \Text{explicit rule $R$} \\ |
|
8449 | 278 |
\end{matharray} |
9602 | 279 |
|
280 |
Several instantiations may be given, referring to the \emph{suffix} of |
|
281 |
premises of the case rule; within each premise, the \emph{prefix} of |
|
282 |
variables is instantiated. In most situations, only a single term needs to |
|
283 |
be specified; this refers to the first variable of the last premise (it is |
|
284 |
usually the same for all cases). |
|
8449 | 285 |
|
286 |
The $simplified$ option causes ``obvious cases'' of the rule to be solved |
|
287 |
beforehand, while the others are left unscathed. |
|
288 |
||
9616
b80ea2b32f8e
cases/induct method: 'opaque' by default; added 'open' option;
wenzelm
parents:
9602
diff
changeset
|
289 |
The $open$ option causes the parameters of the new local contexts to be |
b80ea2b32f8e
cases/induct method: 'opaque' by default; added 'open' option;
wenzelm
parents:
9602
diff
changeset
|
290 |
exposed to the current proof context. Thus local variables stemming from |
b80ea2b32f8e
cases/induct method: 'opaque' by default; added 'open' option;
wenzelm
parents:
9602
diff
changeset
|
291 |
distant parts of the theory development may be introduced in an implicit |
b80ea2b32f8e
cases/induct method: 'opaque' by default; added 'open' option;
wenzelm
parents:
9602
diff
changeset
|
292 |
manner, which can be quite confusing to the reader. Furthermore, this |
b80ea2b32f8e
cases/induct method: 'opaque' by default; added 'open' option;
wenzelm
parents:
9602
diff
changeset
|
293 |
option may cause unwanted hiding of existing local variables, resulting in |
b80ea2b32f8e
cases/induct method: 'opaque' by default; added 'open' option;
wenzelm
parents:
9602
diff
changeset
|
294 |
less robust proof texts. |
b80ea2b32f8e
cases/induct method: 'opaque' by default; added 'open' option;
wenzelm
parents:
9602
diff
changeset
|
295 |
|
8449 | 296 |
\item [$induct~insts~R$] is analogous to the $cases$ method, but refers to |
297 |
induction rules, which are determined as follows: |
|
298 |
\begin{matharray}{llll} |
|
9695 | 299 |
\Text{facts} & & \Text{arguments} & \Text{rule} \\\hline |
300 |
& induct & P ~ x ~ \dots & \Text{datatype induction (type of $x$)} \\ |
|
301 |
\edrv x \in A & induct & \dots & \Text{set induction (of $A$)} \\ |
|
302 |
\dots & induct & \dots ~ R & \Text{explicit rule $R$} \\ |
|
8449 | 303 |
\end{matharray} |
304 |
||
305 |
Several instantiations may be given, each referring to some part of a mutual |
|
306 |
inductive definition or datatype --- only related partial induction rules |
|
307 |
may be used together, though. Any of the lists of terms $P, x, \dots$ |
|
308 |
refers to the \emph{suffix} of variables present in the induction rule. |
|
309 |
This enables the writer to specify only induction variables, or both |
|
310 |
predicates and variables, for example. |
|
7507 | 311 |
|
8449 | 312 |
The $stripped$ option causes implications and (bounded) universal |
313 |
quantifiers to be removed from each new subgoal emerging from the |
|
8547 | 314 |
application of the induction rule. This accommodates typical |
315 |
``strengthening of induction'' predicates. |
|
9307 | 316 |
|
9616
b80ea2b32f8e
cases/induct method: 'opaque' by default; added 'open' option;
wenzelm
parents:
9602
diff
changeset
|
317 |
The $open$ option has the same effect as for the $cases$ method, see above. |
7319 | 318 |
\end{descr} |
7141 | 319 |
|
8484 | 320 |
Above methods produce named local contexts (cf.\ \S\ref{sec:cases}), as |
321 |
determined by the instantiated rule \emph{before} it has been applied to the |
|
322 |
internal proof state.\footnote{As a general principle, Isar proof text may |
|
8449 | 323 |
never refer to parts of proof states directly.} Thus proper use of symbolic |
324 |
cases usually require the rule to be instantiated fully, as far as the |
|
325 |
emerging local contexts and subgoals are concerned. In particular, for |
|
326 |
induction both the predicates and variables have to be specified. Otherwise |
|
8547 | 327 |
the $\CASENAME$ command would refuse to invoke cases containing schematic |
8449 | 328 |
variables. |
329 |
||
9602 | 330 |
The $\isarkeyword{print_cases}$ command (\S\ref{sec:cases}) prints all named |
8547 | 331 |
cases present in the current proof state. |
8449 | 332 |
|
333 |
||
8484 | 334 |
\subsection{Declaring rules} |
8449 | 335 |
|
336 |
\indexisaratt{cases}\indexisaratt{induct} |
|
337 |
\begin{matharray}{rcl} |
|
338 |
cases & : & \isaratt \\ |
|
339 |
induct & : & \isaratt \\ |
|
340 |
\end{matharray} |
|
341 |
||
342 |
\begin{rail} |
|
343 |
'cases' spec |
|
344 |
; |
|
345 |
'induct' spec |
|
346 |
; |
|
347 |
||
348 |
spec: ('type' | 'set') ':' nameref |
|
349 |
; |
|
350 |
\end{rail} |
|
351 |
||
352 |
The $cases$ and $induct$ attributes augment the corresponding context of rules |
|
353 |
for reasoning about inductive sets and types. The standard rules are already |
|
354 |
declared by HOL definitional packages. For special applications, these may be |
|
355 |
replaced manually by variant versions. |
|
356 |
||
8484 | 357 |
Refer to the $case_names$ and $params$ attributes (see \S\ref{sec:cases}) to |
358 |
adjust names of cases and parameters of a rule. |
|
359 |
||
7046 | 360 |
|
8665 | 361 |
\subsection{Emulating tactic scripts}\label{sec:induct_tac} |
362 |
||
363 |
\indexisarmeth{case-tac}\indexisarmeth{induct-tac} |
|
9616
b80ea2b32f8e
cases/induct method: 'opaque' by default; added 'open' option;
wenzelm
parents:
9602
diff
changeset
|
364 |
\indexisarmeth{ind-cases}\indexisarcmd{inductive-cases} |
8665 | 365 |
\begin{matharray}{rcl} |
9616
b80ea2b32f8e
cases/induct method: 'opaque' by default; added 'open' option;
wenzelm
parents:
9602
diff
changeset
|
366 |
case_tac^* & : & \isarmeth \\ |
b80ea2b32f8e
cases/induct method: 'opaque' by default; added 'open' option;
wenzelm
parents:
9602
diff
changeset
|
367 |
induct_tac^* & : & \isarmeth \\ |
b80ea2b32f8e
cases/induct method: 'opaque' by default; added 'open' option;
wenzelm
parents:
9602
diff
changeset
|
368 |
ind_cases^* & : & \isarmeth \\ |
9602 | 369 |
\isarcmd{inductive_cases} & : & \isartrans{theory}{theory} \\ |
8665 | 370 |
\end{matharray} |
371 |
||
372 |
\railalias{casetac}{case\_tac} |
|
373 |
\railterm{casetac} |
|
9602 | 374 |
|
8665 | 375 |
\railalias{inducttac}{induct\_tac} |
376 |
\railterm{inducttac} |
|
377 |
||
9616
b80ea2b32f8e
cases/induct method: 'opaque' by default; added 'open' option;
wenzelm
parents:
9602
diff
changeset
|
378 |
\railalias{indcases}{ind\_cases} |
b80ea2b32f8e
cases/induct method: 'opaque' by default; added 'open' option;
wenzelm
parents:
9602
diff
changeset
|
379 |
\railterm{indcases} |
9602 | 380 |
|
9616
b80ea2b32f8e
cases/induct method: 'opaque' by default; added 'open' option;
wenzelm
parents:
9602
diff
changeset
|
381 |
\railalias{inductivecases}{inductive\_cases} |
b80ea2b32f8e
cases/induct method: 'opaque' by default; added 'open' option;
wenzelm
parents:
9602
diff
changeset
|
382 |
\railterm{inductivecases} |
9602 | 383 |
|
8665 | 384 |
\begin{rail} |
8666 | 385 |
casetac goalspec? term rule? |
8665 | 386 |
; |
8692 | 387 |
inducttac goalspec? (insts * 'and') rule? |
8666 | 388 |
; |
9616
b80ea2b32f8e
cases/induct method: 'opaque' by default; added 'open' option;
wenzelm
parents:
9602
diff
changeset
|
389 |
indcases (prop +) |
9602 | 390 |
; |
9616
b80ea2b32f8e
cases/induct method: 'opaque' by default; added 'open' option;
wenzelm
parents:
9602
diff
changeset
|
391 |
inductivecases thmdecl? (prop +) comment? |
9602 | 392 |
; |
8666 | 393 |
|
394 |
rule: ('rule' ':' thmref) |
|
8665 | 395 |
; |
396 |
\end{rail} |
|
397 |
||
9602 | 398 |
\begin{descr} |
399 |
\item [$case_tac$ and $induct_tac$] admit to reason about inductive datatypes |
|
400 |
only (unless an alternative rule is given explicitly). Furthermore, |
|
401 |
$case_tac$ does a classical case split on booleans; $induct_tac$ allows only |
|
402 |
variables to be given as instantiation. These tactic emulations feature |
|
403 |
both goal addressing and dynamic instantiation. Note that named local |
|
404 |
contexts (see \S\ref{sec:cases}) are \emph{not} provided as would be by the |
|
405 |
proper $induct$ and $cases$ proof methods (see |
|
406 |
\S\ref{sec:induct-method-proper}). |
|
407 |
||
9616
b80ea2b32f8e
cases/induct method: 'opaque' by default; added 'open' option;
wenzelm
parents:
9602
diff
changeset
|
408 |
\item [$ind_cases$ and $\isarkeyword{inductive_cases}$] provide an interface |
b80ea2b32f8e
cases/induct method: 'opaque' by default; added 'open' option;
wenzelm
parents:
9602
diff
changeset
|
409 |
to the \texttt{mk_cases} operation. Rules are simplified in an unrestricted |
b80ea2b32f8e
cases/induct method: 'opaque' by default; added 'open' option;
wenzelm
parents:
9602
diff
changeset
|
410 |
forward manner, unlike the proper $cases$ method (see |
9602 | 411 |
\S\ref{sec:induct-method-proper}) which requires simplified cases to be |
412 |
solved completely. |
|
413 |
||
9616
b80ea2b32f8e
cases/induct method: 'opaque' by default; added 'open' option;
wenzelm
parents:
9602
diff
changeset
|
414 |
While $ind_cases$ is a proof method to apply the result immediately as |
9602 | 415 |
elimination rules, $\isarkeyword{inductive_cases}$ provides case split |
416 |
theorems at the theory level for later use, |
|
417 |
\end{descr} |
|
8665 | 418 |
|
419 |
||
7390 | 420 |
\section{Arithmetic} |
421 |
||
9642 | 422 |
\indexisarmeth{arith}\indexisaratt{arith-split} |
7390 | 423 |
\begin{matharray}{rcl} |
424 |
arith & : & \isarmeth \\ |
|
9602 | 425 |
arith_split & : & \isaratt \\ |
7390 | 426 |
\end{matharray} |
427 |
||
8506 | 428 |
\begin{rail} |
429 |
'arith' '!'? |
|
430 |
; |
|
431 |
\end{rail} |
|
432 |
||
7390 | 433 |
The $arith$ method decides linear arithmetic problems (on types $nat$, $int$, |
8506 | 434 |
$real$). Any current facts are inserted into the goal before running the |
435 |
procedure. The ``!''~argument causes the full context of assumptions to be |
|
9602 | 436 |
included. The $arith_split$ attribute declares case split rules to be |
437 |
expanded before the arithmetic procedure is invoked. |
|
8506 | 438 |
|
439 |
Note that a simpler (but faster) version of arithmetic reasoning is already |
|
440 |
performed by the Simplifier. |
|
7390 | 441 |
|
442 |
||
7046 | 443 |
%%% Local Variables: |
444 |
%%% mode: latex |
|
445 |
%%% TeX-master: "isar-ref" |
|
446 |
%%% End: |