formula lfree = (p2>=0&p2<=4)|p2=6|p2=10;
formula rfree = (p3>=0&p3<=3)|p3=5|p3=7|p3=11;
module phil1
p1: [0..11];
[] p1=0 -> (p1'=0);
[] p1=0 -> (p1'=1);
[] p1=1 -> 0.5 : (p1'=2) + 0.5 : (p1'=3);
[] p1=2 & lfree -> (p1'=4);
[] p1=2 & !lfree -> (p1'=2);
[] p1=3 & rfree -> (p1'=5);
[] p1=3 & !rfree -> (p1'=3);
[] p1=4 & rfree -> (p1'=8);
[] p1=4 & !rfree -> (p1'=6);
[] p1=5 & lfree -> (p1'=8);
[] p1=5 & !lfree -> (p1'=7);
[] p1=6 -> (p1'=1);
[] p1=7 -> (p1'=1);
[] p1=8 -> (p1'=9);
[] p1=9 -> (p1'=10);
[] p1=9 -> (p1'=11);
[] p1=10 -> (p1'=0);
[] p1=11 -> (p1'=0);
endmodule
module phil2 = phil1 [ p1=p2, p2=p3, p3=p1 ] endmodule
module phil3 = phil1 [ p1=p3, p2=p1, p3=p2 ] endmodule
label "hungry" = ((p1>0)&(p1<8))|((p2>0)&(p2<8))|((p3>0)&(p3<8));
label "eat" = ((p1>=8)&(p1<=9))|((p2>=8)&(p2<=9))|((p3>=8)&(p3<=9));