Browse Source

fixing typo in interp-R0 error, thanks to onelharrison

Jeremy Siek 4 years ago
parent
commit
60847dc69b
1 changed files with 17 additions and 15 deletions
  1. 17 15
      book.tex

+ 17 - 15
book.tex

@@ -851,7 +851,7 @@ $R_0$ expressions.
     [(Prim 'read '())
     [(Prim 'read '())
      (define r (read))
      (define r (read))
      (cond [(fixnum? r) r]
      (cond [(fixnum? r) r]
-           [else (error 'interp-R1 "expected an integer" r)])]
+           [else (error 'interp-R0 "expected an integer" r)])]
     [(Prim '- (list e))
     [(Prim '- (list e))
      (define v (interp-exp e))
      (define v (interp-exp e))
      (fx- 0 v)]
      (fx- 0 v)]
@@ -1254,11 +1254,11 @@ criteria in the following diagram.
 In the next section we introduce enough of the x86 assembly
 In the next section we introduce enough of the x86 assembly
 language to compile $R_1$.
 language to compile $R_1$.
 
 
-\section{The x86 Assembly Language}
+\section{The x86$_0$ Assembly Language}
 \label{sec:x86}
 \label{sec:x86}
 
 
 Figure~\ref{fig:x86-0-concrete} defines the concrete syntax for the subset of
 Figure~\ref{fig:x86-0-concrete} defines the concrete syntax for the subset of
-the x86 assembly language needed for this chapter.
+the x86 assembly language needed for this chapter, which we call x86$_0$.
 %
 %
 An x86 program begins with a \code{main} label followed by a sequence
 An x86 program begins with a \code{main} label followed by a sequence
 of instructions.  In the grammar, the superscript $+$ is used to
 of instructions.  In the grammar, the superscript $+$ is used to
@@ -1317,7 +1317,7 @@ the x86 instructions used in this book.
 \]
 \]
 \end{minipage}
 \end{minipage}
 }
 }
-\caption{The concrete syntax of the $x86_0$ assembly language (AT\&T syntax).}
+\caption{The concrete syntax of the x86$_0$ assembly language (AT\&T syntax).}
 \label{fig:x86-0-concrete}
 \label{fig:x86-0-concrete}
 \end{figure}
 \end{figure}
 
 
@@ -1492,7 +1492,7 @@ returns the stack pointer to where it was prior to the procedure call.
 
 
 The compiler needs a convenient representation for manipulating x86
 The compiler needs a convenient representation for manipulating x86
 programs, so we define an abstract syntax for x86 in
 programs, so we define an abstract syntax for x86 in
-Figure~\ref{fig:x86-0-ast}. We refer to this language as $x86_0$ with
+Figure~\ref{fig:x86-0-ast}. We refer to this language as x86$_0$ with
 a subscript $0$ because later we introduce extended versions of this
 a subscript $0$ because later we introduce extended versions of this
 assembly language. The main difference compared to the concrete syntax
 assembly language. The main difference compared to the concrete syntax
 of x86 (Figure~\ref{fig:x86-0-concrete}) is that it does not allow labeled
 of x86 (Figure~\ref{fig:x86-0-concrete}) is that it does not allow labeled
@@ -1527,7 +1527,7 @@ x86_0 &::= & \PROGRAM{\itm{info}}{\CFG{\key{(}\itm{label} \,\key{.}\, \Block \ke
 \]
 \]
 \end{minipage}
 \end{minipage}
 }
 }
-\caption{The abstract syntax of $x86_0$ assembly.}
+\caption{The abstract syntax of x86$_0$ assembly.}
 \label{fig:x86-0-ast}
 \label{fig:x86-0-ast}
 \end{figure}
 \end{figure}
 
 
@@ -1813,7 +1813,7 @@ C_0 & ::= & \PROGRAM{\itm{info}}{\CFG{\key{(}\itm{label}\,\key{.}\,\Tail\key{)}^
 \subsection{The dialects of x86}
 \subsection{The dialects of x86}
 
 
 The x86$^{*}_0$ language, pronounced ``pseudo x86'', is the output of
 The x86$^{*}_0$ language, pronounced ``pseudo x86'', is the output of
-the pass \key{select-instructions}. It extends $x86_0$ with an
+the pass \key{select-instructions}. It extends x86$_0$ with an
 unbounded number of program-scope variables and has looser rules
 unbounded number of program-scope variables and has looser rules
 regarding instruction arguments. The x86$^{\dagger}$ language, the
 regarding instruction arguments. The x86$^{\dagger}$ language, the
 output of \key{print-x86}, is the concrete syntax for x86.
 output of \key{print-x86}, is the concrete syntax for x86.
@@ -2852,8 +2852,10 @@ sets shown between each instruction to make the figure easy to read.
 \begin{exercise}\normalfont
 \begin{exercise}\normalfont
 Implement the compiler pass named \code{uncover-live} that computes
 Implement the compiler pass named \code{uncover-live} that computes
 the live-after sets. We recommend storing the live-after sets (a list
 the live-after sets. We recommend storing the live-after sets (a list
-of lists of variables) in the $\itm{info}$ field of the \key{Block}
-structure.
+of a set of variables) in the $\itm{info}$ field of the \key{Block}
+structure. We recommend using the
+\href{https://docs.racket-lang.org/reference/sets.html}{\code{racket/set}}
+package for representing sets of variables.
 %
 %
 We recommend organizing your code to use a helper function that takes
 We recommend organizing your code to use a helper function that takes
 a list of instructions and an initial live-after set (typically empty)
 a list of instructions and an initial live-after set (typically empty)
@@ -4052,7 +4054,7 @@ modern computer architectures.
 \end{exercise}
 \end{exercise}
 
 
 
 
-\section{XOR, Comparisons, and Control Flow in x86}
+\section{The x86$_1$ Language}
 \label{sec:x86-1}
 \label{sec:x86-1}
 
 
 To implement the new logical operations, the comparison operations,
 To implement the new logical operations, the comparison operations,
@@ -4115,7 +4117,7 @@ x86_1 &::= & \gray{\PROGRAM{\itm{info}}{\CFG{\key{(}\itm{label} \,\key{.}\, \Blo
 \]
 \]
 \end{minipage}
 \end{minipage}
 }
 }
-\caption{The abstract syntax of $x86_1$ (extends x86$_0$ of Figure~\ref{fig:x86-0-ast}).}
+\caption{The abstract syntax of x86$_1$ (extends x86$_0$ of Figure~\ref{fig:x86-0-ast}).}
 \label{fig:x86-1}
 \label{fig:x86-1}
 \end{figure}
 \end{figure}
 
 
@@ -5788,7 +5790,7 @@ start:
 
 
 \clearpage
 \clearpage
 
 
-\section{Select Instructions}
+\section{Select Instructions and the x86$_2$ Language}
 \label{sec:select-instructions-gc}
 \label{sec:select-instructions-gc}
 
 
 %% void (rep as zero)
 %% void (rep as zero)
@@ -5893,7 +5895,7 @@ x86_2 &::= & \gray{  (\key{program} \;\itm{info} \;(\key{type}\;\itm{type})\; \I
 \end{figure}
 \end{figure}
 
 
 The syntax of the $x86_2$ language is defined in
 The syntax of the $x86_2$ language is defined in
-Figure~\ref{fig:x86-2}.  It differs from $x86_1$ just in the addition
+Figure~\ref{fig:x86-2}.  It differs from x86$_1$ just in the addition
 of the form for global variables.
 of the form for global variables.
 %
 %
 Figure~\ref{fig:select-instr-output-gc} shows the output of the
 Figure~\ref{fig:select-instr-output-gc} shows the output of the
@@ -6560,7 +6562,7 @@ where $\itm{mainDef}$ is
 \end{lstlisting}
 \end{lstlisting}
 
 
 
 
-\section{Reveal Functions}
+\section{Reveal Functions and the $F_1$ language}
 \label{sec:reveal-functions-r4}
 \label{sec:reveal-functions-r4}
 
 
 Going forward, the syntax of $R_4$ is inconvenient for purposes of
 Going forward, the syntax of $R_4$ is inconvenient for purposes of
@@ -6711,7 +6713,7 @@ processing function definitions. Each function definition in $C_3$ has
 its own set of local variables, so the code for function definitions
 its own set of local variables, so the code for function definitions
 should be similar to the case for the \code{program} form in $C_2$.
 should be similar to the case for the \code{program} form in $C_2$.
 
 
-\section{Select Instructions}
+\section{Select Instructions and the x86$_3$ Language}
 \label{sec:select-r4}
 \label{sec:select-r4}
 
 
 The output of select instructions is a program in the x86$_3$
 The output of select instructions is a program in the x86$_3$