212 via the $\CASENAME$ proof command within the subsequent proof text (cf.\ |
212 via the $\CASENAME$ proof command within the subsequent proof text (cf.\ |
213 \S\ref{sec:cases}). This accommodates compact proof texts even when reasoning |
213 \S\ref{sec:cases}). This accommodates compact proof texts even when reasoning |
214 about large specifications. |
214 about large specifications. |
215 |
215 |
216 \begin{rail} |
216 \begin{rail} |
217 'cases' ('(simplified)')? ('(opaque)')? \\ (insts * 'and') rule? ; |
217 'cases' ('(simplified)')? ('(open)')? \\ (insts * 'and') rule? ; |
218 |
218 |
219 'induct' ('(stripped)')? ('(opaque)')? \\ (insts * 'and') rule? |
219 'induct' ('(stripped)')? ('(open)')? \\ (insts * 'and') rule? |
220 ; |
220 ; |
221 |
221 |
222 rule: ('type' | 'set') ':' nameref | 'rule' ':' thmref |
222 rule: ('type' | 'set') ':' nameref | 'rule' ':' thmref |
223 ; |
223 ; |
224 \end{rail} |
224 \end{rail} |
245 usually the same for all cases). |
245 usually the same for all cases). |
246 |
246 |
247 The $simplified$ option causes ``obvious cases'' of the rule to be solved |
247 The $simplified$ option causes ``obvious cases'' of the rule to be solved |
248 beforehand, while the others are left unscathed. |
248 beforehand, while the others are left unscathed. |
249 |
249 |
250 The $opaque$ option causes the parameters of the new local contexts to be |
250 The $open$ option causes the parameters of the new local contexts to be |
251 turned into ``internal'' names. This results in quasi-existentially bound |
251 exposed to the current proof context. Thus local variables stemming from |
252 elements to be introduced when individual cases are invoked later. Thus |
252 distant parts of the theory development may be introduced in an implicit |
253 both unwanted hiding of existing local variables and references to |
253 manner, which can be quite confusing to the reader. Furthermore, this |
254 implicitly bound variables (stemming from cases) are avoided. So by using |
254 option may cause unwanted hiding of existing local variables, resulting in |
255 the $opaque$ option, a proof text may become slightly more readable and |
255 less robust proof texts. |
256 robust. |
256 |
257 |
|
258 \item [$induct~insts~R$] is analogous to the $cases$ method, but refers to |
257 \item [$induct~insts~R$] is analogous to the $cases$ method, but refers to |
259 induction rules, which are determined as follows: |
258 induction rules, which are determined as follows: |
260 \begin{matharray}{llll} |
259 \begin{matharray}{llll} |
261 \text{facts} & & \text{arguments} & \text{rule} \\\hline |
260 \text{facts} & & \text{arguments} & \text{rule} \\\hline |
262 & induct & P ~ x ~ \dots & \text{datatype induction (type of $x$)} \\ |
261 & induct & P ~ x ~ \dots & \text{datatype induction (type of $x$)} \\ |
274 The $stripped$ option causes implications and (bounded) universal |
273 The $stripped$ option causes implications and (bounded) universal |
275 quantifiers to be removed from each new subgoal emerging from the |
274 quantifiers to be removed from each new subgoal emerging from the |
276 application of the induction rule. This accommodates typical |
275 application of the induction rule. This accommodates typical |
277 ``strengthening of induction'' predicates. |
276 ``strengthening of induction'' predicates. |
278 |
277 |
279 The $opaque$ option has the same effect as for the $cases$ method, see |
278 The $open$ option has the same effect as for the $cases$ method, see above. |
280 above. |
|
281 \end{descr} |
279 \end{descr} |
282 |
280 |
283 Above methods produce named local contexts (cf.\ \S\ref{sec:cases}), as |
281 Above methods produce named local contexts (cf.\ \S\ref{sec:cases}), as |
284 determined by the instantiated rule \emph{before} it has been applied to the |
282 determined by the instantiated rule \emph{before} it has been applied to the |
285 internal proof state.\footnote{As a general principle, Isar proof text may |
283 internal proof state.\footnote{As a general principle, Isar proof text may |
322 |
320 |
323 |
321 |
324 \subsection{Emulating tactic scripts}\label{sec:induct_tac} |
322 \subsection{Emulating tactic scripts}\label{sec:induct_tac} |
325 |
323 |
326 \indexisarmeth{case-tac}\indexisarmeth{induct-tac} |
324 \indexisarmeth{case-tac}\indexisarmeth{induct-tac} |
327 \indexisarmeth{mk-cases-tac}\indexisarcmd{inductive-cases} |
325 \indexisarmeth{ind-cases}\indexisarcmd{inductive-cases} |
328 \begin{matharray}{rcl} |
326 \begin{matharray}{rcl} |
329 case_tac & : & \isarmeth \\ |
327 case_tac^* & : & \isarmeth \\ |
330 induct_tac & : & \isarmeth \\ |
328 induct_tac^* & : & \isarmeth \\ |
331 mk_cases_tac & : & \isarmeth \\ |
329 ind_cases^* & : & \isarmeth \\ |
332 \isarcmd{inductive_cases} & : & \isartrans{theory}{theory} \\ |
330 \isarcmd{inductive_cases} & : & \isartrans{theory}{theory} \\ |
333 \end{matharray} |
331 \end{matharray} |
334 |
332 |
335 \railalias{casetac}{case\_tac} |
333 \railalias{casetac}{case\_tac} |
336 \railterm{casetac} |
334 \railterm{casetac} |
337 |
335 |
338 \railalias{inducttac}{induct\_tac} |
336 \railalias{inducttac}{induct\_tac} |
339 \railterm{inducttac} |
337 \railterm{inducttac} |
340 |
338 |
341 \railalias{mkcasestac}{mk\_cases\_tac} |
339 \railalias{indcases}{ind\_cases} |
342 \railterm{mkcasestac} |
|
343 |
|
344 \railalias{indcases}{inductive\_cases} |
|
345 \railterm{indcases} |
340 \railterm{indcases} |
346 |
341 |
|
342 \railalias{inductivecases}{inductive\_cases} |
|
343 \railterm{inductivecases} |
|
344 |
347 \begin{rail} |
345 \begin{rail} |
348 casetac goalspec? term rule? |
346 casetac goalspec? term rule? |
349 ; |
347 ; |
350 inducttac goalspec? (insts * 'and') rule? |
348 inducttac goalspec? (insts * 'and') rule? |
351 ; |
349 ; |
352 mkcasestac (prop +) |
350 indcases (prop +) |
353 ; |
351 ; |
354 indcases thmdef? (prop +) comment? |
352 inductivecases thmdecl? (prop +) comment? |
355 ; |
353 ; |
356 |
354 |
357 rule: ('rule' ':' thmref) |
355 rule: ('rule' ':' thmref) |
358 ; |
356 ; |
359 \end{rail} |
357 \end{rail} |
366 both goal addressing and dynamic instantiation. Note that named local |
364 both goal addressing and dynamic instantiation. Note that named local |
367 contexts (see \S\ref{sec:cases}) are \emph{not} provided as would be by the |
365 contexts (see \S\ref{sec:cases}) are \emph{not} provided as would be by the |
368 proper $induct$ and $cases$ proof methods (see |
366 proper $induct$ and $cases$ proof methods (see |
369 \S\ref{sec:induct-method-proper}). |
367 \S\ref{sec:induct-method-proper}). |
370 |
368 |
371 \item [$mk_cases_tac$ and $\isarkeyword{inductive_cases}$] provide an |
369 \item [$ind_cases$ and $\isarkeyword{inductive_cases}$] provide an interface |
372 interface to the \texttt{mk_cases} operation. Rules are simplified in an |
370 to the \texttt{mk_cases} operation. Rules are simplified in an unrestricted |
373 unrestricted forward manner, unlike the proper $cases$ method (see |
371 forward manner, unlike the proper $cases$ method (see |
374 \S\ref{sec:induct-method-proper}) which requires simplified cases to be |
372 \S\ref{sec:induct-method-proper}) which requires simplified cases to be |
375 solved completely. |
373 solved completely. |
376 |
374 |
377 While $mk_cases_tac$ is a proof method to apply the result immediately as |
375 While $ind_cases$ is a proof method to apply the result immediately as |
378 elimination rules, $\isarkeyword{inductive_cases}$ provides case split |
376 elimination rules, $\isarkeyword{inductive_cases}$ provides case split |
379 theorems at the theory level for later use, |
377 theorems at the theory level for later use, |
380 \end{descr} |
378 \end{descr} |
381 |
379 |
382 |
380 |