--- a/doc-src/TutorialI/CodeGen/document/CodeGen.tex Fri Jan 05 18:32:33 2001 +0100
+++ b/doc-src/TutorialI/CodeGen/document/CodeGen.tex Fri Jan 05 18:32:57 2001 +0100
@@ -8,7 +8,7 @@
\begin{isamarkuptext}%
\label{sec:ExprCompiler}
The task is to develop a compiler from a generic type of expressions (built
-up from variables, constants and binary operations) to a stack machine. This
+from variables, constants and binary operations) to a stack machine. This
generic type of expressions is a generalization of the boolean expressions in
\S\ref{sec:boolex}. This time we do not commit ourselves to a particular
type of variables or values but make them type parameters. Neither is there
@@ -24,7 +24,7 @@
The three constructors represent constants, variables and the application of
a binary operation to two subexpressions.
-The value of an expression w.r.t.\ an environment that maps variables to
+The value of an expression with respect to an environment that maps variables to
values is easily defined:%
\end{isamarkuptext}%
\isacommand{consts}\ value\ {\isacharcolon}{\isacharcolon}\ {\isachardoublequote}{\isacharparenleft}{\isacharprime}a{\isacharcomma}{\isacharprime}v{\isacharparenright}expr\ {\isasymRightarrow}\ {\isacharparenleft}{\isacharprime}a\ {\isasymRightarrow}\ {\isacharprime}v{\isacharparenright}\ {\isasymRightarrow}\ {\isacharprime}v{\isachardoublequote}\isanewline
@@ -34,7 +34,7 @@
{\isachardoublequote}value\ {\isacharparenleft}Bex\ f\ e{\isadigit{1}}\ e{\isadigit{2}}{\isacharparenright}\ env\ {\isacharequal}\ f\ {\isacharparenleft}value\ e{\isadigit{1}}\ env{\isacharparenright}\ {\isacharparenleft}value\ e{\isadigit{2}}\ env{\isacharparenright}{\isachardoublequote}%
\begin{isamarkuptext}%
The stack machine has three instructions: load a constant value onto the
-stack, load the contents of a certain address onto the stack, and apply a
+stack, load the contents of an address onto the stack, and apply a
binary operation to the two topmost elements of the stack, replacing them by
the result. As for \isa{expr}, addresses and values are type parameters:%
\end{isamarkuptext}%
@@ -62,12 +62,12 @@
return the first element and the remainder of a list.
Because all functions are total, \isa{hd} is defined even for the empty
list, although we do not know what the result is. Thus our model of the
-machine always terminates properly, although the above definition does not
+machine always terminates properly, although the definition above does not
tell us much about the result in situations where \isa{Apply} was executed
with fewer than two elements on the stack.
The compiler is a function from expressions to a list of instructions. Its
-definition is pretty much obvious:%
+definition is obvious:%
\end{isamarkuptext}%
\isacommand{consts}\ comp\ {\isacharcolon}{\isacharcolon}\ {\isachardoublequote}{\isacharparenleft}{\isacharprime}a{\isacharcomma}{\isacharprime}v{\isacharparenright}expr\ {\isasymRightarrow}\ {\isacharparenleft}{\isacharprime}a{\isacharcomma}{\isacharprime}v{\isacharparenright}instr\ list{\isachardoublequote}\isanewline
\isacommand{primrec}\isanewline