diff --git a/.kakrc b/.kakrc new file mode 100644 index 0000000..4269aef --- /dev/null +++ b/.kakrc @@ -0,0 +1,9 @@ +hook -once -group eoc global KakBegin .* %{ + repl-buffer-new racket -i + repl-buffer-send-text "(require xrepl) +" +%} + +define-command xrepl-enter %{ + repl-buffer-send-text ",en %val{buffile}" +} diff --git a/README.md b/README.md index 1999c17..f0f601a 100644 --- a/README.md +++ b/README.md @@ -4,3 +4,5 @@ Tracking the [Essentials of Compilation](https://jeapostrophe.github.io/courses/ Requires `racket`. The compiler emits aarch64 assembly; I use the aarch64 linux cross-compiler and qemu to run them. + +## Runnin tests diff --git a/all-tests.rkt b/all-tests.rkt new file mode 100644 index 0000000..c146b87 --- /dev/null +++ b/all-tests.rkt @@ -0,0 +1,28 @@ +#lang racket + +(provide all-tests) + +(require rackunit) +(require "lint/test-lint.rkt") +(require "lvar/test-lvar.rkt") +(require "lvar/test-cvar.rkt") +(require "lvar/test-uniquify.rkt") +(require "lvar/test-remove-complex-opera.rkt") +;(require "test-explicate-control.rkt") +(require "lvar/test-cvar-to-bril.rkt") +;(require "test-select-instr.rkt") +;(require "test-allocate-regs.rkt") + +(define all-tests + (test-suite + "All tests" + lint-tests + lvar-tests + cvar-tests + uniquify-tests + remove-complex-opera-tests + ;explicate-control-tests + cvar-to-bril-tests)) + ;select-instr-tests + ;allocate-regs-tests)) + diff --git a/lint.rkt b/lint/lint.rkt similarity index 100% rename from lint.rkt rename to lint/lint.rkt diff --git a/tests/test-lint.rkt b/lint/test-lint.rkt similarity index 91% rename from tests/test-lint.rkt rename to lint/test-lint.rkt index d08f372..4dac7b6 100644 --- a/tests/test-lint.rkt +++ b/lint/test-lint.rkt @@ -3,8 +3,8 @@ (provide lint-tests) (require rackunit) -(require "test-util.rkt") -(require "../lint.rkt") +(require "../test-util.rkt") +(require "lint.rkt") (define eight (Int 8)) (define rd (Prim 'read '())) diff --git a/cvar-to-bril.rkt b/lvar/cvar-to-bril.rkt similarity index 84% rename from cvar-to-bril.rkt rename to lvar/cvar-to-bril.rkt index 1fbfc2b..b1ce8ba 100644 --- a/cvar-to-bril.rkt +++ b/lvar/cvar-to-bril.rkt @@ -36,20 +36,20 @@ (define (generate-bril-instrs dest expr) (match expr [(Int n) - (list (bril:ConstantInstr dest (bril:Type 'int) n))] + (list (bril:ConstantInstr dest 'int n))] [(Prim '+ (list (Var v1) (Var v2))) - (list (bril:ValueInstr 'add dest (bril:Type 'int) + (list (bril:ValueInstr 'add dest 'int (list (symbol->string v1) (symbol->string v2)) '() '()))] [(Prim '- (list (Var v1))) - (list (bril:ConstantInstr dest (bril:Type 'int) 0) - (bril:ValueInstr 'sub dest (bril:Type 'int) + (list (bril:ConstantInstr dest 'int 0) + (bril:ValueInstr 'sub dest 'int (list dest (symbol->string v1)) '() '()))] [(Prim '- (list (Var v1) (Var v2))) - (list (bril:ValueInstr 'sub dest (bril:Type 'int) + (list (bril:ValueInstr 'sub dest 'int (list (symbol->string v1) (symbol->string v2)) '() '()))])) diff --git a/cvar.rkt b/lvar/cvar.rkt similarity index 95% rename from cvar.rkt rename to lvar/cvar.rkt index 9638f74..5596ed1 100644 --- a/cvar.rkt +++ b/lvar/cvar.rkt @@ -2,7 +2,7 @@ (provide Int Prim Var Var-name Assign Seq Return CProgram interp-CVar% interp-CVar) -(require "rvar.rkt") +(require "lvar.rkt") (require racket/dict) (require racket/struct) @@ -13,7 +13,7 @@ (struct Return (exp) #:transparent) (define interp-CVar% - (class interp-RVar-class + (class interp-LVar-class (super-new) (define/public ((interp-stmt env) stmt) diff --git a/explicate-control.rkt b/lvar/explicate-control.rkt similarity index 97% rename from explicate-control.rkt rename to lvar/explicate-control.rkt index 2f98c1f..b78cd3a 100644 --- a/explicate-control.rkt +++ b/lvar/explicate-control.rkt @@ -3,7 +3,7 @@ (provide explicate-control) (require racket/fixnum) -(require "rvar.rkt") +(require "lvar.rkt") (require "cvar.rkt") (define (explicate-control program) diff --git a/rvar.rkt b/lvar/lvar.rkt similarity index 87% rename from rvar.rkt rename to lvar/lvar.rkt index f837169..21f9c9a 100644 --- a/rvar.rkt +++ b/lvar/lvar.rkt @@ -1,6 +1,6 @@ #lang racket -(provide Int Prim Var Var-name Let Program interp-RVar-class interp-RVar) +(provide Int Prim Var Var-name Let Program interp-LVar-class interp-LVar) (require racket/fixnum) (require racket/dict) @@ -13,7 +13,7 @@ (struct Program (info body) #:transparent) -(define interp-RVar-class +(define interp-LVar-class (class object% (super-new) @@ -44,5 +44,5 @@ (dict-ref env s) (error "Symbol " s " not found"))) -(define (interp-RVar program) - (send (new interp-RVar-class) interp-program program)) +(define (interp-LVar program) + (send (new interp-LVar-class) interp-program program)) diff --git a/print-rvar-to-bril.rkt b/lvar/print-lvar-to-bril.rkt similarity index 100% rename from print-rvar-to-bril.rkt rename to lvar/print-lvar-to-bril.rkt diff --git a/remove-complex-oper.rkt b/lvar/remove-complex-oper.rkt similarity index 99% rename from remove-complex-oper.rkt rename to lvar/remove-complex-oper.rkt index 0a0bab2..c2bfc2a 100644 --- a/remove-complex-oper.rkt +++ b/lvar/remove-complex-oper.rkt @@ -3,7 +3,7 @@ ; converts the program in monadic normal form (provide remove-complex-opera* remove-complex-opera*-2) -(require "rvar.rkt") +(require "lvar.rkt") ; find number of the last variable named tmp.n (define (find-tmp-last p) diff --git a/tests/test-cvar-to-bril.rkt b/lvar/test-cvar-to-bril.rkt similarity index 77% rename from tests/test-cvar-to-bril.rkt rename to lvar/test-cvar-to-bril.rkt index 720f946..5939bbf 100644 --- a/tests/test-cvar-to-bril.rkt +++ b/lvar/test-cvar-to-bril.rkt @@ -3,11 +3,11 @@ (provide cvar-to-bril-tests) (require rackunit) -(require "../cvar-to-bril.rkt") -(require "../uniquify.rkt") -(require "../remove-complex-oper.rkt") -(require "../explicate-control.rkt") -(require "../rvar.rkt") +(require "cvar-to-bril.rkt") +(require "uniquify.rkt") +(require "remove-complex-oper.rkt") +(require "explicate-control.rkt") +(require "lvar.rkt") (require bril/interpreter) (define listings @@ -27,5 +27,5 @@ "CVar to bril testsuite" (test-case "semantics preservation under interpretation" (for ([program listings]) - (check-equal? (interp-RVar program) + (check-equal? (interp-LVar program) (evaluate-bril-main (pass program))))))) diff --git a/tests/test-cvar.rkt b/lvar/test-cvar.rkt similarity index 95% rename from tests/test-cvar.rkt rename to lvar/test-cvar.rkt index 488408a..e3efdf6 100644 --- a/tests/test-cvar.rkt +++ b/lvar/test-cvar.rkt @@ -3,8 +3,8 @@ (provide cvar-tests) (require rackunit) -(require "test-util.rkt") -(require "../cvar.rkt") +(require "../test-util.rkt") +(require "cvar.rkt") (define seq-1 (Return (Int 0))) diff --git a/tests/test-explicate-control.rkt b/lvar/test-explicate-control.rkt similarity index 99% rename from tests/test-explicate-control.rkt rename to lvar/test-explicate-control.rkt index c555290..ad3222f 100644 --- a/tests/test-explicate-control.rkt +++ b/lvar/test-explicate-control.rkt @@ -4,7 +4,7 @@ (require "uniquify.rkt") (require "remove-complex-oper.rkt") (require "explicate-control.rkt") -(require "rvar.rkt") +(require "lvar.rkt") (require "cvar.rkt") (define programs diff --git a/tests/test-rvar.rkt b/lvar/test-lvar.rkt similarity index 84% rename from tests/test-rvar.rkt rename to lvar/test-lvar.rkt index 2565b40..f00988d 100644 --- a/tests/test-rvar.rkt +++ b/lvar/test-lvar.rkt @@ -1,16 +1,16 @@ #lang racket -(provide rvar-tests) +(provide lvar-tests) (require rackunit) -(require "../rvar.rkt") +(require "lvar.rkt") (define (interp-exp env e) - ((send (new interp-RVar-class) interp-exp env) e)) + ((send (new interp-LVar-class) interp-exp env) e)) -(define rvar-tests +(define lvar-tests (test-suite - "RVar interpretation testsuite" + "LVar interpretation testsuite" (check-equal? (let ([env `((a . 1) (b . 2))]) @@ -44,7 +44,7 @@ 6) (check-equal? - (interp-RVar (Program `() (Let 'a + (interp-LVar (Program `() (Let 'a (Prim '+ (list (Int 1) (Int 2))) (Prim '+ (list (Var 'a) (Int 3)))))) 6))) diff --git a/lvar/test-remove-complex-opera.rkt b/lvar/test-remove-complex-opera.rkt new file mode 100644 index 0000000..5cd9f69 --- /dev/null +++ b/lvar/test-remove-complex-opera.rkt @@ -0,0 +1,136 @@ +#lang racket + +(provide remove-complex-opera-tests) + +(require rackunit) +(require "../test-util.rkt") +(require "uniquify.rkt") +(require "remove-complex-oper.rkt") +(require/expose "remove-complex-oper.rkt" (find-tmp-last rco-exp rco-arg)) +(require "lvar.rkt") + +(define (pass p) + (remove-complex-opera* (uniquify p))) + +(define (pass-2 p) + (remove-complex-opera*-2 (uniquify p))) + +(define programs + (list + (Program '() + (Prim '- (list (Int 20)))) + (Program '() + (Prim '- (list (Prim '- (list (Int 20)))))) + (Program '() + (Prim '- (list (Prim '- (list (Prim '- (list (Int 20)))))))) + (Program '() (Prim '+ (list (Int 3) (Prim '- (list (Int 20)))))) + (Program '() + (Prim '+ (list (Prim '+ (list (Int 3) (Int 2))) + (Prim '+ (list (Int 4) (Int 5)))))) + (Program '() (Let 'x (Int 1) (Var 'x))) + (Program '() (Let 'x (Prim '+ (list (Prim '- (list (Int 2))) + (Int 3))) + (Prim '+ (list (Var 'x) + (Prim '+ (list (Int 2) (Int 3))))))) + (Program '() (Prim '+ + (list (Let 'x + (Prim '+ + (list (Prim '- (list (Int 1))) + (Int 2))) + (Prim '+ (list (Var 'x) (Int 2)))) + (Prim '+ (list (Int 4) (Int 5)))))) + (Program '() + (Let 'a (Int 42) + (Let 'b (Var 'a) + (Var 'b)))) + (Program '() (Let 'tmp (Prim '- (list (Int 1))) (Var 'tmp))) + (Program '() (Prim '- + (list (Let 'x (Int 1) (Var 'x))))) + (Program '() (Let 'x (Let 'x (Int 1) (Var 'x)) (Prim '+ (list (Int 2) (Var 'x))))) + (Program '() + (Let 'y (Let 'x (Int 20) + (Prim '+ (list (Var 'x) + (Let 'x (Int 22) (Var 'x))))) + (Var 'y))) + (Program '() ; - pos 13 + (Prim '+ (list (Prim 'read '()) + (Prim 'read '())))) + + (Program '() + (Prim '+ (list (Let 'x (Int 1) + (Let 'x (Int 2) + (Int 2))) + (Let 'x (Int 2) + (Var 'x))))))) + +(define inputs + (let ([empty-inputs (build-list (length programs) (lambda (_) '()))]) + (list-set empty-inputs 13 '(2 3)))) + +(define remove-complex-opera-tests + (test-suite + "Remove Complex Opera* Testsuite" + (test-case + "find-tmp-last" + (check-equal? + (find-tmp-last (Program '() + (Let 'tmp.0 (Let 'x (Int 20) + (Prim '+ (list (Var 'x) + (Let 'tmp.1 (Int 22) + (Var 'tmp.1))))) + (Var 'tmp.0)))) + 1) + (check-equal? + (find-tmp-last (Program '() + (Let 'tmp.x (Let 'x (Int 20) + (Prim '+ (list (Var 'x) + (Let 'tmp.y (Int 22) + (Var 'tmp.y))))) + (Var 'tmp.x)))) + -1) + (test-case + "rco-arg" + (let-values ([(a b c) (rco-arg (Prim '- (list (Int 20))) -1)]) + (check-equal? a (Var 'tmp.0)))) + (test-case + "remove-complex-opera*-2" + (check-equal? + (pass-2 (Program '() (Int 20))) + (Program '() (Let 'tmp.0 (Int 20) (Var 'tmp.0)))) + (check-equal? + (pass-2 (Program '() (Let 'x (Int 20) (Var 'x)))) + (Program '() (Let 'x.1 (Int 20) (Var 'x.1)))) + (check-equal? + (pass-2 (Program '() (Let 'x (Int 20) (Int 40)))) + (Program '() (Let 'x.1 (Int 20) (Let 'tmp.0 (Int 40) (Var 'tmp.0))))) + (check-equal? + (pass-2 (Program '() (Let 'x (Int 20) (Let 'y (Int 40) (Prim '+ (list (Var 'y) (Int 1))))))) + (Program '() (Let 'x.1 (Int 20) + (Let 'y.1 (Int 40) + (Let 'tmp.0 (Int 1) + (Let 'tmp.1 (Prim '+ (list (Var 'y.1) (Var 'tmp.0))) + (Var 'tmp.1))))))) + (check-equal? + (pass-2 (Program '() (Let 'x (Let 'y (Int 40) (Prim '+ (list (Var 'y) (Int 1)))) (Var 'x)))) + (Program '() (Let 'x.1 (Let 'y.1 (Int 40) + (Let 'tmp.0 (Int 1) + (Prim '+ (list (Var 'y.1) (Var 'tmp.0))))) + (Var 'x.1)))) + (check-equal? + (pass-2 (list-ref programs 0)) + (Program '() (Let 'tmp.0 (Int 20) (Let 'tmp.1 (Prim '- (list (Var 'tmp.0))) (Var 'tmp.1)))))) + + (test-case + "interpretation after pass" + (begin + (for ([program programs] + [input-list inputs]) + (begin + (check-equal? (with-input-from-num-list input-list + (lambda () (interp-LVar program))) + (with-input-from-num-list input-list + (lambda () (interp-LVar (pass program))))) + (check-equal? (with-input-from-num-list input-list + (lambda () (interp-LVar program))) + (with-input-from-num-list input-list + (lambda () (interp-LVar (pass-2 program)))))))))))) diff --git a/tests/test-uniquify.rkt b/lvar/test-uniquify.rkt similarity index 93% rename from tests/test-uniquify.rkt rename to lvar/test-uniquify.rkt index a348eb1..cfd5460 100644 --- a/tests/test-uniquify.rkt +++ b/lvar/test-uniquify.rkt @@ -4,9 +4,9 @@ (require rackunit) -(require "../rvar.rkt") -(require "../uniquify.rkt") -(require/expose "../uniquify.rkt" (uniquify-exp)) +(require "lvar.rkt") +(require "uniquify.rkt") +(require/expose "uniquify.rkt" (uniquify-exp)) ; returns both the resulting symtable and the uniquified program (define (list-uniquify-exp symtable) @@ -90,5 +90,5 @@ (test-case "Uniquify interpretation" (for ([program (list p1 p2)]) - (check-equal? (interp-RVar program) - (interp-RVar (uniquify program))))))) + (check-equal? (interp-LVar program) + (interp-LVar (uniquify program))))))) diff --git a/uniquify.rkt b/lvar/uniquify.rkt similarity index 99% rename from uniquify.rkt rename to lvar/uniquify.rkt index cdd7f91..d12f071 100644 --- a/uniquify.rkt +++ b/lvar/uniquify.rkt @@ -2,7 +2,7 @@ (provide uniquify) -(require "rvar.rkt") +(require "lvar.rkt") (define (uniquify p) (let-values ([(_ res) (uniquify-ret-symtable p)]) diff --git a/aarch64-hello.s b/old/aarch64-hello.s similarity index 100% rename from aarch64-hello.s rename to old/aarch64-hello.s diff --git a/aarch64var.rkt b/old/aarch64var.rkt similarity index 100% rename from aarch64var.rkt rename to old/aarch64var.rkt diff --git a/allocate-regs.rkt b/old/allocate-regs.rkt similarity index 100% rename from allocate-regs.rkt rename to old/allocate-regs.rkt diff --git a/c1.rkt b/old/c1.rkt similarity index 100% rename from c1.rkt rename to old/c1.rkt diff --git a/old/compile-aarch64-asm.rkt b/old/compile-aarch64-asm.rkt new file mode 100644 index 0000000..e69de29 diff --git a/old/emit-aarch64-asm.rkt b/old/emit-aarch64-asm.rkt new file mode 100644 index 0000000..e69de29 diff --git a/runtime.s b/old/runtime.s similarity index 100% rename from runtime.s rename to old/runtime.s diff --git a/select-instr.rkt b/old/select-instr.rkt similarity index 100% rename from select-instr.rkt rename to old/select-instr.rkt diff --git a/run-all-tests.rkt b/run-all-tests.rkt index f3186cd..0241cf0 100644 --- a/run-all-tests.rkt +++ b/run-all-tests.rkt @@ -1,9 +1,9 @@ #lang racket (require rackunit rackunit/text-ui) -(require "tests/all-tests.rkt") -(require "complete-tests.rkt") +(require "all-tests.rkt") +;(require "complete-tests.rkt") (run-tests all-tests) -(run-tests complete-tests) +;(run-tests complete-tests) diff --git a/tests/test-util.rkt b/test-util.rkt similarity index 100% rename from tests/test-util.rkt rename to test-util.rkt diff --git a/tests/all-tests.rkt b/tests/all-tests.rkt deleted file mode 100644 index f87172e..0000000 --- a/tests/all-tests.rkt +++ /dev/null @@ -1,28 +0,0 @@ -#lang racket - -(provide all-tests) - -(require rackunit) -(require "test-lint.rkt") -(require "test-rvar.rkt") -(require "test-cvar.rkt") -(require "test-uniquify.rkt") -;(require "test-remove-complex-opera.rkt") -;(require "test-explicate-control.rkt") -(require "test-cvar-to-bril.rkt") -(require "test-select-instr.rkt") -(require "test-allocate-regs.rkt") - -(define all-tests - (test-suite - "All tests" - lint-tests - rvar-tests - cvar-tests - uniquify-tests - ;remove-complex-opera-tests - ;explicate-control-tests - cvar-to-bril-tests - select-instr-tests - allocate-regs-tests)) - diff --git a/tests/test-remove-complex-opera.rkt b/tests/test-remove-complex-opera.rkt deleted file mode 100644 index 0ddac7e..0000000 --- a/tests/test-remove-complex-opera.rkt +++ /dev/null @@ -1,131 +0,0 @@ -#lang racket - -(provide remove-complex-opera-tests) - -(require rackunit) -(require "test-util.rkt") -(require "uniquify.rkt") -(require "remove-complex-oper.rkt") -(require/expose "remove-complex-oper.rkt" (find-tmp-last rco-exp rco-arg)) -(require "rvar.rkt") - -(test-eq - (find-tmp-last (Program '() - (Let 'tmp.0 (Let 'x (Int 20) - (Prim '+ (list (Var 'x) - (Let 'tmp.1 (Int 22) - (Var 'tmp.1))))) - (Var 'tmp.0)))) - 1) - -(test-eq - (find-tmp-last (Program '() - (Let 'tmp.x (Let 'x (Int 20) - (Prim '+ (list (Var 'x) - (Let 'tmp.y (Int 22) - (Var 'tmp.y))))) - (Var 'tmp.x)))) - -1) - -(define programs - (list - (Program '() - (Prim '- (list (Int 20)))) - (Program '() - (Prim '- (list (Prim '- (list (Int 20)))))) - (Program '() - (Prim '- (list (Prim '- (list (Prim '- (list (Int 20)))))))) - (Program '() (Prim '+ (list (Int 3) (Prim '- (list (Int 20)))))) - (Program '() - (Prim '+ (list (Prim '+ (list (Int 3) (Int 2))) - (Prim '+ (list (Int 4) (Int 5)))))) - (Program '() (Let 'x (Int 1) (Var 'x))) - (Program '() (Let 'x (Prim '+ (list (Prim '- (list (Int 2))) - (Int 3))) - (Prim '+ (list (Var 'x) - (Prim '+ (list (Int 2) (Int 3))))))) - (Program '() (Prim '+ - (list (Let 'x - (Prim '+ - (list (Prim '- (list (Int 1))) - (Int 2))) - (Prim '+ (list (Var 'x) (Int 2)))) - (Prim '+ (list (Int 4) (Int 5)))))) - (Program '() - (Let 'a (Int 42) - (Let 'b (Var 'a) - (Var 'b)))) - (Program '() (Let 'tmp (Prim '- (list (Int 1))) (Var 'tmp))) - (Program '() (Prim '- - (list (Let 'x (Int 1) (Var 'x))))) - (Program '() (Let 'x (Let 'x (Int 1) (Var 'x)) (Prim '+ (list (Int 2) (Var 'x))))) - (Program '() - (Let 'y (Let 'x (Int 20) - (Prim '+ (list (Var 'x) - (Let 'x (Int 22) (Var 'x))))) - (Var 'y))) - (Program '() ; - pos 13 - (Prim '+ (list (Prim 'read '()) - (Prim 'read '())))) - - (Program '() - (Prim '+ (list (Let 'x (Int 1) - (Let 'x (Int 2) - (Int 2))) - (Let 'x (Int 2) - (Var 'x))))))) - -(begin - (define-values (a b c) (rco-arg (Prim '- (list (Int 20))) -1)) - (test-eq a (Var 'tmp.0))) - -(define (pass p) - (remove-complex-opera* (uniquify p))) - -(define (pass-2 p) - (remove-complex-opera*-2 (uniquify p))) - -(test-eq - (pass-2 (Program '() (Int 20))) - (Program '() (Let 'tmp.0 (Int 20) (Var 'tmp.0)))) - -(test-eq - (pass-2 (Program '() (Let 'x (Int 20) (Var 'x)))) - (Program '() (Let 'x.1 (Int 20) (Var 'x.1)))) - -(test-eq - (pass-2 (Program '() (Let 'x (Int 20) (Int 40)))) - (Program '() (Let 'x.1 (Int 20) (Let 'tmp.0 (Int 40) (Var 'tmp.0))))) - -(test-eq - (pass-2 (Program '() (Let 'x (Int 20) (Let 'y (Int 40) (Prim '+ (list (Var 'y) (Int 1))))))) - (Program '() (Let 'x.1 (Int 20) - (Let 'y.1 (Int 40) - (Let 'tmp.0 (Int 1) - (Let 'tmp.1 (Prim '+ (list (Var 'y.1) (Var 'tmp.0))) - (Var 'tmp.1))))))) -(test-eq - (pass-2 (Program '() (Let 'x (Let 'y (Int 40) (Prim '+ (list (Var 'y) (Int 1)))) (Var 'x)))) - (Program '() (Let 'x.1 (Let 'y.1 (Int 40) - (Let 'tmp.0 (Int 1) - (Prim '+ (list (Var 'y.1) (Var 'tmp.0))))) - (Var 'x.1)))) -(test-eq - (pass-2 (list-ref programs 0)) - (Program '() (Let 'tmp.0 (Int 20) (Let 'tmp.1 (Prim '- (list (Var 'tmp.0))) (Var 'tmp.1))))) - -(define inputs - (let ([empty-inputs (build-list (length programs) (lambda (_) '()))]) - (list-set empty-inputs 13 '(2 3)))) - -(for ([program programs] - [input-list inputs]) - (begin - (test-eq (with-input-from-num-list input-list - (lambda () (interp-RVar program))) - (with-input-from-num-list input-list - (lambda () (interp-RVar (pass program))))) - (test-eq (with-input-from-num-list input-list - (lambda () (interp-RVar program))) - (with-input-from-num-list input-list - (lambda () (interp-RVar (pass-2 program)))))))