212 The $cases$ and $induct$ methods provide a uniform interface to case analysis |
212 The $cases$ and $induct$ methods provide a uniform interface to case analysis |
213 and induction over datatypes, inductive sets, and recursive functions. The |
213 and induction over datatypes, inductive sets, and recursive functions. The |
214 corresponding rules may be specified and instantiated in a casual manner. |
214 corresponding rules may be specified and instantiated in a casual manner. |
215 Furthermore, these methods provide named local contexts that may be invoked |
215 Furthermore, these methods provide named local contexts that may be invoked |
216 via the $\CASENAME$ proof command within the subsequent proof text (cf.\ |
216 via the $\CASENAME$ proof command within the subsequent proof text (cf.\ |
217 \S\ref{sec:proof-context}). This accommodates compact proof texts even when |
217 \S\ref{sec:cases}). This accommodates compact proof texts even when reasoning |
218 reasoning about large specifications. |
218 about large specifications. |
219 |
219 |
220 \begin{rail} |
220 \begin{rail} |
221 'cases' ('simplified' ':')? term? rule? ; |
221 'cases' ('simplified' ':')? term? rule? ; |
222 |
222 |
223 'induct' ('stripped' ':')? (inst * 'and') rule? |
223 'induct' ('stripped' ':')? (inst * 'and') rule? |
266 The $stripped$ option causes implications and (bounded) universal |
266 The $stripped$ option causes implications and (bounded) universal |
267 quantifiers to be removed from each new subgoal emerging from the |
267 quantifiers to be removed from each new subgoal emerging from the |
268 application of the induction rule. |
268 application of the induction rule. |
269 \end{descr} |
269 \end{descr} |
270 |
270 |
271 Above methods produce named local contexts (cf.\ \S\ref{sec:proof-context}), |
271 Above methods produce named local contexts (cf.\ \S\ref{sec:cases}), as |
272 as determined by the instantiated rule \emph{before} it has been applied to |
272 determined by the instantiated rule \emph{before} it has been applied to the |
273 the internal proof state.\footnote{As a general principle, Isar proof text may |
273 internal proof state.\footnote{As a general principle, Isar proof text may |
274 never refer to parts of proof states directly.} Thus proper use of symbolic |
274 never refer to parts of proof states directly.} Thus proper use of symbolic |
275 cases usually require the rule to be instantiated fully, as far as the |
275 cases usually require the rule to be instantiated fully, as far as the |
276 emerging local contexts and subgoals are concerned. In particular, for |
276 emerging local contexts and subgoals are concerned. In particular, for |
277 induction both the predicates and variables have to be specified. Otherwise |
277 induction both the predicates and variables have to be specified. Otherwise |
278 the $\CASENAME$ command would refuse to invoke cases that contain schematic |
278 the $\CASENAME$ command would refuse to invoke cases that contain schematic |
280 |
280 |
281 The $\isarkeyword{print_cases}$ command (\S\ref{sec:diag}) prints all named |
281 The $\isarkeyword{print_cases}$ command (\S\ref{sec:diag}) prints all named |
282 cases present in the current proof context. |
282 cases present in the current proof context. |
283 |
283 |
284 |
284 |
285 \subsection{Augmenting the context} |
285 \subsection{Declaring rules} |
286 |
286 |
287 \indexisaratt{cases}\indexisaratt{induct} |
287 \indexisaratt{cases}\indexisaratt{induct} |
288 \begin{matharray}{rcl} |
288 \begin{matharray}{rcl} |
289 cases & : & \isaratt \\ |
289 cases & : & \isaratt \\ |
290 induct & : & \isaratt \\ |
290 induct & : & \isaratt \\ |
303 The $cases$ and $induct$ attributes augment the corresponding context of rules |
303 The $cases$ and $induct$ attributes augment the corresponding context of rules |
304 for reasoning about inductive sets and types. The standard rules are already |
304 for reasoning about inductive sets and types. The standard rules are already |
305 declared by HOL definitional packages. For special applications, these may be |
305 declared by HOL definitional packages. For special applications, these may be |
306 replaced manually by variant versions. |
306 replaced manually by variant versions. |
307 |
307 |
|
308 Refer to the $case_names$ and $params$ attributes (see \S\ref{sec:cases}) to |
|
309 adjust names of cases and parameters of a rule. |
|
310 |
308 |
311 |
309 \section{Arithmetic} |
312 \section{Arithmetic} |
310 |
313 |
311 \indexisarmeth{arith} |
314 \indexisarmeth{arith} |
312 \begin{matharray}{rcl} |
315 \begin{matharray}{rcl} |