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