Jeremy Siek 3 жил өмнө
parent
commit
0735128842
1 өөрчлөгдсөн 118 нэмэгдсэн , 92 устгасан
  1. 118 92
      book.tex

+ 118 - 92
book.tex

@@ -302,8 +302,7 @@ Lowell, and the University of Vermont.
 
 
 \begin{figure}[tp]
-\fbox{
-\begin{minipage}{0.96\textwidth}
+\begin{tcolorbox}[colback=white]
   {\if\edition\racketEd
 \begin{tikzpicture}[baseline=(current  bounding  box.center)]
   \node (C1) at (0,1.5) {\small Ch.~\ref{ch:trees-recur} Preliminaries};
@@ -362,8 +361,7 @@ Lowell, and the University of Vermont.
   \path[->] (C10) edge [above] node {} (C11);
 \end{tikzpicture}
 \fi}
-\end{minipage}
-}
+\end{tcolorbox}
 \caption{Diagram of chapter dependencies.}
 \label{fig:chapter-dependences}
 \end{figure}
@@ -942,8 +940,7 @@ defined in Figure~\ref{fig:r0-concrete-syntax}.
 
   
 \begin{figure}[tp]
-\fbox{
-\begin{minipage}{0.96\textwidth}
+\begin{tcolorbox}[colback=white]
 {\if\edition\racketEd    
 \[
 \begin{array}{l}  
@@ -965,16 +962,13 @@ defined in Figure~\ref{fig:r0-concrete-syntax}.
   \end{array}
   \]
 \fi}
-
-\end{minipage}
-}
+\end{tcolorbox}
 \caption{The concrete syntax of \LangInt{}.}
 \label{fig:r0-concrete-syntax}
 \end{figure}
 
 \begin{figure}[tp]
-\fbox{
-\begin{minipage}{0.96\textwidth}
+\begin{tcolorbox}[colback=white]
 {\if\edition\racketEd
 \[
 \begin{array}{l}
@@ -996,8 +990,7 @@ defined in Figure~\ref{fig:r0-concrete-syntax}.
 \end{array}
 \]
 \fi}
-\end{minipage}
-}
+\end{tcolorbox}
 \caption{The abstract syntax of \LangInt{}.}
 \label{fig:r0-syntax}
 \end{figure}
@@ -1197,8 +1190,9 @@ two examples at the bottom of the figure, the first is in
 \LangInt{} and the second is not.
 
 \begin{figure}[tp]
