Explorar el Código

fix unaryop for Not, layout tweaks

Jeremy G. Siek hace 2 años
padre
commit
104926d05a
Se han modificado 1 ficheros con 18 adiciones y 9 borrados
  1. 18 9
      book.tex

+ 18 - 9
book.tex

@@ -7791,12 +7791,14 @@ operators to include
 \newcommand{\LifASTPython}{
 \begin{array}{lcl}
 \itm{boolop} &::=& \code{And()} \MID \code{Or()} \\
-\itm{unaryop} &::=& \code{Not()} \\
+%\itm{unaryop} &::=& \code{Not()} \\
 \itm{cmp} &::= & \code{Eq()} \MID \code{NotEq()} \MID \code{Lt()} \MID \code{LtE()} \MID \code{Gt()} \MID \code{GtE()} \\
 \itm{bool} &::=& \code{True} \MID \code{False} \\
 \Exp &::=& \BOOL{\itm{bool}} 
-     \MID \BOOLOP{\itm{boolop}}{\Exp}{\Exp}\\
-     &\MID& \CMP{\Exp}{\itm{cmp}}{\Exp}  \MID \IF{\Exp}{\Exp}{\Exp} \\
+      \MID \BOOLOP{\itm{boolop}}{\Exp}{\Exp}\\
+      &\MID& \UNIOP{\key{Not()}}{\Exp}
+      \MID \CMP{\Exp}{\itm{cmp}}{\Exp} \\
+      &\MID& \IF{\Exp}{\Exp}{\Exp} \\
 \Stmt{} &::=& \IFSTMT{\Exp}{\Stmt^{+}}{\Stmt^{+}}
 \end{array}
 }
@@ -8892,8 +8894,10 @@ upcoming \code{explicate\_control} pass.
 \newcommand{\LifMonadASTPython}{
 \begin{array}{rcl}
 \Atm &::=& \BOOL{\itm{bool}}\\
-\Exp &::=& \CMP{\Atm}{\itm{cmp}}{\Atm} \MID \IF{\Exp}{\Exp}{\Exp} \\
-  &\MID& \BEGIN{\Stmt^{*}}{\Exp}\\
+\Exp &::=& \UNIOP{\key{Not()}}{\Exp}
+           \MID \CMP{\Atm}{\itm{cmp}}{\Atm} \\
+   &\MID& \IF{\Exp}{\Exp}{\Exp} 
+    \MID \BEGIN{\Stmt^{*}}{\Exp}\\
 \Stmt{} &::=& \IFSTMT{\Exp}{\Stmt^{*}}{\Stmt^{*}}
 \end{array}
 }
@@ -20344,9 +20348,10 @@ next two sections.
   \end{array}
 }  
   
-\begin{figure}[tp]
+\begin{figure}[tbp]
 \centering
 \begin{tcolorbox}[colback=white]
+  \vspace{-5pt}
     \small
 {\if\edition\racketEd    
 \[
@@ -20384,7 +20389,7 @@ next two sections.
 \label{fig:Lgrad-concrete-syntax}
 \end{figure}
 
-\begin{figure}[tp]
+\begin{figure}[tbp]
 \centering
 \begin{tcolorbox}[colback=white]
     \small
@@ -20460,7 +20465,7 @@ but parameter \code{f} of \code{map} has type
 The type checker for \LangGrad{} accepts this call because the two types are
 consistent.
 
-\begin{figure}[btp]
+\begin{figure}[hbtp]
 % gradual_test_9.rkt
   \begin{tcolorbox}[colback=white]
 {\if\edition\racketEd
@@ -20780,6 +20785,8 @@ def type_check_stmts(self, ss, env, return_type):
 \label{fig:type-check-Lgradual-3}
 \end{figure}
 
+\clearpage
+
 \begin{figure}[tbp]
 \begin{tcolorbox}[colback=white]  
 \begin{lstlisting}
@@ -21026,7 +21033,7 @@ def check_consistent(self, t1, t2, e):
 
 \fi}
 
-\clearpage
+
 
 \section{Interpreting \LangCast{} \vspace{-2pt}}
 \label{sec:interp-casts}
@@ -21674,6 +21681,7 @@ def main() -> int:
 \label{fig:map-lower-cast}
 \end{figure}
 
+%\pagebreak
 
 \section{Differentiate Proxies \vspace{-2pt}}
 \label{sec:differentiate-proxies}
@@ -21951,6 +21959,7 @@ decimal), just like the tuple and array types.
 %
 Otherwise, the only other changes are adding cases that copy the new AST nodes.
 
+\pagebreak
 
 \section{Closure Conversion \vspace{-2pt}}
 \label{sec:closure-conversion-gradual}