Skip to content

Instantly share code, notes, and snippets.

@kencoba
Created April 2, 2014 09:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kencoba/9931279 to your computer and use it in GitHub Desktop.
Save kencoba/9931279 to your computer and use it in GitHub Desktop.
[SyncStitch]仕様と実装の比較 ref: http://qiita.com/kencoba/items/dda9ba692e002d638611
(deadlock SYS)
(trace SPEC SYS)
(failure SPEC SYS)
(define-event send.0)
(define-event send.1)
(define-event recv.0)
(define-event recv.1)
(define-channel rch (x) '((0) (1)))
(define-channel sch (x) '((0) (1)))
(define-process R0
(? rch (x) (= x 0)
(! recv.0
(! sch (0)
(? rch (x) (= x 1)
(! recv.1
(! sch (1) R0)))))))
(define-process S0
(! send.0
(! rch (0)
(? sch (x) (= x 0)
(! send.1
(! rch (1)
(? sch (x) (= x 1) S0)))))))
(define-process SPEC
(! send.0 (! recv.0 (! send.1 (! recv.1 SPEC)))))
(define-process SYS
(hpar (list sch rch) S0 R0))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment