Skip to content

Instantly share code, notes, and snippets.

@wilbowma
Created March 25, 2016 01:27
Show Gist options
  • Save wilbowma/8ee2e47c9d0f443ddd81 to your computer and use it in GitHub Desktop.
Save wilbowma/8ee2e47c9d0f443ddd81 to your computer and use it in GitHub Desktop.
#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))))
@rfindler
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment