# HG changeset patch # User wenzelm # Date 968688047 -7200 # Node ID 3370f6aa32001e2775b8acce58e799c30d954447 # Parent fe13743ffc8b352764e61a4b185092d183d98260 updated; diff -r fe13743ffc8b -r 3370f6aa3200 doc-src/TutorialI/CodeGen/document/CodeGen.tex --- a/doc-src/TutorialI/CodeGen/document/CodeGen.tex Mon Sep 11 17:59:53 2000 +0200 +++ b/doc-src/TutorialI/CodeGen/document/CodeGen.tex Mon Sep 11 18:00:47 2000 +0200 @@ -1,5 +1,6 @@ % \begin{isabellebody}% +\def\isabellecontext{CodeGen}% % \isamarkupsection{Case study: compiling expressions} % diff -r fe13743ffc8b -r 3370f6aa3200 doc-src/TutorialI/Datatype/document/ABexpr.tex --- a/doc-src/TutorialI/Datatype/document/ABexpr.tex Mon Sep 11 17:59:53 2000 +0200 +++ b/doc-src/TutorialI/Datatype/document/ABexpr.tex Mon Sep 11 18:00:47 2000 +0200 @@ -1,5 +1,6 @@ % \begin{isabellebody}% +\def\isabellecontext{ABexpr}% % \begin{isamarkuptext}% Sometimes it is necessary to define two datatypes that depend on each diff -r fe13743ffc8b -r 3370f6aa3200 doc-src/TutorialI/Datatype/document/Fundata.tex --- a/doc-src/TutorialI/Datatype/document/Fundata.tex Mon Sep 11 17:59:53 2000 +0200 +++ b/doc-src/TutorialI/Datatype/document/Fundata.tex Mon Sep 11 18:00:47 2000 +0200 @@ -1,5 +1,6 @@ % \begin{isabellebody}% +\def\isabellecontext{Fundata}% \isacommand{datatype}\ {\isacharparenleft}{\isacharprime}a{\isacharcomma}{\isacharprime}i{\isacharparenright}bigtree\ {\isacharequal}\ Tip\ {\isacharbar}\ Branch\ {\isacharprime}a\ {\isachardoublequote}{\isacharprime}i\ {\isasymRightarrow}\ {\isacharparenleft}{\isacharprime}a{\isacharcomma}{\isacharprime}i{\isacharparenright}bigtree{\isachardoublequote}% \begin{isamarkuptext}% \noindent @@ -10,11 +11,9 @@ \isa{nat}, we have an infinitely branching tree because each node has as many subtrees as there are natural numbers. How can we possibly write down such a tree? Using functional notation! For example, the term -% \begin{isabelle}% \ \ \ \ \ Branch\ \isadigit{0}\ {\isacharparenleft}{\isasymlambda}i{\isachardot}\ Branch\ i\ {\isacharparenleft}{\isasymlambda}n{\isachardot}\ Tip{\isacharparenright}{\isacharparenright}% -\end{isabelle}% - +\end{isabelle} of type \isa{{\isacharparenleft}nat{\isacharcomma}\ nat{\isacharparenright}\ bigtree} is the tree whose root is labeled with 0 and whose $i$th subtree is labeled with $i$ and has merely \isa{Tip}s as further subtrees. diff -r fe13743ffc8b -r 3370f6aa3200 doc-src/TutorialI/Datatype/document/Nested.tex --- a/doc-src/TutorialI/Datatype/document/Nested.tex Mon Sep 11 17:59:53 2000 +0200 +++ b/doc-src/TutorialI/Datatype/document/Nested.tex Mon Sep 11 18:00:47 2000 +0200 @@ -1,5 +1,6 @@ % \begin{isabellebody}% +\def\isabellecontext{Nested}% % \begin{isamarkuptext}% So far, all datatypes had the property that on the right-hand side of their @@ -71,11 +72,9 @@ \begin{exercise} The fact that substitution distributes over composition can be expressed roughly as follows: -% \begin{isabelle}% \ \ \ \ \ subst\ {\isacharparenleft}f\ o\ g{\isacharparenright}\ t\ {\isacharequal}\ subst\ f\ {\isacharparenleft}subst\ g\ t{\isacharparenright}% -\end{isabelle}% - +\end{isabelle} Correct this statement (you will find that it does not type-check), strengthen it, and prove it. (Note: \isaindexbold{o} is function composition; its definition is found in theorem \isa{o{\isacharunderscore}def}). @@ -89,11 +88,9 @@ The experienced functional programmer may feel that our above definition of \isa{subst} is unnecessarily complicated in that \isa{substs} is completely unnecessary. The \isa{App}-case can be defined directly as -% \begin{isabelle}% \ \ \ \ \ subst\ s\ {\isacharparenleft}App\ f\ ts{\isacharparenright}\ {\isacharequal}\ App\ f\ {\isacharparenleft}map\ {\isacharparenleft}subst\ s{\isacharparenright}\ ts{\isacharparenright}% -\end{isabelle}% - +\end{isabelle} where \isa{map} is the standard list function such that \isa{map\ f\ {\isacharbrackleft}x\isadigit{1}{\isacharcomma}{\isachardot}{\isachardot}{\isachardot}{\isacharcomma}xn{\isacharbrackright}\ {\isacharequal}\ {\isacharbrackleft}f\ x\isadigit{1}{\isacharcomma}{\isachardot}{\isachardot}{\isachardot}{\isacharcomma}f\ xn{\isacharbrackright}}. This is true, but Isabelle insists on the above fixed format. Fortunately, we can easily \emph{prove} diff -r fe13743ffc8b -r 3370f6aa3200 doc-src/TutorialI/Datatype/document/unfoldnested.tex --- a/doc-src/TutorialI/Datatype/document/unfoldnested.tex Mon Sep 11 17:59:53 2000 +0200 +++ b/doc-src/TutorialI/Datatype/document/unfoldnested.tex Mon Sep 11 18:00:47 2000 +0200 @@ -1,5 +1,6 @@ % \begin{isabellebody}% +\def\isabellecontext{unfoldnested}% \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{\isacharunderscore}list{\isachardoublequote}\isanewline \isakeyword{and}\ {\isacharparenleft}{\isacharprime}a{\isacharcomma}{\isacharprime}b{\isacharparenright}term{\isacharunderscore}list\ {\isacharequal}\ Nil\ {\isacharbar}\ Cons\ {\isachardoublequote}{\isacharparenleft}{\isacharprime}a{\isacharcomma}{\isacharprime}b{\isacharparenright}term{\isachardoublequote}\ {\isachardoublequote}{\isacharparenleft}{\isacharprime}a{\isacharcomma}{\isacharprime}b{\isacharparenright}term{\isacharunderscore}list{\isachardoublequote}\end{isabellebody}% %%% Local Variables: diff -r fe13743ffc8b -r 3370f6aa3200 doc-src/TutorialI/Ifexpr/document/Ifexpr.tex --- a/doc-src/TutorialI/Ifexpr/document/Ifexpr.tex Mon Sep 11 17:59:53 2000 +0200 +++ b/doc-src/TutorialI/Ifexpr/document/Ifexpr.tex Mon Sep 11 18:00:47 2000 +0200 @@ -1,5 +1,6 @@ % \begin{isabellebody}% +\def\isabellecontext{Ifexpr}% % \begin{isamarkuptext}% \subsubsection{How can we model boolean expressions?} diff -r fe13743ffc8b -r 3370f6aa3200 doc-src/TutorialI/Misc/document/AdvancedInd.tex --- a/doc-src/TutorialI/Misc/document/AdvancedInd.tex Mon Sep 11 17:59:53 2000 +0200 +++ b/doc-src/TutorialI/Misc/document/AdvancedInd.tex Mon Sep 11 18:00:47 2000 +0200 @@ -1,5 +1,6 @@ % \begin{isabellebody}% +\def\isabellecontext{AdvancedInd}% % \begin{isamarkuptext}% \noindent @@ -85,16 +86,16 @@ \begin{isamarkuptext}% \noindent or the wholesale stripping of \isa{{\isasymforall}} and -\isa{{\isasymlongrightarrow}} in the conclusion via \isa{rulify}% +\isa{{\isasymlongrightarrow}} in the conclusion via \isa{rulified}% \end{isamarkuptext}% -\isacommand{lemmas}\ myrule\ {\isacharequal}\ simple{\isacharbrackleft}rulify{\isacharbrackright}% +\isacommand{lemmas}\ myrule\ {\isacharequal}\ simple{\isacharbrackleft}rulified{\isacharbrackright}% \begin{isamarkuptext}% \noindent yielding \isa{{\isasymlbrakk}A\ y{\isacharsemicolon}\ B\ y{\isasymrbrakk}\ {\isasymLongrightarrow}\ B\ y\ {\isasymand}\ A\ y}. You can go one step further and include these derivations already in the statement of your original lemma, thus avoiding the intermediate step:% \end{isamarkuptext}% -\isacommand{lemma}\ myrule{\isacharbrackleft}rulify{\isacharbrackright}{\isacharcolon}\ \ {\isachardoublequote}{\isasymforall}y{\isachardot}\ A\ y\ {\isasymlongrightarrow}\ B\ y\ {\isasymlongrightarrow}\ B\ y\ {\isacharampersand}\ A\ y{\isachardoublequote}% +\isacommand{lemma}\ myrule{\isacharbrackleft}rulified{\isacharbrackright}{\isacharcolon}\ \ {\isachardoublequote}{\isasymforall}y{\isachardot}\ A\ y\ {\isasymlongrightarrow}\ B\ y\ {\isasymlongrightarrow}\ B\ y\ {\isacharampersand}\ A\ y{\isachardoublequote}% \begin{isamarkuptext}% \bigskip @@ -119,12 +120,10 @@ Structural induction on \isa{nat} is usually known as ``mathematical induction''. There is also ``complete induction'', where you must prove $P(n)$ under the assumption that $P(m)$ -holds for all $m