doc-src/TutorialI/Recdef/document/Nested0.tex
author wenzelm
Fri, 18 Jan 2002 18:30:19 +0100
changeset 12815 1f073030b97a
parent 11866 fbd097aec213
child 13758 ee898d32de21
permissions -rw-r--r--
tuned;
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}}}%
11866
fbd097aec213 updated;
wenzelm
parents: 11494
diff changeset
     4
\isamarkupfalse%
9698
f0740137a65d updated;
wenzelm
parents:
diff changeset
     5
%
f0740137a65d updated;
wenzelm
parents:
diff changeset
     6
\begin{isamarkuptext}%
11494
23a118849801 revisions and indexing
paulson
parents: 11196
diff changeset
     7
\index{datatypes!nested}%
9698
f0740137a65d updated;
wenzelm
parents:
diff changeset
     8
In \S\ref{sec:nested-datatype} we defined the datatype of terms%
f0740137a65d updated;
wenzelm
parents:
diff changeset
     9
\end{isamarkuptext}%
11866
fbd097aec213 updated;
wenzelm
parents: 11494
diff changeset
    10
\isamarkuptrue%
fbd097aec213 updated;
wenzelm
parents: 11494
diff changeset
    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%
fbd097aec213 updated;
wenzelm
parents: 11494
diff changeset
    12
%
9698
f0740137a65d updated;
wenzelm
parents:
diff changeset
    13
\begin{isamarkuptext}%
f0740137a65d updated;
wenzelm
parents:
diff changeset
    14
\noindent
f0740137a65d updated;
wenzelm
parents:
diff changeset
    15
and closed with the observation that the associated schema for the definition
f0740137a65d updated;
wenzelm
parents:
diff changeset
    16
of primitive recursive functions leads to overly verbose definitions. Moreover,
f0740137a65d updated;
wenzelm
parents:
diff changeset
    17
if you have worked exercise~\ref{ex:trev-trev} you will have noticed that
10878
b254d5ad6dd4 auto update
paulson
parents: 10267
diff changeset
    18
you needed to declare essentially the same function as \isa{rev}
11196
bb4ede27fcb7 *** empty log message ***
nipkow
parents: 10878
diff changeset
    19
and prove many standard properties of list reversal all over again. 
10878
b254d5ad6dd4 auto update
paulson
parents: 10267
diff changeset
    20
We will now show you how \isacommand{recdef} can simplify
9698
f0740137a65d updated;
wenzelm
parents:
diff changeset
    21
definitions and proofs about nested recursive datatypes. As an example we
9754
a123a64cadeb *** empty log message ***
nipkow
parents: 9722
diff changeset
    22
choose exercise~\ref{ex:trev-trev}:%
9698
f0740137a65d updated;
wenzelm
parents:
diff changeset
    23
\end{isamarkuptext}%
11866
fbd097aec213 updated;
wenzelm
parents: 11494
diff changeset
    24
\isamarkuptrue%
fbd097aec213 updated;
wenzelm
parents: 11494
diff changeset
    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%
fbd097aec213 updated;
wenzelm
parents: 11494
diff changeset
    26
\isamarkupfalse%
fbd097aec213 updated;
wenzelm
parents: 11494
diff changeset
    27
\end{isabellebody}%
9698
f0740137a65d updated;
wenzelm
parents:
diff changeset
    28
%%% Local Variables:
f0740137a65d updated;
wenzelm
parents:
diff changeset
    29
%%% mode: latex
f0740137a65d updated;
wenzelm
parents:
diff changeset
    30
%%% TeX-master: "root"
f0740137a65d updated;
wenzelm
parents:
diff changeset
    31
%%% End: