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