Robby Findler
9bcb86eb0c
redex: minor cleanup
2011-12-29 10:15:52 -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
a88d9ca116
missed a place to add an undatum
2011-12-15 08:44:39 -06:00
Robby Findler
c91d004729
more cleanup of the rendering for the case when (format "~s" x)
...
and (format "~a" x) are different (when 'x' is a symbol)
2011-12-15 08:44:39 -06:00
Matthew Flatt
25dd8727cb
add datum-case', etc. as
syntax/datum'
...
This library is used by Redex, which wants a `syntax'-like template
language, but for datum values instead of syntax objects. Using
`datum-case' and `datum' generates much less code. Redex uses
only a small part of the general functionality, so adding
`syntax/datum' could be overkill. It's implemented by generalizing
the `syntax-case' and `syntax' pattern matching and template
constructing code, though; it's not a lot of extra code, and it's
easiest to generalize completely. We may find other uses for
datum templates, too.
2011-12-12 08:13:20 -07:00
Robby Findler
622bec0719
avoid (format "~s" x) in favor of (symbol->string x) for symbols
...
when doing typesetting stuff in Redex, as the former seems to have
some kind of context dependency that makes it insert ||s around
some upper-case symbols sometimes
2011-12-10 02:55:47 -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
f725066bf9
fix bug in the handling of side-conditions
2011-12-05 01:14:54 -06:00
Robby Findler
ce7523f01f
more atoms can be shared now, so wrap 'em up
2011-12-02 16:38:56 -06:00
Robby Findler
458e2c2282
some long overdue Rackety: renaming the 'scheme:' exports of the framework to 'racket:'
2011-11-30 06:45:50 -06:00
Robby Findler
9db206b231
add in keymap mixin
2011-11-29 18:43:37 -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
3379fb8df6
fix some redex bugs caught by drdr tests
2011-11-09 06:47:38 -06:00
Robby Findler
0ce6c75591
Rackety (mostly letrec-values => define and minimizing dependencies)
2011-10-31 09:14:34 -05: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
41f68af64a
delay the construction of the compatible-closure grammar (the 'cross' thing)
...
until it is actually used. (This can make a big difference for large grammars
in models that don't actually use the compatible closure stuff.)
2011-10-30 22:36:53 -05:00
Robby Findler
9d371153fd
add the #:stop-when argument to apply-reduction-relation*
2011-10-23 12:10:56 -05:00
Casey Klein
57a8ed5c79
Fixes matching of prefab struct literals
...
Fixes PR 12298
2011-10-17 19:37:16 -05:00
Robby Findler
9ab6a93127
fix the error check
...
closes PR 12290
2011-10-15 14:00:16 -05:00
Robby Findler
db2e13a09b
add a "Step Until Choice" option into the redex stepper
2011-10-14 13:37:12 -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
Eli Barzilay
1db5ad97f8
Fix another bunch of "language" typos.
2011-08-26 05:26:46 -04: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
88cd7cd303
Adds with-compound-rewriters typesetting form
2011-08-10 12:24:00 -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
Casey Klein
7898018cad
Factors out name-consistency check
2011-08-05 07:19:22 -05:00
Casey Klein
24dc005ff4
Removes special case for typesetting recursive calls
...
This case doesn't appear necessary, since LWs are constructed in an
expansion step that occurs after all of the meta-function names
(including the current one) are bound.
2011-08-05 07:19:21 -05:00
Casey Klein
3dc677d270
Factors out parsing of relation contracts
2011-08-05 07:19:21 -05:00
Casey Klein
c9c2bb8ad7
Refactors construction of meta-function and relation lws
2011-08-05 07:19:20 -05:00
Eli Barzilay
3157955d40
".ss" -> ".rkt" scan done.
2011-07-02 10:37:53 -04:00
Eli Barzilay
40124a0619
A long overdue scan to eliminate files without terminating newlines.
...
(DrRacket should really do that.)
2011-06-28 02:01:41 -04:00
Robby Findler
78006b5720
redex: adjust the 'horizontal rule-pict-style so that it doesn't add space after the last rule
...
extend render-reduction-relation-rules so you can specify rule indicies instead of just
the names of the rules
2011-06-21 06:32:51 +08:00
Robby Findler
b43e956c7b
Redex: added to-lw/stx
...
plus improved the redex docs slightly and Rackety
2011-05-30 21:33:55 -05:00
Robby Findler
d74810a08b
fix broken earlier commit
2011-05-25 14:57:04 -05:00
Robby Findler
33e68022db
make the two-argument version of redex-match use the right name for the procedure it returns
2011-05-25 12:45:06 -05:00
Casey Klein
e8e2898359
Fixes rendering of relations with `name' patterns
2011-05-24 11:58:54 -05:00
Robby Findler
040bd371b6
adjust the lw construction in Redex so that it uses the width of the
...
"canonical" way to write symbols, instead of the way they are displayed.
This makes a difference for symbols that have spaces in them or symbols
that, when displayed, look like numbers or other non-symbol things.
2011-05-20 21:52:09 -05:00
Robby Findler
c163e75023
make the generated name used for languages (introduced by define-language
...
and define-extended-language) be based on the name of the language so the
error message is better (but not as good as it should be)
2011-05-11 18:38:10 -05:00
Casey Klein
cafcb47549
Refactored reduction-relation-procs
2011-05-08 06:19:45 -05:00
Casey Klein
dd58b457a9
Fixes domain checking of unioned reduction relations
2011-05-08 05:04:16 -05:00
Robby Findler
33c848fcda
added current-cache-all?, a parameter that controls the caching strategy
...
that apply-reduction-relation* (and thus test-->>) uses
also make apply-reduction-relation* call remove-duplicates
on the result of apply-reduction-relation
2011-05-07 20:06:38 -05:00
Casey Klein
4b03ddccb1
Fixes Redex stepper's handling of symbols quoted with ||
2011-05-04 10:34:01 -05:00
Robby Findler
8fbefb0b6d
added typesetting support for relations
2011-04-28 22:20:14 -05:00
Casey Klein
1d1cdd03f5
Adds a form like term-let but using Redex patterns
2011-04-26 12:13:17 -05:00
Casey Klein
b3f45d3c84
Refactors to eliminate copied code
2011-04-26 12:13:17 -05:00
Casey Klein
50f14dea18
Adds start term to test-->>E failure message
...
Closes PR 11867
2011-04-22 09:49:41 -05:00
Casey Klein
1c8c6ddbee
Adds generate-term option for LHS-based generation
2011-04-22 04:43:11 -05:00
Casey Klein
362a6d75a5
Changes redex-match to suppress ..._x bindings
2011-04-22 04:43:11 -05:00
Casey Klein
0b9db752ca
Fixes test-->>E failure message
...
Fixes PR 11853
2011-04-15 04:52:13 -05:00
Casey Klein
46b3a9d13d
Fixes generation of any' within
in-hole' context position
2011-04-14 18:32:06 -05:00
Casey Klein
319ae5f825
Deletes code that should have been deleted when named holes went away
2011-04-14 18:32:05 -05:00
Casey Klein
989103c3a1
Improves term-let's "too few ellipses" error
...
Fixes PR 10837
2011-04-07 13:17:15 -05:00
Casey Klein
143e1e66fd
Improves error for references to not-yet-defined metafunctions
...
Fixes PR 11041
2011-04-07 13:17:15 -05:00
Ryan Culpepper
73ab167522
created racket/syntax from parts of unstable/syntax
2011-04-07 09:47:20 -06:00
Casey Klein
1ad2b1b938
Makes cross' work better with
hide-hole'
...
Fixes PR 11579
2011-04-06 10:17:15 -05:00
Casey Klein
e8130a2fd1
Fixes bug in `cross' pattern handling
2011-04-06 10:17:15 -05:00
Casey Klein
a4644d4d49
Disallows unquote in Redex patterns
...
Fixes PR 11296
2011-04-01 14:00:45 -05:00
Casey Klein
d97a2b505c
Fixes matching of ..._x and ..._!_x inside ellipses
2011-03-30 10:15:17 -05:00
Casey Klein
b958e21f46
Fixes another bug in the stepper's diff highlighting
2011-03-29 13:05:03 -05:00
Casey Klein
df3bc8980b
Fixes a bug in the stepper's diff highlighting
2011-03-29 13:05:02 -05:00
Robby Findler
7a427be2fd
improve Redex's arrow drawing
2011-03-27 14:49:34 -05:00
Robby Findler
f69ff3b6b7
added support for 'or', \vee, and \cup as builtins to the define-metafunction codomain contracts
2011-03-26 10:04:39 -05:00
Casey Klein
3214861420
Fixes rendering of (hole t ...+)
...
There was some old named holes code still in use.
2011-03-24 14:35:02 -05:00
Robby Findler
99e9bd9543
exported arrow->pict
2011-03-23 17:03:57 -05:00
Casey Klein
87934752b5
Adds a parameter that provides a default for redex-check's #:attempt argument
2011-03-22 21:20:29 -05:00
Robby Findler
d0d2285c4c
Adjust the dependencies in redex/pict so it doesn't depend on racket/gui/base anymore
2011-03-17 13:35:32 -05:00
David Van Horn
760a58b65d
Fixes more spelling errors.
2011-02-04 19:44:13 -07:00
Casey Klein
f7fd6ee689
Changes the term generator to produce shorter sequences
...
It now uses the (local) size bound instead of the (global) attempt count.
2011-01-31 12:36:42 -06:00
Casey Klein
b45bb829b6
Fixes a bug in metafunction traces
...
When the result is in the cache but the cache is not consulted because
`caching-enabled?' is false, the call should not be shown as cached.
2011-01-14 13:41:09 -06:00
Casey Klein
61607c4da1
Adds a check to the define/extend language parser
2011-01-14 13:41:09 -06:00
Casey Klein
3c2e2fc362
Fixes `extend-reduction-relation' bug.
...
The #:domain argument did not apply to inherited rules.
2011-01-14 13:41:09 -06:00
Casey Klein
56a548c517
Suppresses overridden rules in the names reported for a reduction relation
2011-01-14 13:41:09 -06:00
Casey Klein
25c1400d8b
Exposes the default value of the #:attempt-size argument
2011-01-03 09:37:32 -06:00
Casey Klein
de8b1bc101
Fixes a bug in the generation of `side-condition' patterns
...
The bindings supplied to `side-condition' predicates by the matcher
sometimes contain the-not-hole; the ones supplied by the generator
must be the same.
2010-12-31 15:34:31 -06:00
Robby Findler
eb29b17112
adds a #:pred argument to test-->> (in rough analogy to the #:pred argument on traces)
2010-12-20 22:09:10 -06:00
Casey Klein
7243029786
Fixes a bug in the Redex term generator
2010-12-10 13:58:11 -06:00
Casey Klein
9ea976625d
Steven's progress on the compiler
2010-12-06 14:44:38 -06:00
Casey Klein
8affb5b13f
Fixes CS renaming of pattern occurrences of metafunction names
2010-12-03 15:47:54 -06:00