Browse Source

removed the case in interp-exp for R2

Fred Fu 6 years ago
parent
commit
3493c46ba9
1 changed files with 9 additions and 10 deletions
  1. 9 10
      book.tex

+ 9 - 10
book.tex

@@ -543,7 +543,7 @@ The pattern is not the same thing as a quasiquote expression used to
 \emph{construct} ASTs, however, the similarity is intentional: constructing and
 \emph{construct} ASTs, however, the similarity is intentional: constructing and
 deconstructing ASTs uses similar syntax.
 deconstructing ASTs uses similar syntax.
 %
 %
-While the pattern uses a restricted syntax, 
+While the pattern uses a restricted syntax,
 the body of the match clause may contain any Racket code whatsoever.
 the body of the match clause may contain any Racket code whatsoever.
 
 
 
 
@@ -574,7 +574,7 @@ S-expression to see if it is a machine-representable integer.
 \vrule
 \vrule
 \begin{minipage}{0.25\textwidth}
 \begin{minipage}{0.25\textwidth}
   \begin{lstlisting}
   \begin{lstlisting}
-    
+
 
 
 
 
 
 
@@ -618,11 +618,11 @@ $R_0$ program.
     [`(- ,e) (exp? e)]
     [`(- ,e) (exp? e)]
     [`(+ ,e1 ,e2)
     [`(+ ,e1 ,e2)
       (and (exp? e1) (exp? e2))]
       (and (exp? e1) (exp? e2))]
-    [else #f]))  
+    [else #f]))
 
 
 (define (R0? sexp)
 (define (R0? sexp)
   (match sexp
   (match sexp
-    [`(program ,e) (exp? e)]    
+    [`(program ,e) (exp? e)]
     [else #f]))
     [else #f]))
 
 
 (R0? `(program (+ (read) (- 8))))
 (R0? `(program (+ (read) (- 8))))
@@ -638,7 +638,7 @@ $R_0$ program.
 
 
 
 
 
 
-  
+
 
 
 
 
 
 
@@ -1035,7 +1035,7 @@ to the variable, then evaluates the body of the \key{let}.
           (fx- 0 v)]
           (fx- 0 v)]
          [`(+ ,(app (interp-exp env) v1) ,(app (interp-exp env) v2))
          [`(+ ,(app (interp-exp env) v1) ,(app (interp-exp env) v2))
            (fx+ v1 v2)])))
            (fx+ v1 v2)])))
-           
+
    (define (interp-R1 env)
    (define (interp-R1 env)
      (lambda (p)
      (lambda (p)
        (match p
        (match p
@@ -1237,7 +1237,7 @@ main:
 	addq	-8(%rbp), %rax
 	addq	-8(%rbp), %rax
 	movq	%rax, %rdi
 	movq	%rax, %rdi
 	callq	print_int
 	callq	print_int
-        
+
 	addq	$16, %rsp
 	addq	$16, %rsp
 	movq    $0, %rax
 	movq    $0, %rax
 	popq	%rbp
 	popq	%rbp
@@ -1319,7 +1319,7 @@ next. )
              (\key{subq} \; \Arg\; \Arg) \mid
              (\key{subq} \; \Arg\; \Arg) \mid
              (\key{movq} \; \Arg\; \Arg) \mid
              (\key{movq} \; \Arg\; \Arg) \mid
              (\key{retq})\\
              (\key{retq})\\
-      &\mid& (\key{negq} \; \Arg) \mid 
+      &\mid& (\key{negq} \; \Arg) \mid
              (\key{callq} \; \mathit{label}) \mid
              (\key{callq} \; \mathit{label}) \mid
              (\key{pushq}\;\Arg) \mid
              (\key{pushq}\;\Arg) \mid
              (\key{popq}\;\Arg) \\
              (\key{popq}\;\Arg) \\
@@ -3235,7 +3235,6 @@ the order of evaluation of its arguments.
           (match cnd
           (match cnd
             [#t (recur thn)]
             [#t (recur thn)]
             [#f (recur els)])]
             [#f (recur els)])]
-         [`(not ,(app recur v)) (match v [#t #f] [#f #t])]
          [`(and ,(app recur v1) ,e2)
          [`(and ,(app recur v1) ,e2)
           (match v1
           (match v1
             [#t (match (recur e2) [#t #t] [#f #f])]
             [#t (match (recur e2) [#t #t] [#f #f])]
@@ -5005,7 +5004,7 @@ needs to be followed. Thus, we zero-out all locations on the root
 stack in the prelude of \code{main}. In
 stack in the prelude of \code{main}. In
 Figure~\ref{fig:print-x86-output-gc}, the instruction
 Figure~\ref{fig:print-x86-output-gc}, the instruction
 %
 %
-\lstinline{movq $0, (%r15)} 
+\lstinline{movq $0, (%r15)}
 %
 %
 accomplishes this task. The garbage collector tests each root to see
 accomplishes this task. The garbage collector tests each root to see
 if it is null prior to dereferencing it.
 if it is null prior to dereferencing it.