
Redex no longer has extra checks to eliminate redundant matches
(as those checks are prohibitively expensive for the lambdajs model)
so redundancy in the grammar can, when combined with context
decomposition or named patterns, lead to significant slowdowns
(cherry picked from commit 0c6e0a11cf
)
36 lines
444 B
Racket
36 lines
444 B
Racket
#lang racket
|
||
|
||
(require redex)
|
||
(provide TL)
|
||
|
||
(define-language TL
|
||
(e a
|
||
(a ... e)
|
||
(letrec ([σ v] ...) e)
|
||
(w-c-m a a e)
|
||
(c-c-m [a ...])
|
||
(match a l ...)
|
||
(abort e))
|
||
|
||
(l [(K x ...) e])
|
||
(a (λ (x ...) e)
|
||
σ
|
||
x
|
||
(K a ...))
|
||
(w v
|
||
x)
|
||
(v (λ (x ...) e)
|
||
(K v ...)
|
||
σ)
|
||
|
||
(x variable-not-otherwise-mentioned)
|
||
(σ (ref variable))
|
||
|
||
(Σ ∅
|
||
(Σ [σ ↦ v]))
|
||
|
||
(K string))
|
||
|
||
|
||
|