Created
March 25, 2016 01:27
-
-
Save wilbowma/8ee2e47c9d0f443ddd81 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket/base | |
(require | |
redex/reduction-semantics) | |
(define-language lc | |
[e m ::= natural x (λ (x) e) (e e)] | |
[x ::= variable-not-otherwise-mentioned] | |
#:binding-forms | |
(λ (x) e #:refers-to x)) | |
(define lc--> | |
(reduction-relation | |
lc | |
(--> ((λ (x) e) m) (substitute e x m)))) | |
(module+ test | |
(test-->> (compatible-closure lc--> lc e) | |
(term (λ (x) ((λ (y) y) 1))) | |
(term (λ (x) 1))) | |
(test-->> (compatible-closure lc--> lc m) | |
(term (λ (x) ((λ (y) y) 1))) | |
(term (λ (x) 1)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Well, this has made it clear to me that the way Redex is implementing these "alias" non-terminals is just wrong. Thanks for helping me figure that out!