doc-src/TutorialI/Recdef/document/Nested2.tex
changeset 9721 7e51c9f3d5a0
parent 9719 c753196599f9
child 9722 a5f86aed785b
--- a/doc-src/TutorialI/Recdef/document/Nested2.tex	Tue Aug 29 12:28:48 2000 +0200
+++ b/doc-src/TutorialI/Recdef/document/Nested2.tex	Tue Aug 29 15:13:10 2000 +0200
@@ -1,5 +1,4 @@
-%
-\begin{isabellebody}%
+\begin{isabelle}%
 %
 \begin{isamarkuptext}%
 \noindent
@@ -32,10 +31,21 @@
 \end{quote}
 both of which are solved by simplification:%
 \end{isamarkuptxt}%
-\isacommand{by}{\isacharparenleft}simp{\isacharunderscore}all\ del{\isacharcolon}map{\isacharunderscore}compose\ add{\isacharcolon}sym{\isacharbrackleft}OF\ map{\isacharunderscore}compose{\isacharbrackright}\ rev{\isacharunderscore}map{\isacharparenright}%
+\isacommand{by}{\isacharparenleft}simp{\isacharunderscore}all\ add{\isacharcolon}rev{\isacharunderscore}map\ sym{\isacharbrackleft}OF\ map{\isacharunderscore}compose{\isacharbrackright}{\isacharparenright}%
 \begin{isamarkuptext}%
 \noindent
-If this surprises you, see Datatype/Nested2......
+If the proof of the induction step mystifies you, we recommend to go through
+the chain of simplification steps in detail, probably with the help of
+\isa{trace\_simp}.
+%\begin{quote}
+%{term[display]"trev(trev(App f ts))"}\\
+%{term[display]"App f (rev(map trev (rev(map trev ts))))"}\\
+%{term[display]"App f (map trev (rev(rev(map trev ts))))"}\\
+%{term[display]"App f (map trev (map trev ts))"}\\
+%{term[display]"App f (map (trev o trev) ts)"}\\
+%{term[display]"App f (map (%x. x) ts)"}\\
+%{term[display]"App f ts"}
+%\end{quote}
 
 The above definition of \isa{trev} is superior to the one in \S\ref{sec:nested-datatype}
 because it brings \isa{rev} into play, about which already know a lot, in particular
@@ -46,12 +56,13 @@
 because they determine the complexity of your proofs.}
 \end{quote}
 
-Let us now return to the question of how \isacommand{recdef} can come up with sensible termination
-conditions in the presence of higher-order functions like \isa{map}. For a start, if nothing
-were known about \isa{map}, \isa{map\ trev\ \mbox{ts}} might apply \isa{trev} to arbitrary terms,
-and thus \isacommand{recdef} would try to prove the unprovable
-\isa{size\ \mbox{t}\ {\isacharless}\ Suc\ {\isacharparenleft}term{\isacharunderscore}size\ \mbox{ts}{\isacharparenright}}, without any assumption about \isa{t}.
-Therefore \isacommand{recdef} has been supplied with the congruence theorem \isa{map\_cong}: 
+Let us now return to the question of how \isacommand{recdef} can come up with
+sensible termination conditions in the presence of higher-order functions
+like \isa{map}. For a start, if nothing were known about \isa{map},
+\isa{map\ trev\ \mbox{ts}} might apply \isa{trev} to arbitrary terms, and thus
+\isacommand{recdef} would try to prove the unprovable \isa{size\ \mbox{t}\ {\isacharless}\ Suc\ {\isacharparenleft}term{\isacharunderscore}size\ \mbox{ts}{\isacharparenright}}, without any assumption about \isa{t}.  Therefore
+\isacommand{recdef} has been supplied with the congruence theorem
+\isa{map\_cong}:
 \begin{quote}
 
 \begin{isabelle}%
@@ -60,10 +71,11 @@
 \end{isabelle}%
 
 \end{quote}
-Its second premise expresses (indirectly) that the second argument of \isa{map} is only applied
-to elements of its third argument. Congruence rules for other higher-order functions on lists would
-look very similar but have not been proved yet because they were never needed.
-If you get into a situation where you need to supply \isacommand{recdef} with new congruence
+Its second premise expresses (indirectly) that the second argument of
+\isa{map} is only applied to elements of its third argument. Congruence
+rules for other higher-order functions on lists would look very similar but
+have not been proved yet because they were never needed. If you get into a
+situation where you need to supply \isacommand{recdef} with new congruence
 rules, you can either append the line
 \begin{ttbox}
 congs <congruence rules>
@@ -78,7 +90,7 @@
 declaring a congruence rule for the simplifier does not make it
 available to \isacommand{recdef}, and vice versa. This is intentional.%
 \end{isamarkuptext}%
-\end{isabellebody}%
+\end{isabelle}%
 %%% Local Variables:
 %%% mode: latex
 %%% TeX-master: "root"