PLT Redex: a semantics engineer’s toolkit Robby Findler & Casey Klein University of Chicago 1
Critical Infrastructure 2
Heavy-duty Tools 3
Simpler Jobs 4
Mismatched Tools 5
The Right Tool for the Job 6
Sometimes, Overhead Matters 7
Isabelle, HOL, Coq, Twelf, ... PLT Redex 8
PLT Redex EDSL Tools define-language traces, stepper reduction-relation typesetting define-metafunction test suites 9
PLT Redex EDSL Tools define-language traces, stepper reduction-relation typesetting define-metafunction test suites 10
Target, i (define-language lang (e (e e ...) x v) (v number ( � (x ...) e) + *) (x (variable-except � + *)) (E hole (v ... E e ...))) 11
Target, ii (define red (reduction-relation lang (--> (in-hole E (+ number ...)) (in-hole E ,(apply + (term (number ...)))) +) (--> (in-hole E (* number ...)) (in-hole E ,(apply * (term (number ...)))) *) (--> (in-hole E (( � (x ...) e) v ...)) (in-hole E (subst-n ((x v) ... e))) � v))) 12
Executable (traces lang red (term ((( � (x) (x x)) ( � (x) (x x))) (* (+ 1 2) (+ 3 4))))) 13
For fun (define-language lang2 (e (e e ...) x v) (v number ( � (x ...) e) + *) (x (variable-except � + *)) (E hole (e ... E e ...))) 14
For fun (traces lang2 red2 (term ((( � (x) (x x)) ( � (x) (x x))) (* (+ 1 2) (+ 3 4))))) 15
http://www.cs.uchicago.edu/~robby/plt-redex/ 16
Recommend
More recommend