File: dining.pn

package info (click to toggle)
maria 1.3.5-2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 3,980 kB
  • ctags: 5,458
  • sloc: cpp: 43,402; yacc: 8,080; ansic: 436; sh: 404; lisp: 395; makefile: 291; perl: 21
file content (18 lines) | stat: -rw-r--r-- 533 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
typedef unsigned (1..3) phil_t;
typedef struct {
  phil_t p,
  enum { thinking, hungry, eating } s
} status;
place fork (0..#phil_t) phil_t: phil_t p: p;
place state (#phil_t) status: phil_t p: { p, thinking };
trans left
in { place state: { p, thinking }; place fork: p; }
out { place state: { p, hungry }; };
trans right
in { place state: { p, hungry }; place fork: +p; }
out { place state: { p, eating }; };
trans finish
in { place state: { p, eating }; }
out { place state: { p, thinking }; place fork: p, +p; };

deadlock true;