Commit Graph

92 Commits

Author SHA1 Message Date
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
Casey Klein
98eaaebc65 Improves error messages for Redex definition forms 2011-08-15 12:46:14 -05:00
Casey Klein
4d1651645a Improves error message for premise typos 2011-08-10 12:24:02 -05:00
Casey Klein
a2dc2d9540 Fixes arity checks outside define-judgment-form 2011-08-10 12:24:02 -05:00
Casey Klein
87f3541979 Adds support for ellipsis-repeated premises 2011-08-10 12:24:01 -05:00
Casey Klein
52c50dd67e Adds an alternative syntax for define-judgment-form rules
The conclusion may come last instead of first when a sequence of
dashes precedes it.
2011-08-10 12:24:00 -05:00
Casey Klein
dbfbf59256 Changes syntax for define-judgment-form mode and contract specs 2011-08-10 12:23:59 -05:00
Casey Klein
d58a743b89 Fixes define-judgment-form at the top-level with errortrace enabled 2011-08-10 12:23:59 -05:00
Casey Klein
576272362b Adds define-judgment-form form 2011-08-05 07:19:23 -05:00
Casey Klein
8887ea2ef3 Refactors meta-function implementation further 2011-08-05 07:19:22 -05:00
Casey Klein
6e38233286 Deletes dead code 2011-08-05 07:19:22 -05:00