add1-simple.rkt

This commit is contained in:
Tony Garnock-Jones 2017-10-21 14:56:46 +01:00
parent bf0eb16643
commit d51a513f8b
1 changed files with 13 additions and 0 deletions

View File

@ -0,0 +1,13 @@
#lang syndicate
;; Trivial example program to demonstrate tracing
(assertion-struct one-plus (n m))
(spawn #:name 'add1-server
(during/spawn (observe (one-plus $n _))
#:name (list 'solving 'one-plus n)
(assert (one-plus n (+ n 1)))))
(spawn #:name 'client-process
(stop-when (asserted (one-plus 3 $value))
(printf "1 + 3 = ~a\n" value)))