File tree Expand file tree Collapse file tree 2 files changed +35
-2
lines changed
redex-gui-lib/redex/private Expand file tree Collapse file tree 2 files changed +35
-2
lines changed Original file line number Diff line number Diff line change 131
131
(define derivation-pb%
132
132
(class pasteboard%
133
133
134
+ ;; this method is called to give the pasteboard a
135
+ ;; chance to relayout its snips based on font size
136
+ (define/public (re-run-layout) (void))
137
+
134
138
(init-field pp racket-colors?)
135
139
(define root-snip #f )
136
140
(define/public (set-root ts) (set! root-snip ts))
Original file line number Diff line number Diff line change @@ -9,15 +9,16 @@ as you reduce you expect to see a spectrum from blue to red
9
9
10
10
In the other window, you expect to see the currently unreducted terms in green and all others white.
11
11
12
- Also just tests that the stepper works . The third window is a stepper window.
12
+ Also just tests that the stepper and show-derivations work . The third window is a stepper window.
13
13
Expect the second step to split and show two steps.
14
14
15
15
|#
16
16
17
17
(require redex/reduction-semantics
18
18
redex/gui
19
19
racket/gui/base
20
- racket/class)
20
+ racket/class
21
+ racket/file)
21
22
22
23
(module test racket/base)
23
24
@@ -94,3 +95,31 @@ Expect the second step to split and show two steps.
94
95
(--> 0 zero)
95
96
(--> (any ) (any any ) "not-computed " ))
96
97
0 ))
98
+
99
+ (let ()
100
+ (define-language L
101
+ (e ::= (e e) n)
102
+ (n ::= natural))
103
+ (define-judgment-form L
104
+ #:mode (J I O)
105
+ [-------
106
+ (J n n)]
107
+
108
+ [(J e_1 n_1) (J e_2 n_2)
109
+ ----------------------------------------
110
+ (J (e_1 e_2) ,(+ (term n_1) (term n_2)))])
111
+ (show-derivations
112
+ (build-derivations
113
+ (J (0 ((((1 2 ) (3 4 )) ((5 6 ) (7 8 ))) ((9 10 ) (11 12 )))) 78 ))))
114
+
115
+
116
+ (let ([tmp.ps (make-temporary-file "redex-derivations-ps-test~a.ps " )])
117
+ (dynamic-wind
118
+ void
119
+ (λ () (derivation/ps
120
+ (derivation '(P foo) "foo "
121
+ (list (derivation '(P foo) "foo " '() )
122
+ (derivation '(P foo) "foo " '() )))
123
+ tmp.ps))
124
+ (λ ()
125
+ (delete-file tmp.ps))))
You can’t perform that action at this time.
0 commit comments