- handle parameters correctly when simplifying disequations
- rework term generation/disequation checking for parameters
- fix define-extended-metafunction w/r/t the above
- enable generation for the above by compiling to
a disequation with "#f"
- wrap bare terms in relation definitons in
side-conditions (require they not be "#f")
- put the tests together with the other define-union-language tests
- fix the docs
- add a release note
- construct the merged language a bit more directly
- properly deal with this kind of thing:
(define-language L1 (e f ::= 1 2 3))
(define-language L2 (e g ::= 4 5 6))
(define-union-language L L1 L2)
Also:
- remove the restriction on the use of unquote in define-judgment-form
- allows limited use (I modes only) of judgment-forms in terms
- allows the use of define-relation with the search/unification
based random term generation
This adds the option to generate random terms that satisfy
judgment-forms and metafunctions.
Currently functionality does not include:
- patterns/terms using: ellipses, in-hole/hole and relatives, side-conditions, unquotes
- define-relation
- redex-check integration
included in the compiled files. (also, misc minor cleanups
notably a new exercise in tut.scrbl)
closes PR 12547 --- there are still a few uses left, but they do not
seem to be coming from Redex proper:
- /Users/robby/git/plt/collects/racket/private/map.rkt still appears
in a bunch of places (there is a separate PR for that I believe),
and
- /Users/robby/git/plt/collects/redex/../private/reduction-semantics.rkt
appears in tl-test.rkt, but I do not see how it
is coming in via Redex code, so hopefully one of the other
PRs that Eli submitted is the real cause. If not, I'll revisit later
redex patterns a bunch:
- repeats are turned into wrappers in sequences,
- names are all explicit,
- non-terminals are wrapped with `nt',
- cross patterns always have the hyphens in them.
- ellipses names are normalized (so there are no "hidden"
name equalities); this also means that repeat patterns
can have both a regular name and a mismatch name
Also, added a match-a-pattern helper macro that checks to make sure
that functions that process patterns don't miss any cases
a) avoids creating big intermediate lists of the same things over and over
(this closes PR 12380)
b) generates less code (by generating calls to local functions)
c) normalizes its output (sorts by the printed representation)
(by expanding into a call to a 30 or so line procedure, instead of putting
that code directly into the result of the macro).
This produces about a 6x speedup on this reduction-relation
(reduction-relation L (--> 0 1) (--> 1 2) ... (--> 99 100))
where L is
(define-language L)
The time it takes to run "racket r6rs.rkt" in the shell from the
directory collects/redex/examples/r6rs speeds up by about 10% (15%
with errortrace enabled), in the case where all .zo files are built,
except the ones in the r6rs directory. (Also worth noting that "racket
-l redex" takes more than 50% of that time.) And the change has no
noticeable effect on the time it takes to run r6rs-test.rkt.