Commit Graph

102 Commits

Author SHA1 Message Date
Robby Findler
c9045abf4d add stub for enumeration support to Redex 2013-05-01 10:46:11 -05:00
Robby Findler
06315bf0fa syntax error check fix
closes PR 13639
2013-03-29 11:58:52 -05:00
Burke Fetscher
ddf4945125 Redex: corrections for disequations in generator
- handle parameters correctly when simplifying disequations
- rework term generation/disequation checking for parameters
- fix define-extended-metafunction w/r/t the above
2013-03-22 15:28:36 -05:00
Burke Fetscher
40fc96cacf Redex: rework metafunction compilation/search for parameters 2013-03-22 15:28:35 -05:00
Robby Findler
06696d67b4 add a #:pre keyword to define-metafunction
The keyword allows the specification of contracts
that relate different arguments

closes PR 13617
2013-03-18 12:54:27 -05:00
Robby Findler
0c5c41fd54 add clause-name to define-metafunction, to be used with the
newly extended metafunction-cases
2013-03-15 23:00:50 -05:00
Burke Fetscher
1ed7e8c234 Redex: generation for judgment-form side-conditions
- 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")
2013-03-06 16:00:05 -06:00
Robby Findler
42847ea523 follow up to William J. Bowman's commit
- 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)
2013-03-01 19:38:57 -06:00
William J. Bowman
b0db8798b6 Changed `define-union-language' to merge nonterminals and their
right-hand-sides instead of causing an error when more than one language
in the union defines the same nonterminal.
2013-03-01 19:38:57 -06:00
Asumu Takikawa
5790667054 Remove duplicate non-terminals in define-extended-language
Fixes a problem with `define-union-language`
2013-02-28 12:16:25 -05:00
Burke Fetscher
cf9b0f774b Change define-relation to compile to a judgment-form, instead of a metafunction.
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
2012-11-29 17:17:34 -06:00
Robby Findler
10a8a625fa record the (uncompiled) domain pattern with a reduction
relation so that context-closure can adjust the domain

closes PR 13204
2012-10-27 20:39:04 -05:00
Robby Findler
7355c59fb1 added the ability to extract a derivation
from a judgment-form via build-derivation
(returns derivation structs)
2012-10-21 23:19:54 -05:00
Burke Fetscher
44dd4acb44 Additional random test generation capability for Redex.
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
2012-10-17 16:30:51 -05:00
Robby Findler
0e7688349e add syntax error check when the arrow in a reduction
relation isn't just an identifier

add a syntax error check when an identifier appears
under two different ellipses depths in the same pattern
2012-09-20 07:09:17 -05:00
Robby Findler
605e1b8c89 adjust redex so that identifiers preserve their syntax-original ness 2012-08-24 09:47:18 -05:00
Burke Fetscher
29661cc675 add #:lang keyword to term, which checks that underscored symbols agree with patterns in the provided language...changed most internal uses of term to use this form 2012-08-08 11:09:01 -05:00
Robby Findler
676f744c1d add 'match-pattern?' 2012-03-27 12:21:17 -05:00
Robby Findler
b7caf411ae added define-extended-judgment-form to Redex 2012-03-03 16:41:53 -06:00
Robby Findler
a0bb0430f2 separated the define-judgment-form implementation (and bind-withs)
into its own file
2012-03-03 16:41:52 -06:00
Robby Findler
c5193f7da7 fix a bug in define-union-language
(this bug was somehow already covered by the existing test suites
 and also make pretty much every define-union-language break)
2012-02-27 10:00:23 -06:00
Robby Findler
e4e4d70b6b added define-union-language 2012-02-10 17:10:47 -06:00
Robby Findler
55b3d99d78 adjust beaucoup places in redex where the source was being
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
2012-02-08 09:59:44 -06:00
Robby Findler
2ca0473f1c shrink longest line down to something more reasonable 2012-02-07 15:50:53 -06:00
Robby Findler
8bec634dcd adjust covered-cases so that it always returns deterministically
(sorting by the strings in the result)
2012-02-05 17:24:13 -06:00
Robby Findler
977659a118 fix redex's syntax pruning to not drop the #%top binding 2012-02-01 20:09:29 -06:00
Robby Findler
b3c450ffc9 add 'side-condition' to define-judgment-form (it does not have an implicit
unquote like the other side-condition's do, but it is still useful
for typesetting purposes)
2012-01-14 14:52:07 -06:00
Robby Findler
93c21e34de added a cycle check to define-language so grammars like this one:
(define-language L
     (e e))

are rejected as syntax errors
2012-01-09 12:57:19 -06:00
Robby Findler
ddecad0575 redex: adjust the way metafunction tracing is printed so you
don't see (list 'lambda (list 'x) 'x) but instead (lambda (x) x)
2012-01-08 12:13:36 -06:00
Robby Findler
5b2d378a77 fixed a bug in recent Redex internal pattern rewrite
(discovered by the random testing done for the racket machine model)
2011-12-28 23:52:56 -06:00
Robby Findler
f1bacffbdc Adjusted rewrite-side-condition/check-errs so that it normalizes the internal
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
2011-12-28 09:46:43 -06:00
Robby Findler
e55ed2dc25 improve syntax error reporting for judgment-holds in reduction relations (and
probably elsewhere)
2011-12-08 20:35:46 -06:00
Robby Findler
447bd44a0c minor rackety 2011-12-05 01:14:54 -06:00
Robby Findler
e788c6f49e adjust define-judgment-form so that it
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)
2011-11-20 22:50:07 -06:00
Robby Findler
0a75219438 added support for where & side-condition & judgment-holds to define-relation
closes PR 12382
2011-11-20 21:34:22 -06:00
Robby Findler
b93486ed69 compile the left-hand sides of define-judgment only once, not during each time we try to check a judgment
related to PR 12380
2011-11-17 20:55:05 -06:00
Robby Findler
755dc28e55 Fixes define-relation's handling of ellipses across clauses
closes PR 12378
2011-11-17 17:00:11 -06:00
Robby Findler
64dfdb3c7f Change the expansion of reduction-relation so that it generates less code
(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.
2011-10-31 08:53:09 -05:00
Robby Findler
9d371153fd add the #:stop-when argument to apply-reduction-relation* 2011-10-23 12:10:56 -05:00
Robby Findler
9ab6a93127 fix the error check
closes PR 12290
2011-10-15 14:00:16 -05:00
Ryan Culpepper
7cc1476170 syntax/parse: fix bug: integrated stxclass might not bind pvar to syntax 2011-09-21 16:58:52 -06:00
Casey Klein
634f5c9e0c Removes now outdated comment 2011-09-08 09:11:52 -05:00
Casey Klein
97e792200f Gives a function a better name 2011-09-08 09:11:52 -05:00
Casey Klein
6d43376f9c Adds support for `judgment-holds' clauses in metafunctions 2011-09-08 09:11:52 -05:00
Casey Klein
ac7856a377 Moves metafunction construction to later expansion step 2011-09-08 09:11:51 -05:00
Casey Klein
2b4f604776 Replaces use of `define-syntax-set' 2011-09-08 09:11:51 -05:00
Casey Klein
145828527f Fixes handling of pattern variables that look like metafunctions 2011-08-31 11:20:02 -05:00
Casey Klein
c0625dc30c Adds define-term form 2011-08-30 15:10:50 -05:00
Casey Klein
2eced78000 Fixes indentation 2011-08-17 11:59:43 -05:00
Casey Klein
9e2e11e9c4 Tests metafunction Check Syntax arrows 2011-08-16 14:32:33 -05:00