Skip to content

Commit d403598

Browse files
committed
fix bug in substitution
1 parent 18e41ca commit d403598

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

redex-doc/redex/scribblings/long-tut/code/mon-aft.rkt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,9 @@ subst (if time, otherwise it's provide)
190190
#:equiv =α/racket)
191191
(test-equal (term (subst ((2 x)) ((lambda (x) (1 x)) x)))
192192
(term ((lambda (x) (1 x)) 2))
193+
#:equiv =α/racket)
194+
(test-equal (term (subst (((lambda (x) y) x)) (lambda (y) x)))
195+
(term (lambda (y1) (lambda (x) y)))
193196
#:equiv =α/racket))
194197

195198
(define-metafunction Lambda
@@ -200,7 +203,7 @@ subst (if time, otherwise it's provide)
200203
(lambda (x_new)
201204
(subst ((any_1 x_1) ...)
202205
(subst-raw (x_new x) any_body)))
203-
(where x_new ,(variable-not-in (term any_body) (term x)))]
206+
(where x_new ,(variable-not-in (term (any_1 ... any_body)) (term x)))]
204207
[(subst [(any_1 x_1) ... ] (any ...)) ((subst [(any_1 x_1) ... ] any) ...)]
205208
[(subst [(any_1 x_1) ... ] any_*) any_*])
206209

0 commit comments

Comments
 (0)