# HG changeset patch # User nipkow # Date 1491899365 -7200 # Node ID f556a7a9080ce8a4a878bc54a5e7740b93554791 # Parent 1fd2dca8eb60b7c53d7fb232004246740d8d2391# Parent b8fc7e2e1b35a54fb17acb5703619b7c12ce173b merged diff -r 1fd2dca8eb60 -r f556a7a9080c src/Doc/Prog_Prove/Isar.thy --- a/src/Doc/Prog_Prove/Isar.thy Mon Apr 10 18:01:46 2017 +0200 +++ b/src/Doc/Prog_Prove/Isar.thy Tue Apr 11 10:29:25 2017 +0200 @@ -881,6 +881,45 @@ \end{enumerate} \index{structural induction|)} + +\ifsem\else +\subsection{Computation Induction} +\index{rule induction} + +In \autoref{sec:recursive-funs} we introduced computation induction and +its realization in Isabelle: the definition +of a recursive function \f\ via \isacom{fun} proves the corresponding computation +induction rule called \f.induct\. Induction with this rule looks like in +\autoref{sec:recursive-funs}, but now with \isacom{proof} instead of \isacom{apply}: +\begin{quote} +\isacom{proof} (\induction x\<^sub>1 \ x\<^sub>k rule: f.induct\) +\end{quote} +Just as for structural induction, this creates several cases, one for each +defining equation for \f\. By default (if the equations have not been named +by the user), the cases are numbered. That is, they are started by +\begin{quote} +\isacom{case} (\i x y ...\) +\end{quote} +where \i = 1,...,n\, \n\ is the number of equations defining \f\, +and \x y ...\ are the variables in equation \i\. Note the following: +\begin{itemize} +\item +Although \i\ is an Isar name, \i.IH\ (or similar) is not. You need +double quotes: "\i.IH\". When indexing the name, write "\i.IH\"(1), +not "\i.IH\(1)". +\item +If defining equations for \f\ overlap, \isacom{fun} instantiates them to make +them nonoverlapping. This means that one user-provided equation may lead to +several equations and thus to several cases in the induction rule. +These have names of the form "\i_j\", where \i\ is the number of the original +equation and the system-generated \j\ indicates the subcase. +\end{itemize} +In Isabelle/jEdit, the \induction\ proof method displays a proof skeleton +with all \isacom{case}s. This is particularly useful for computation induction +and the following rule induction. +\fi + + \subsection{Rule Induction} \index{rule induction|(}