<div dir="ltr">Yes, sure:<div><br></div><div><div>#lang racket</div><div>(require redex 2htdp/image)</div><div>(define-language L </div><div> (t ::= RED YELLOW GREEN))</div><div><br></div><div>(define RED (circle 14 "solid" "red"))</div>
<div>(define YELLOW (circle 14 "solid" "yellow"))</div><div>(define GREEN (circle 14 "solid" "green"))</div><div><br></div><div>(define R</div><div> (reduction-relation</div><div>
L</div><div> (--> RED GREEN)</div><div> (--> YELLOW RED)</div><div> (--> GREEN YELLOW)))</div><div><br></div><div>(traces R (term RED)</div><div> #:pp</div><div> (λ (term port w txt)</div><div>
(write-special</div><div> (case term</div><div> [(RED) RED]</div><div> [(GREEN) GREEN]</div><div> [(YELLOW) YELLOW])</div><div> port)))</div></div><div><br>
</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, May 7, 2013 at 12:25 AM, David Van Horn <span dir="ltr"><<a href="mailto:dvanhorn@ccs.neu.edu" target="_blank">dvanhorn@ccs.neu.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Is it possible to render snips in redex traces?<br>
<br>
For example, here's something I'd like to write and have it result in a pretty traces window:<br>
<br>
#lang racket<br>
;; Traffic lights as redex model<br>
(require redex 2htdp/image)<br>
(define-language L)<br>
<br>
(define RED (circle 14 "solid" "red"))<br>
(define YELLOW (circle 14 "solid" "yellow"))<br>
(define GREEN (circle 14 "solid" "green"))<br>
<br>
(define R<br>
(reduction-relation<br>
L<br>
(--> (side-condition any_l (equal? (term any_l) RED)) ,GREEN)<br>
(--> (side-condition any_l (equal? (term any_l) YELLOW)) ,RED)<br>
(--> (side-condition any_l (equal? (term any_l) GREEN)) ,YELLOW)))<br>
<br>
(traces R (term ,RED))<br>
<br>
I'd also be happy if I could write a Term -> Snip function to supply as a pretty printer.<br>
<br>
David<br>
____________________<br>
Racket Users list:<br>
<a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/<u></u>users</a><br>
</blockquote></div><br></div>