doc-src/TutorialI/Recdef/document/Nested0.tex
author paulson
Mon, 19 Mar 2001 10:37:47 +0100
changeset 11212 d06fb91f22da
parent 11196 bb4ede27fcb7
child 11494 23a118849801
permissions -rw-r--r--
*** empty log message ***
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9722
a5f86aed785b *** empty log message ***
nipkow
parents: 9721
diff changeset
     1
%
a5f86aed785b *** empty log message ***
nipkow
parents: 9721
diff changeset
     2
\begin{isabellebody}%
10267
325ead6d9457 updated;
wenzelm
parents: 10186
diff changeset
     3
\def\isabellecontext{Nested{\isadigit{0}}}%
9698
f0740137a65d updated;
wenzelm
parents:
diff changeset
     4
%
f0740137a65d updated;
wenzelm
parents:
diff changeset
     5
\begin{isamarkuptext}%
f0740137a65d updated;
wenzelm
parents:
diff changeset
     6
In \S\ref{sec:nested-datatype} we defined the datatype of terms%
f0740137a65d updated;
wenzelm
parents:
diff changeset
     7
\end{isamarkuptext}%
f0740137a65d updated;
wenzelm
parents:
diff changeset
     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}%
f0740137a65d updated;
wenzelm
parents:
diff changeset
     9
\begin{isamarkuptext}%
f0740137a65d updated;
wenzelm
parents:
diff changeset
    10
\noindent
f0740137a65d updated;
wenzelm
parents:
diff changeset
    11
and closed with the observation that the associated schema for the definition
f0740137a65d updated;
wenzelm
parents:
diff changeset
    12
of primitive recursive functions leads to overly verbose definitions. Moreover,
f0740137a65d updated;
wenzelm
parents:
diff changeset
    13
if you have worked exercise~\ref{ex:trev-trev} you will have noticed that
10878
b254d5ad6dd4 auto update
paulson
parents: 10267
diff changeset
    14
you needed to declare essentially the same function as \isa{rev}
11196
bb4ede27fcb7 *** empty log message ***
nipkow
parents: 10878
diff changeset
    15
and prove many standard properties of list reversal all over again. 
10878
b254d5ad6dd4 auto update
paulson
parents: 10267
diff changeset
    16
We will now show you how \isacommand{recdef} can simplify
9698
f0740137a65d updated;
wenzelm
parents:
diff changeset
    17
definitions and proofs about nested recursive datatypes. As an example we
9754
a123a64cadeb *** empty log message ***
nipkow
parents: 9722
diff changeset
    18
choose exercise~\ref{ex:trev-trev}:%
9698
f0740137a65d updated;
wenzelm
parents:
diff changeset
    19
\end{isamarkuptext}%
10186
499637e8f2c6 *** empty log message ***
nipkow
parents: 9924
diff changeset
    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
f0740137a65d updated;
wenzelm
parents:
diff changeset
    21
%%% Local Variables:
f0740137a65d updated;
wenzelm
parents:
diff changeset
    22
%%% mode: latex
f0740137a65d updated;
wenzelm
parents:
diff changeset
    23
%%% TeX-master: "root"
f0740137a65d updated;
wenzelm
parents:
diff changeset
    24
%%% End: