Let us say I have the following defined in Redex:
(define-language L
[e ::= (λ x e) (e e) x]
[x ::= variable-not-otherwise-mentioned]
#:binding-forms
(λ x e #:refers-to x))
Now, I would think that the expression (λ y x) x
means:
replace occurrence of y
in x
(inside braces in the above expression) with x
(outside braces). And since there is no y
in x
, the answer should be just x
. Then (λ y x) x y
should return x y
. But:
(default-language L)
(term (substitute (λ y x) x y))
'(λ y«0» y)
why does it return a function? And what does y<<0>>
mean? Am I misunderstanding term (substitute ..)
?
I didn't understand this result either:
(term (substitute (λ y x) x true))
'(λ y«1» true)
Could someone help me decipher this? I'm new to Racket/Redex.