traceの一番単純な例、ということで。
Definitions
(define-event on)
(define-event off)
(define-channel switch-ch (x) '((0)))
SPEC
(define-process SPEC (! on (! off SPEC)))
SwitchPress
(define-process SwitchPress
(! switch-ch (0) SwitchPress))
ToggleSwitch
(define-process SwitchOff
(? switch-ch (x) (! on SwitchOn)))
(define-process SwitchOn
(? switch-ch (x) (! off SwitchOff)))
SYS
(define-process SYS
(hpar (list switch-ch) SwitchPress SwitchOff))