| 9722 |      1 | %
 | 
|  |      2 | \begin{isabellebody}%
 | 
| 10267 |      3 | \def\isabellecontext{Nested{\isadigit{0}}}%
 | 
| 11866 |      4 | \isamarkupfalse%
 | 
| 9698 |      5 | %
 | 
|  |      6 | \begin{isamarkuptext}%
 | 
| 11494 |      7 | \index{datatypes!nested}%
 | 
| 9698 |      8 | In \S\ref{sec:nested-datatype} we defined the datatype of terms%
 | 
|  |      9 | \end{isamarkuptext}%
 | 
| 11866 |     10 | \isamarkuptrue%
 | 
|  |     11 | \isacommand{datatype}\ {\isacharparenleft}{\isacharprime}a{\isacharcomma}{\isacharprime}b{\isacharparenright}{\isachardoublequote}term{\isachardoublequote}\ {\isacharequal}\ Var\ {\isacharprime}a\ {\isacharbar}\ App\ {\isacharprime}b\ {\isachardoublequote}{\isacharparenleft}{\isacharprime}a{\isacharcomma}{\isacharprime}b{\isacharparenright}term\ list{\isachardoublequote}\isamarkupfalse%
 | 
|  |     12 | %
 | 
| 9698 |     13 | \begin{isamarkuptext}%
 | 
|  |     14 | \noindent
 | 
|  |     15 | and closed with the observation that the associated schema for the definition
 | 
|  |     16 | of primitive recursive functions leads to overly verbose definitions. Moreover,
 | 
|  |     17 | if you have worked exercise~\ref{ex:trev-trev} you will have noticed that
 | 
| 10878 |     18 | you needed to declare essentially the same function as \isa{rev}
 | 
| 11196 |     19 | and prove many standard properties of list reversal all over again. 
 | 
| 10878 |     20 | We will now show you how \isacommand{recdef} can simplify
 | 
| 9698 |     21 | definitions and proofs about nested recursive datatypes. As an example we
 | 
| 9754 |     22 | choose exercise~\ref{ex:trev-trev}:%
 | 
| 9698 |     23 | \end{isamarkuptext}%
 | 
| 11866 |     24 | \isamarkuptrue%
 | 
|  |     25 | \isacommand{consts}\ trev\ \ {\isacharcolon}{\isacharcolon}\ {\isachardoublequote}{\isacharparenleft}{\isacharprime}a{\isacharcomma}{\isacharprime}b{\isacharparenright}term\ {\isasymRightarrow}\ {\isacharparenleft}{\isacharprime}a{\isacharcomma}{\isacharprime}b{\isacharparenright}term{\isachardoublequote}\isamarkupfalse%
 | 
|  |     26 | \isamarkupfalse%
 | 
|  |     27 | \end{isabellebody}%
 | 
| 9698 |     28 | %%% Local Variables:
 | 
|  |     29 | %%% mode: latex
 | 
|  |     30 | %%% TeX-master: "root"
 | 
|  |     31 | %%% End:
 |