Skip to content

Commit

Permalink
A small example use of SynthCL grammar.
Browse files Browse the repository at this point in the history
  • Loading branch information
emina committed Feb 28, 2016
1 parent 9efb1ff commit da2f985
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions sdsl/synthcl/test/grammar.rkt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#lang s-exp "../lang/main.rkt"


(grammar int (expr [int x] [int y] [int depth])
#:base (choose x y)
#:else (locally-scoped
(: int left right)
(= left (expr x y (- depth 1)))
(= right (expr x y (- depth 1)))
(+ left right)))

(procedure int (h0 [int x] [int y])
(expr x y 1))

(procedure int (s0 [int x] [int y])
(+ x y))

(synth #:forall [(: int x) (: int y)]
#:ensure (assert (== (h0 x y) (s0 x y))))

0 comments on commit da2f985

Please sign in to comment.