;; transitions
(define transition
(lambda (name pre post)
(let* ((f (lambda ()
(let ((tokens (map (lambda (p) (take-token p)) pre)))
(if (member #f tokens)
(for-each (lambda (p) (give-token p)) pre)
(for-each (lambda (p) (give-token p)) post))))))
f)))