+\begin{tcolorbox}[colback=white]
 {\if\edition\racketEd
-\begin{lstlisting}[frame=single]
+\begin{lstlisting}
 (define (is_exp ast)
   (match ast
     [(Int n) #t]
@@ -1222,7 +1216,7 @@ two examples at the bottom of the figure, the first is in
 \end{lstlisting}
 \fi}
 {\if\edition\pythonEd
-\begin{lstlisting}[frame=single]
+\begin{lstlisting}
 def is_exp(e):
   match e:
     case Constant(n):
@@ -1259,7 +1253,7 @@ print(is_Lint(Module([Expr(BinOp(read, Sub(),
                   UnaryOp(Add(), Constant(8))))])))
 \end{lstlisting}
 \fi}
-
+\end{tcolorbox}
 \caption{Example of recursive functions for \LangInt{}. These functions
   recognize whether an AST is in \LangInt{}.}
 \label{fig:exp-predicate}
@@ -1329,8 +1323,9 @@ Figure~\ref{fig:interp_Lint}.
   non-terminal.}
 
 \begin{figure}[tp]
+\begin{tcolorbox}[colback=white]
 {\if\edition\racketEd
-\begin{lstlisting}[frame=single]
+\begin{lstlisting}
 (define (interp_exp e)
   (match e
     [(Int n) n]
@@ -1356,7 +1351,7 @@ Figure~\ref{fig:interp_Lint}.
 \end{lstlisting}
 \fi}
 {\if\edition\pythonEd
-\begin{lstlisting}[frame=single]
+\begin{lstlisting}
 def interp_exp(e):
     match e:
         case BinOp(left, Add(), right):
@@ -1386,6 +1381,8 @@ def interp_Lint(p):
                 interp_stmt(s)
 \end{lstlisting}
 \fi}
+\end{tcolorbox}
+
 \caption{Interpreter for the \LangInt{} language.}
 \label{fig:interp_Lint}
 \end{figure}
@@ -1564,8 +1561,9 @@ arithmetic. Otherwise, they create an AST node for the arithmetic
 operation.
 
 \begin{figure}[tp]
-{\if\edition\racketEd
-\begin{lstlisting}[frame=single]
+  \begin{tcolorbox}[colback=white]
+    {\if\edition\racketEd
+\begin{lstlisting}
 (define (pe_neg r)
   (match r
     [(Int n) (Int (fx- 0 n))]
@@ -1595,7 +1593,7 @@ operation.
 \end{lstlisting}
 \fi}
 {\if\edition\pythonEd
-\begin{lstlisting}[frame=single]
+\begin{lstlisting}
 def pe_neg(r):
   match r:
     case Constant(n):
@@ -1644,6 +1642,7 @@ def pe_P_int(p):
       return Module(new_body)
 \end{lstlisting}
 \fi}
+\end{tcolorbox}
 \caption{A partial evaluator for \LangInt{}.}
 \label{fig:pe-arith}
 \end{figure}
@@ -1751,8 +1750,7 @@ exhibit several compilation techniques.
   
 \begin{figure}[tp]
 \centering
-\fbox{
-\begin{minipage}{0.96\textwidth}
+\begin{tcolorbox}[colback=white]
 {\if\edition\racketEd
 \[
 \begin{array}{l}
@@ -1775,16 +1773,14 @@ exhibit several compilation techniques.
 \end{array}
 \]
 \fi}
-\end{minipage}
-}
+\end{tcolorbox}
 \caption{The concrete syntax of \LangVar{}.}
 \label{fig:Lvar-concrete-syntax}
 \end{figure}
 
 \begin{figure}[tp]
 \centering
-\fbox{
-\begin{minipage}{0.96\textwidth}
+\begin{tcolorbox}[colback=white]
 {\if\edition\racketEd
 \[
 \begin{array}{l}
@@ -1807,8 +1803,7 @@ exhibit several compilation techniques.
 \end{array}
 \]
 \fi}
-\end{minipage}
-}
+\end{tcolorbox}
 \caption{The abstract syntax of \LangVar{}.}
 \label{fig:Lvar-syntax}
 \end{figure}
@@ -2159,8 +2154,9 @@ variable, it looks up the corresponding value in the dictionary.
   with the variable in the environment.}
 
 \begin{figure}[tp]
+\begin{tcolorbox}[colback=white]
 {\if\edition\racketEd
-\begin{lstlisting}[frame=single]
+\begin{lstlisting}
 (define interp-Lint-class
   (class object%
     (super-new)
@@ -2185,7 +2181,7 @@ variable, it looks up the corresponding value in the dictionary.
 \end{lstlisting}
 \fi}
 {\if\edition\pythonEd
-\begin{lstlisting}[frame=single]
+\begin{lstlisting}
 class InterpLint:
   def interp_exp(self, e, env):
     match e:
@@ -2220,13 +2216,15 @@ def interp_Lint(p):
   return InterpLint().interp(p)
 \end{lstlisting}
 \fi}
+\end{tcolorbox}
 \caption{Interpreter for \LangInt{} as a class.}
 \label{fig:interp-Lint-class}
 \end{figure}
 
 \begin{figure}[tp]
+\begin{tcolorbox}[colback=white]
 {\if\edition\racketEd
-\begin{lstlisting}[frame=single]
+\begin{lstlisting}
 (define interp-Lvar-class
   (class interp-Lint-class
     (super-new)
@@ -2245,7 +2243,7 @@ def interp_Lint(p):
 \end{lstlisting}
 \fi}
 {\if\edition\pythonEd
-\begin{lstlisting}[frame=single]
+\begin{lstlisting}
 class InterpLvar(InterpLint):
   def interp_exp(self, e, env):
     match e:
@@ -2268,6 +2266,7 @@ def interp_Lvar(p):
   return InterpLvar().interp(p)
 \end{lstlisting}
 \fi}
+\end{tcolorbox}
 \caption{Interpreter for the \LangVar{} language.}
 \label{fig:interp-Lvar}
 \end{figure}
@@ -2338,8 +2337,7 @@ integer constant (called an \emph{immediate value}\index{subject}{immediate
 }
 
 \begin{figure}[tp]
-\fbox{
-\begin{minipage}{0.96\textwidth}
+\begin{tcolorbox}[colback=white]
 {\if\edition\racketEd    
 \[
 \begin{array}{l}
@@ -2366,8 +2364,7 @@ integer constant (called an \emph{immediate value}\index{subject}{immediate
 \end{array}
 \]
 \fi}
-\end{minipage}
-}
+\end{tcolorbox}
 \caption{The syntax of the \LangXInt{} assembly language (AT\&T syntax).}
 \label{fig:x86-int-concrete}
 \end{figure}
@@ -2431,13 +2428,15 @@ errors.
 
 \begin{figure}[tbp]
 \begin{minipage}{0.45\textwidth}
-\begin{lstlisting}[frame=single]
+\begin{tcolorbox}[colback=white]
+\begin{lstlisting}
 	.globl main
 main:
 	movq	$10, %rax
 	addq	$32, %rax
 	retq
 \end{lstlisting}
+\end{tcolorbox}
 \end{minipage}
 
 \caption{An x86 program that computes
@@ -2473,8 +2472,9 @@ at $-16\key{(\%rbp)}$, etc.
 
 \begin{figure}[tbp]
   \begin{minipage}{0.66\textwidth}
-{\if\edition\racketEd
-\begin{lstlisting}[frame=single]
+    \begin{tcolorbox}[colback=white]
+      {\if\edition\racketEd
+\begin{lstlisting}
 start:
 	movq	$10, -8(%rbp)
 	negq	-8(%rbp)
@@ -2495,7 +2495,7 @@ conclusion:
 \end{lstlisting}
 \fi}
 {\if\edition\pythonEd
-\begin{lstlisting}[frame=single]
+\begin{lstlisting}
 	.globl main
 main:
 	pushq	%rbp
@@ -2510,7 +2510,8 @@ main:
 	retq
 \end{lstlisting}
 \fi}
-\end{minipage}
+  \end{tcolorbox}
+  \end{minipage}
   \caption{An x86 program that computes
   \racket{\code{(+ 52 (- 10))}}\python{52 + -10}.}
 \label{fig:p1-x86}
@@ -2638,11 +2639,10 @@ register allocation (Chapter~\ref{ch:register-allocation-Lvar}).
 }
 
 \begin{figure}[tp]
-\fbox{
-\begin{minipage}{0.94\textwidth}
+\begin{tcolorbox}[colback=white]
 \small
-{\if\edition\racketEd    
-\[
+{\if\edition\racketEd
+\[\arraycolsep=3pt
 \begin{array}{l}
   \ASTXIntRacket \\
 \begin{array}{lcl}
@@ -2667,8 +2667,7 @@ register allocation (Chapter~\ref{ch:register-allocation-Lvar}).
 \end{array}
 \]
 \fi}
-\end{minipage}
-}
+\end{tcolorbox}
 \caption{The abstract syntax of \LangXInt{} assembly.}
 \label{fig:x86-int-ast}
 \end{figure}
@@ -2818,8 +2817,7 @@ placing \key{select\_instructions} first, followed by the
 that uses a reserved register to fix outstanding problems.
 
 \begin{figure}[tbp]
-\fbox{
-\begin{minipage}{0.96\textwidth}    
+\begin{tcolorbox}[colback=white]
 {\if\edition\racketEd  
 \begin{tikzpicture}[baseline=(current  bounding  box.center),scale=0.95]
 \node (Lvar) at (0,2)  {\large \LangVar{}};
@@ -2859,8 +2857,7 @@ that uses a reserved register to fix outstanding problems.
 \path[->,bend right=15] (x86-3) edge [below] node {\ttfamily\footnotesize prelude\_and\_concl.} (x86-4);
 \end{tikzpicture}
 \fi}  
-\end{minipage}
-}
+\end{tcolorbox}
 \caption{Diagram of the passes for compiling \LangVar{}. }
 \label{fig:Lvar-passes}
 \end{figure}
@@ -2956,8 +2953,7 @@ variables are uninitialized; they become initialized on their first
 assignment.
 
 \begin{figure}[tbp]
-\fbox{
-\begin{minipage}{0.96\textwidth}
+\begin{tcolorbox}[colback=white]
 \[
 \begin{array}{l}
   \CvarGrammarRacket \\
@@ -2966,16 +2962,14 @@ assignment.
 \end{array}
 \end{array}
 \]
-\end{minipage}
-}
+\end{tcolorbox}
 \caption{The concrete syntax of the \LangCVar{} intermediate language.}
 \label{fig:c0-concrete-syntax}
 \end{figure}
 
 
 \begin{figure}[tbp]
-\fbox{
-\begin{minipage}{0.96\textwidth}
+\begin{tcolorbox}[colback=white]
 \[
 \begin{array}{l}
   \CvarASTRacket \\
@@ -2984,8 +2978,7 @@ assignment.
 \end{array}
 \end{array}
 \]
-\end{minipage}
-}
+\end{tcolorbox}
 \caption{The abstract syntax of the \LangCVar{} intermediate language.}
 \label{fig:c0-syntax}
 \end{figure}
@@ -3055,7 +3048,8 @@ form of Racket is useful for transforming the element of a list to
 produce a new list.\index{subject}{for/list}
 
 \begin{figure}[tbp]
-\begin{lstlisting}[frame=single]
+\begin{tcolorbox}[colback=white]
+\begin{lstlisting}
 (define (uniquify_exp env)
   (lambda (e)
     (match e
@@ -3069,6 +3063,7 @@ produce a new list.\index{subject}{for/list}
   (match p
     [(Program '() e) (Program '() ((uniquify_exp '()) e))]))
 \end{lstlisting}
+\end{tcolorbox}
 \caption{Skeleton for the \key{uniquify} pass.}
 \label{fig:uniquify-Lvar}
 \end{figure}
@@ -3179,8 +3174,7 @@ print(tmp_1)
 
 \begin{figure}[tp]
 \centering
-\fbox{
-\begin{minipage}{0.96\textwidth}
+\begin{tcolorbox}[colback=white]
 {\if\edition\racketEd
 \[
 \begin{array}{l}
@@ -3201,8 +3195,8 @@ print(tmp_1)
 \end{array}
 \]
 \fi}  
-\end{minipage}
-}
+\end{tcolorbox}
+
 \caption{\LangVarANF{} is \LangVar{} with operands restricted to
   atomic expressions.}
 \label{fig:Lvar-anf-syntax}
@@ -3467,7 +3461,8 @@ start:
 \end{transformation}
 
 \begin{figure}[tbp]
-\begin{lstlisting}[frame=single]
+\begin{tcolorbox}[colback=white]
+\begin{lstlisting}
 (define (explicate_tail e)
   (match e
     [(Var x) ___]
@@ -3488,6 +3483,7 @@ start:
   (match p
     [(Program info body) ___]))
 \end{lstlisting}
+\end{tcolorbox}
 \caption{Skeleton for the \code{explicate\_control} pass.}
 \label{fig:explicate-control-Lvar}
 \end{figure}
@@ -4053,6 +4049,7 @@ hand, is used only after this point, so \code{x} and \code{z} could
 share the same register.
 
 \begin{figure}
+\begin{tcolorbox}[colback=white]
 \begin{minipage}{0.45\textwidth}
 Example \LangVar{} program:
 % var_test_28.rkt
@@ -4080,7 +4077,7 @@ print(z + (- y))
 \begin{minipage}{0.45\textwidth}
 After instruction selection:
 {\if\edition\racketEd
-\begin{lstlisting}[frame=single]
+\begin{lstlisting}
 locals-types:
     x : Integer, y : Integer,
     z : Integer, t : Integer,
@@ -4101,7 +4098,7 @@ start:
 \end{lstlisting}
 \fi}
 {\if\edition\pythonEd
-\begin{lstlisting}[frame=single]
+\begin{lstlisting}
 movq $1, v
 movq $42, w
 movq v, x
@@ -4118,6 +4115,8 @@ callq print_int
 \end{lstlisting}
 \fi}
 \end{minipage}
+\end{tcolorbox}
+
 \caption{A running example for register allocation.}
 \label{fig:reg-eg}
 \end{figure}
@@ -4287,6 +4286,8 @@ conclusion, we see that \code{rbx} is restored from the stack with a
 \index{subject}{prelude}\index{subject}{conclusion}
 
 \begin{figure}[tp]
+\begin{tcolorbox}[colback=white]
+  
 \begin{minipage}{0.45\textwidth}
 Example \LangVar{} program:
 %var_test_14.rkt
@@ -4358,6 +4359,8 @@ main:
 \end{lstlisting}
 \fi}
 \end{minipage}
+\end{tcolorbox}
+
 \caption{An example with function calls.}
   \label{fig:example-calling-conventions}
 \end{figure}
@@ -4497,6 +4500,7 @@ Finally, the live-before for \code{movq \$5, a} is $\emptyset$
 because it writes to variable \code{a}.
 
 \begin{figure}[tbp]
+\begin{tcolorbox}[colback=white]
 \begin{minipage}{0.45\textwidth}
 \begin{lstlisting}[numbers=left,numberstyle=\tiny]
 movq $5, a
@@ -4521,6 +4525,7 @@ L_{\mathsf{before}}(5)=  \{\ttm{b},\ttm{c}\},
 L_{\mathsf{after}}(5)=  \emptyset
 \end{align*}
 \end{minipage}
+\end{tcolorbox}
 \caption{Example output of liveness analysis on a short example.}
 \label{fig:liveness-example-0}
 \end{figure}
@@ -4533,6 +4538,7 @@ L_{\mathsf{after}}(5)=  \emptyset
 \end{exercise}
 
 \begin{figure}[tp]
+\begin{tcolorbox}[colback=white]
 \hspace{20pt}
 \begin{minipage}{0.45\textwidth}
 {\if\edition\racketEd
@@ -4594,7 +4600,7 @@ L_{\mathsf{after}}(5)=  \emptyset
 \end{lstlisting}
 \fi}
 \end{minipage}
-
+\end{tcolorbox}
 \caption{The running example annotated with live-after sets.}
 \label{fig:live-eg}
 \end{figure}
@@ -4752,6 +4758,7 @@ shown in Figure~\ref{fig:interfere}.
 
 
 \begin{figure}[tbp]
+\begin{tcolorbox}[colback=white]
   \begin{quote}
 {\if\edition\racketEd    
 \begin{tabular}{ll}
@@ -4787,12 +4794,15 @@ shown in Figure~\ref{fig:interfere}.
 \end{tabular}
 \fi}
 \end{quote}
+\end{tcolorbox}
+
 \caption{Interference results for the running example.}
 \label{fig:interference-results}
 \end{figure}
 
 
 \begin{figure}[tbp]
+\begin{tcolorbox}[colback=white]
 \large
 {\if\edition\racketEd      
 \[
@@ -4846,6 +4856,7 @@ shown in Figure~\ref{fig:interfere}.
 \end{tikzpicture}
 \]
 \fi}
+\end{tcolorbox}
 \caption{The interference graph of the example program.}
 \label{fig:interfere}
 \end{figure}
@@ -4925,8 +4936,10 @@ sampling of the vertices (the colored ones) because showing edges for
 all of the vertices would make the graph unreadable.
 
 \begin{figure}[tbp]
+\begin{tcolorbox}[colback=white]
 \includegraphics[width=0.45\textwidth]{figs/sudoku}
 \includegraphics[width=0.5\textwidth]{figs/sudoku-graph-bw}
+\end{tcolorbox}
 \caption{A Sudoku game board and the corresponding colored graph.}
 \label{fig:sudoku-graph}
 \end{figure}
@@ -5002,6 +5015,7 @@ particular, we assign $-1$ to \code{rax} and $-2$ to \code{rsp}.
 
 
 \begin{figure}[btp]
+\begin{tcolorbox}[colback=white]
   \centering
 \begin{lstlisting}[basicstyle=\rmfamily,deletekeywords={for,from,with,is,not,in,find},morekeywords={while},columns=fullflexible]
 Algorithm: DSATUR
@@ -5016,7 +5030,8 @@ while |$W \neq \emptyset$| do
     |$\mathrm{color}[u] \gets c$|
     |$W \gets W - \{u\}$|
 \end{lstlisting}
-  \caption{The saturation-based greedy graph coloring algorithm.}
+\end{tcolorbox}
+\caption{The saturation-based greedy graph coloring algorithm.}
   \label{fig:satur-algo}
 \end{figure}
 
@@ -5755,6 +5770,7 @@ and \code{pushq} subtracts $8$ from the \code{rsp}.
 
 {\if\edition\racketEd      
 \begin{figure}[tbp]
+\begin{tcolorbox}[colback=white]
 \begin{tikzpicture}[baseline=(current  bounding  box.center)]
 \node (Lvar) at (0,2)  {\large \LangVar{}};
 \node (Lvar-2) at (3,2)  {\large \LangVar{}};
@@ -5773,12 +5789,14 @@ and \code{pushq} subtracts $8$ from the \code{rsp}.
 \path[->,bend left=15] (Lvar-2) edge [above] node {\ttfamily\footnotesize remove\_complex.} (Lvar-3);
 \path[->,bend left=15] (Lvar-3) edge [right] node {\ttfamily\footnotesize explicate\_control} (Cvar-1);
 \path[->,bend right=15] (Cvar-1) edge [left] node {\ttfamily\footnotesize select\_instr.} (x86-2);
-\path[->,bend left=15] (x86-2) edge [right] node {\ttfamily\footnotesize uncover\_live} (x86-2-1);
+\path[->,bend left=15] (x86-2) edge [left] node {\ttfamily\footnotesize uncover\_live} (x86-2-1);
 \path[->,bend right=15] (x86-2-1) edge [below] node {\ttfamily\footnotesize build\_inter.} (x86-2-2);
-\path[->,bend right=15] (x86-2-2) edge [right] node {\ttfamily\footnotesize allocate\_reg.} (x86-3);
+\path[->,bend right=15] (x86-2-2) edge [left] node {\ttfamily\footnotesize allocate\_reg.} (x86-3);
 \path[->,bend left=15] (x86-3) edge [above] node {\ttfamily\footnotesize patch\_instr.} (x86-4);
-\path[->,bend left=15] (x86-4) edge [right] node {\ttfamily\footnotesize prelude\_and\_concl.} (x86-5);
+\path[->,bend left=15] (x86-4) edge [left] node {\ttfamily\footnotesize prelude\_and\_concl.} (x86-5);
 \end{tikzpicture}
+\end{tcolorbox}
+
 \caption{Diagram of the passes for \LangVar{} with register allocation.}
 \label{fig:reg-alloc-passes}
 \end{figure}
@@ -5820,6 +5838,8 @@ done in the prelude. We move the stack pointer up by \code{8} bytes
 
   
 \begin{figure}[tbp]
+\begin{minipage}{0.55\textwidth}
+\begin{tcolorbox}[colback=white]
   % var_test_28.rkt
   % (use-minimal-set-of-registers! #t)
   % and only rbx rcx
@@ -5882,6 +5902,8 @@ main:
 	retq
 \end{lstlisting}
 \fi}
+\end{tcolorbox}
+\end{minipage}
 \caption{The x86 output from the running example
   (Figure~\ref{fig:reg-eg}), limiting allocation to just \code{rbx}
   and \code{rcx}.}
@@ -6677,8 +6699,7 @@ respectively. The \LangIf{} language includes all of
 
 \begin{figure}[tp]
 \centering
-\fbox{
-\begin{minipage}{0.96\textwidth}
+\begin{tcolorbox}[colback=white]
 {\if\edition\racketEd    
 \[
 \begin{array}{l}
@@ -6703,17 +6724,16 @@ respectively. The \LangIf{} language includes all of
 \end{array}
 \]
 \fi}
-\end{minipage}
-}
+\end{tcolorbox}
 \caption{The concrete syntax of \LangIf{}, extending \LangVar{}
   (Figure~\ref{fig:Lvar-concrete-syntax}) with Booleans and conditionals.}
 \label{fig:Lif-concrete-syntax}
 \end{figure}
 
 \begin{figure}[tp]
+\begin{minipage}{0.66\textwidth}
+\begin{tcolorbox}[colback=white]
 \centering
-\fbox{
-\begin{minipage}{0.96\textwidth}
 {\if\edition\racketEd    
 \[
 \begin{array}{l}
@@ -6738,8 +6758,8 @@ respectively. The \LangIf{} language includes all of
 \end{array}
 \]
 \fi}
+\end{tcolorbox}
 \end{minipage}
-}
 \caption{The abstract syntax of \LangIf{}.}
 \label{fig:Lif-syntax}
 \end{figure}
@@ -6770,6 +6790,7 @@ evaluated if $e_1$ evaluates to \TRUE{}.
   behavior.}
 
 \begin{figure}[tbp]
+\begin{tcolorbox}[colback=white]
 {\if\edition\racketEd    
 \begin{lstlisting}
 (define interp-Lif-class
@@ -6848,6 +6869,7 @@ class InterpLif(InterpLvar):
   ...      
 \end{lstlisting}
 \fi}
+\end{tcolorbox}
 \caption{Interpreter for the \LangIf{} language. \racket{(See
     Figure~\ref{fig:interp-op-Lif} for \code{interp-op}.)}
   \python{(See Figure~\ref{fig:interp-cmp-Lif} for \code{interp\_cmp}.)}}
@@ -6856,6 +6878,7 @@ class InterpLif(InterpLvar):
 
 {\if\edition\racketEd
 \begin{figure}[tbp]
+\begin{tcolorbox}[colback=white]    
 \begin{lstlisting}
 (define/public (interp_op op)
   (match op
@@ -6882,6 +6905,8 @@ class InterpLif(InterpLvar):
                   (>= v1 v2)]))]
     [else (error 'interp_op "unknown operator")]))
 \end{lstlisting}
+\end{tcolorbox}
+
 \caption{Interpreter for the primitive operators in the \LangIf{} language.}
 \label{fig:interp-op-Lif}
 \end{figure}
@@ -6889,6 +6914,7 @@ class InterpLif(InterpLvar):
 
 {\if\edition\pythonEd
 \begin{figure}
+\begin{tcolorbox}[colback=white]
 \begin{lstlisting}
 class InterpLif(InterpLvar):
   ...
@@ -6907,6 +6933,8 @@ class InterpLif(InterpLvar):
       case NotEq():
         return lambda x, y: x != y
 \end{lstlisting}
+\end{tcolorbox}
+
 \caption{Interpreter for the comparison operators in the \LangIf{} language.}
 \label{fig:interp-cmp-Lif}
 \end{figure}
@@ -7028,6 +7056,7 @@ Figure~\ref{fig:type-check-Lvar}.  The type of an integer constant is
   an error if the two types are not equal.}
 
 \begin{figure}[tbp]
+\begin{tcolorbox}[colback=white]
 {\if\edition\racketEd  
 \begin{lstlisting}[basicstyle=\ttfamily\footnotesize]
 (define type-check-Lvar-class
@@ -7133,11 +7162,13 @@ class TypeCheckLvar:
         self.type_check_stmts(body, {})
 \end{lstlisting}
 \fi}
+\end{tcolorbox}
 \caption{Type checker for the \LangVar{} language.}
 \label{fig:type-check-Lvar}
 \end{figure}
 
 \begin{figure}[tbp]
+\begin{tcolorbox}[colback=white]  
 {\if\edition\racketEd    
 \begin{lstlisting}[basicstyle=\ttfamily\footnotesize]
 (define type-check-Lif-class
@@ -7230,6 +7261,7 @@ class TypeCheckLif(TypeCheckLvar):
         return super().type_check_stmts(ss, env)
 \end{lstlisting}
 \fi}
+\end{tcolorbox}
 \caption{Type checker for the \LangIf{} language.}
 \label{fig:type-check-Lif}
 \end{figure}
@@ -7386,8 +7418,7 @@ in Figure~\ref{fig:c1-syntax}.
 }
   
 \begin{figure}[tbp]
-\fbox{
-\begin{minipage}{0.96\textwidth}
+\begin{tcolorbox}[colback=white]
 \small
 {\if\edition\racketEd      
 \[
@@ -7410,16 +7441,14 @@ in Figure~\ref{fig:c1-syntax}.
 \end{array}
 \]
 \fi}
-\end{minipage}
-}
+\end{tcolorbox}
 \caption{The concrete syntax of the \LangCIf{} intermediate language,
   an extension of \LangCVar{} (Figure~\ref{fig:c0-concrete-syntax}).}
 \label{fig:c1-concrete-syntax}
 \end{figure}
 
 \begin{figure}[tp]
-\fbox{
-\begin{minipage}{0.96\textwidth}
+\begin{tcolorbox}[colback=white]
 \small    
 {\if\edition\racketEd    
 \[
@@ -7442,8 +7471,7 @@ in Figure~\ref{fig:c1-syntax}.
 \end{array}
 \]
 \fi}
-\end{minipage}
-}
+\end{tcolorbox}
 \caption{The abstract syntax of \LangCIf{}\racket{, an extension of \LangCVar{}
   (Figure~\ref{fig:c0-syntax})}.}
 \label{fig:c1-syntax}
@@ -7510,8 +7538,7 @@ $\Atm$ to x86.
 
 
 \begin{figure}[tp]
-\fbox{
-\begin{minipage}{0.96\textwidth}
+\begin{tcolorbox}[colback=white]
 \[
 \begin{array}{l}
   \gray{\GrammarXInt} \\ \hline
@@ -7522,8 +7549,7 @@ $\Atm$ to x86.
 \end{array}
 \end{array}
 \]
-\end{minipage}
-}
+\end{tcolorbox}
 \caption{The concrete syntax of \LangXIf{}  (extends \LangXInt{} of Figure~\ref{fig:x86-int-concrete}).}
 \label{fig:x86-1-concrete}
 \end{figure}