doc-src/TutorialI/fp.tex
changeset 9493 494f8cd34df7
parent 9458 c613cd06d5cf
child 9494 44fefb6e9994
equal deleted inserted replaced
9492:72e429c66608 9493:494f8cd34df7
   195 becomes smaller with every recursive call. There must be exactly one equation
   195 becomes smaller with every recursive call. There must be exactly one equation
   196 for each constructor.  Their order is immaterial.
   196 for each constructor.  Their order is immaterial.
   197 A more general method for defining total recursive functions is introduced in
   197 A more general method for defining total recursive functions is introduced in
   198 \S\ref{sec:recdef}.
   198 \S\ref{sec:recdef}.
   199 
   199 
   200 \begin{exercise}
   200 \begin{exercise}\label{ex:Tree}
   201 \input{Misc/document/Tree.tex}%
   201 \input{Misc/document/Tree.tex}%
   202 \end{exercise}
   202 \end{exercise}
   203 
   203 
   204 \subsection{Case expressions}
   204 \subsection{Case expressions}
   205 \label{sec:case-expressions}
   205 \label{sec:case-expressions}
   677 \end{quote}
   677 \end{quote}
   678 The heuristic is tricky to apply because it is not obvious that
   678 The heuristic is tricky to apply because it is not obvious that
   679 \isa{rev xs \at\ ys} is simpler than \isa{itrev xs ys}. But see what
   679 \isa{rev xs \at\ ys} is simpler than \isa{itrev xs ys}. But see what
   680 happens if you try to prove \isa{rev xs \at\ ys = itrev xs ys}!
   680 happens if you try to prove \isa{rev xs \at\ ys = itrev xs ys}!
   681 
   681 
       
   682 \begin{exercise}
       
   683 \input{Misc/document/Tree2.tex}%
       
   684 \end{exercise}
   682 
   685 
   683 \section{Case study: compiling expressions}
   686 \section{Case study: compiling expressions}
   684 \label{sec:ExprCompiler}
   687 \label{sec:ExprCompiler}
   685 
   688 
   686 {\makeatother\input{CodeGen/document/CodeGen.tex}}
   689 {\makeatother\input{CodeGen/document/CodeGen.tex}}