[racket] snips in redex traces

From: David Van Horn (dvanhorn at ccs.neu.edu)
Date: Tue May 7 01:25:02 EDT 2013

Is it possible to render snips in redex traces?

For example, here's something I'd like to write and have it result in a 
pretty traces window:

#lang racket
;; Traffic lights as redex model
(require redex 2htdp/image)
(define-language L)

(define RED    (circle 14 "solid" "red"))
(define YELLOW (circle 14 "solid" "yellow"))
(define GREEN  (circle 14 "solid" "green"))

(define R
   (reduction-relation
    L
    (--> (side-condition any_l (equal? (term any_l) RED))    ,GREEN)
    (--> (side-condition any_l (equal? (term any_l) YELLOW)) ,RED)
    (--> (side-condition any_l (equal? (term any_l) GREEN))  ,YELLOW)))

(traces R (term ,RED))

I'd also be happy if I could write a Term -> Snip function to supply as 
a pretty printer.

David

Posted on the users mailing list.