Browse Source

fixed bug in R0?

Jeremy Siek 6 years ago
parent
commit
0406840c3a
1 changed files with 8 additions and 3 deletions
  1. 8 3
      book.tex

+ 8 - 3
book.tex

@@ -617,15 +617,16 @@ $R_0$ program.
     [`(read) #t]
     [`(- ,e) (exp? e)]
     [`(+ ,e1 ,e2)
-     (and (exp? e1) (exp? e2))]))  
+      (and (exp? e1) (exp? e2))]
+    [else #f]))  
 
 (define (R0? sexp)
   (match sexp
     [`(program ,e) (exp? e)]    
     [else #f]))
 
-(R0? `(+ (read) (- 8)))
-(R0? `(- (read) (+ 8)))
+(R0? `(program (+ (read) (- 8))))
+(R0? `(program (- (read) (+ 8))))
 \end{lstlisting}
 \end{minipage}
 \vrule
@@ -633,6 +634,10 @@ $R_0$ program.
 \begin{lstlisting}
 
 
+
+
+
+