| 10178 |      1 | \chapter{Advanced Simplification, Recursion and Induction}
 | 
| 9958 |      2 | 
 | 
|  |      3 | Although we have already learned a lot about simplification, recursion and
 | 
|  |      4 | induction, there are some advanced proof techniques that we have not covered
 | 
| 10885 |      5 | yet and which are worth learning. The three sections of this chapter are almost
 | 
| 9958 |      6 | independent of each other and can be read in any order. Only the notion of
 | 
|  |      7 | \emph{congruence rules}, introduced in the section on simplification, is
 | 
|  |      8 | required for parts of the section on recursion.
 | 
|  |      9 | 
 | 
| 9993 |     10 | \input{Advanced/document/simp.tex}
 | 
| 9958 |     11 | 
 | 
| 11216 |     12 | \section{Advanced Forms of Recursion}
 | 
| 11428 |     13 | \index{recdef@\isacommand {recdef} (command)|(}
 | 
| 10186 |     14 | 
 | 
| 11494 |     15 | This section introduces advanced forms of
 | 
| 11196 |     16 | \isacommand{recdef}: how to establish termination by means other than measure
 | 
| 11494 |     17 | functions, how to define recursive functions over nested recursive datatypes
 | 
| 10654 |     18 | and how to deal with partial functions.
 | 
| 10187 |     19 | 
 | 
| 10189 |     20 | If, after reading this section, you feel that the definition of recursive
 | 
| 10885 |     21 | functions is overly complicated by the requirement of
 | 
| 11494 |     22 | totality, you should ponder the alternatives.  In a logic of partial functions,
 | 
|  |     23 | recursive definitions are always accepted.  But there are many
 | 
| 10189 |     24 | such logics, and no clear winner has emerged. And in all of these logics you
 | 
|  |     25 | are (more or less frequently) required to reason about the definedness of
 | 
| 10885 |     26 | terms explicitly. Thus one shifts definedness arguments from definition time to
 | 
| 10189 |     27 | proof time. In HOL you may have to work hard to define a function, but proofs
 | 
|  |     28 | can then proceed unencumbered by worries about undefinedness.
 | 
|  |     29 | 
 | 
| 11216 |     30 | \subsection{Beyond Measure}
 | 
| 11196 |     31 | \label{sec:beyond-measure}
 | 
|  |     32 | \input{Advanced/document/WFrec.tex}
 | 
|  |     33 | 
 | 
| 11216 |     34 | \subsection{Recursion Over Nested Datatypes}
 | 
| 10186 |     35 | \label{sec:nested-recdef}
 | 
| 9993 |     36 | \input{Recdef/document/Nested0.tex}
 | 
|  |     37 | \input{Recdef/document/Nested1.tex}
 | 
|  |     38 | \input{Recdef/document/Nested2.tex}
 | 
| 9958 |     39 | 
 | 
| 11216 |     40 | \subsection{Partial Functions}
 | 
| 11494 |     41 | \index{functions!partial}
 | 
| 10654 |     42 | \input{Advanced/document/Partial.tex}
 | 
|  |     43 | 
 | 
| 11428 |     44 | \index{recdef@\isacommand {recdef} (command)|)}
 | 
| 10654 |     45 | 
 | 
| 11216 |     46 | \section{Advanced Induction Techniques}
 | 
| 9958 |     47 | \label{sec:advanced-ind}
 | 
|  |     48 | \index{induction|(}
 | 
| 9993 |     49 | \input{Misc/document/AdvancedInd.tex}
 | 
| 10217 |     50 | \input{CTL/document/CTLind.tex}
 | 
| 9958 |     51 | \index{induction|)}
 |