Browse Source
Tidy up phil/original (and add pp files).
Tidy up phil/original (and add pp files).
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@683 bbc10eb1-c90d-0410-af57-cb519fbb1720master
27 changed files with 252 additions and 196 deletions
-
7prism-examples/phil/original/.autopp
-
42prism-examples/phil/original/.philN.nm.pp
-
24prism-examples/phil/original/auto
-
3prism-examples/phil/original/phil.pctl
-
27prism-examples/phil/original/phil10.nm
-
4prism-examples/phil/original/phil10.pctl
-
37prism-examples/phil/original/phil15.nm
-
4prism-examples/phil/original/phil15.pctl
-
4prism-examples/phil/original/phil20.pctl
-
57prism-examples/phil/original/phil25.nm
-
4prism-examples/phil/original/phil25.pctl
-
13prism-examples/phil/original/phil3.nm
-
4prism-examples/phil/original/phil3.pctl
-
67prism-examples/phil/original/phil30.nm
-
4prism-examples/phil/original/phil30.pctl
-
15prism-examples/phil/original/phil4.nm
-
4prism-examples/phil/original/phil4.pctl
-
17prism-examples/phil/original/phil5.nm
-
4prism-examples/phil/original/phil5.pctl
-
19prism-examples/phil/original/phil6.nm
-
4prism-examples/phil/original/phil6.pctl
-
21prism-examples/phil/original/phil7.nm
-
4prism-examples/phil/original/phil7.pctl
-
23prism-examples/phil/original/phil8.nm
-
4prism-examples/phil/original/phil8.pctl
-
28prism-examples/phil/original/phil9.nm
-
4prism-examples/phil/original/phil9.pctl
@ -0,0 +1,7 @@ |
|||
#!/bin/csh |
|||
|
|||
foreach N ( 3 4 5 6 7 8 9 10 15 25 30 ) |
|||
echo "Generating for N=$N" |
|||
prismpp .philN.nm.pp $N >! phil"$N".nm |
|||
unix2dos phil"$N".nm |
|||
end |
|||
@ -0,0 +1,42 @@ |
|||
#const N# |
|||
// randomized dining philosophers [LR81] |
|||
// dxp/gxn 12/12/99 |
|||
// atomic formulae |
|||
// left fork free and right fork free resp. |
|||
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); // stay thinking |
|||
[] p1=0 -> (p1'=1); // trying |
|||
[] p1=1 -> 0.5 : (p1'=2) + 0.5 : (p1'=3); // draw randomly |
|||
[] p1=2 & lfree -> (p1'=4); // pick up left |
|||
[] p1=2 & !lfree -> (p1'=2); // left not free |
|||
[] p1=3 & rfree -> (p1'=5); // pick up right |
|||
[] p1=3 & !rfree -> (p1'=3); // right not free |
|||
[] p1=4 & rfree -> (p1'=8); // pick up right (got left) |
|||
[] p1=4 & !rfree -> (p1'=6); // right not free (got left) |
|||
[] p1=5 & lfree -> (p1'=8); // pick up left (got right) |
|||
[] p1=5 & !lfree -> (p1'=7); // left not free (got right) |
|||
[] p1=6 -> (p1'=1); // put down left |
|||
[] p1=7 -> (p1'=1); // put down right |
|||
[] p1=8 -> (p1'=9); // move to eating (got forks) |
|||
[] p1=9 -> (p1'=10); // finished eating and put down left |
|||
[] p1=9 -> (p1'=11); // finished eating and put down right |
|||
[] p1=10 -> (p1'=0); // put down right and return to think |
|||
[] p1=11 -> (p1'=0); // put down left and return to think |
|||
|
|||
endmodule |
|||
|
|||
// construct further modules through renaming |
|||
#for i=2:N# |
|||
module phil#i# = phil1 [ p1=p#i#, p2=p#mod(i,N)+1#, p3=p#mod(i-2,N)+1# ] endmodule |
|||
#end# |
|||
|
|||
// labels |
|||
label "hungry" = #| i=1:N#((p#i#>0)&(p#i#<8))#end#; |
|||
label "eat" = #| i=1:N#((p#i#>=8)&(p#i#<=9))#end#; |
|||
|
|||
@ -1,14 +1,14 @@ |
|||
#!/bin/csh |
|||
|
|||
prism phil3.nm phil3.pctl -fair -m |
|||
prism phil4.nm phil4.pctl -fair -m |
|||
prism phil5.nm phil5.pctl -fair -m |
|||
prism phil6.nm phil6.pctl -fair -m |
|||
prism phil7.nm phil7.pctl -fair -m |
|||
prism phil8.nm phil8.pctl -fair -m |
|||
prism phil9.nm phil9.pctl -fair -m |
|||
prism phil10.nm phil10.pctl -fair -m |
|||
prism phil15.nm phil15.pctl -fair -m |
|||
prism phil20.nm phil20.pctl -fair -m |
|||
prism phil25.nm phil25.pctl -fair -m |
|||
prism phil30.nm phil30.pctl -fair -m |
|||
prism phil3.nm phil.pctl -fair -m |
|||
prism phil4.nm phil.pctl -fair -m |
|||
prism phil5.nm phil.pctl -fair -m |
|||
prism phil6.nm phil.pctl -fair -m |
|||
prism phil7.nm phil.pctl -fair -m |
|||
prism phil8.nm phil.pctl -fair -m |
|||
prism phil9.nm phil.pctl -fair -m |
|||
#prism phil10.nm phil.pctl -fair -m |
|||
#prism phil15.nm phil.pctl -fair -m |
|||
#prism phil20.nm phil.pctl -fair -m |
|||
#prism phil25.nm phil.pctl -fair -m |
|||
#prism phil30.nm phil.pctl -fair -m |
|||
@ -0,0 +1,3 @@ |
|||
// Liveness (if a philosopher is hungry then eventually some philosopher eats) |
|||
|
|||
"hungry" => P>=1 [ true U "eat"] |
|||
@ -1,4 +0,0 @@ |
|||
label "hungry" = ((p1>0) & (p1<8)) | ((p2>0) & (p2<8)) | ((p3>0) & (p3<8)) | ((p4>0) & (p4<8)) | ((p5>0) & (p5<8)) | ((p6>0) & (p6<8)) | ((p7>0) & (p7<8)) | ((p8>0) & (p8<8)) | ((p9>0) & (p9<8)) | ((p10>0) & (p10<8)); |
|||
label "eat" = (p1=8..9) | (p2=8..9) | (p3=8..9) | (p4=8..9) | (p5=8..9) | (p6=8..9) | (p7=8..9) | (p8=8..9) | (p9=8..9) | (p10=8..9); |
|||
// liveness (if a philosopher is hungry then eventually some philosopher eats) |
|||
"hungry" => P>=1 [ true U "eat"] |
|||
@ -1,4 +0,0 @@ |
|||
label "hungry" = ((p1>0) & (p1<8)) | ((p2>0) & (p2<8)) | ((p3>0) & (p3<8)) | ((p4>0) & (p4<8)) | ((p5>0) & (p5<8)) | ((p6>0) & (p6<8)) | ((p7>0) & (p7<8)) | ((p8>0) & (p8<8)) | ((p9>0) & (p9<8)) | ((p10>0) & (p10<8)) | ((p11>0) & (p11<8)) | ((p12>0) & (p12<8)) | ((p13>0) & (p13<8)) | ((p14>0) & (p14<8)) | ((p15>0) & (p15<8)); |
|||
label "eat" = (p1=8..9) | (p2=8..9) | (p3=8..9) | (p4=8..9) | (p5=8..9) | (p6=8..9) | (p7=8..9) | (p8=8..9) | (p9=8..9) | (p10=8..9) | (p11=8..9) | (p12=8..9) | (p13=8..9) | (p14=8..9) | (p15=8..9); |
|||
// liveness (if a philosopher is hungry then eventually some philosopher eats) |
|||
"hungry" => P>=1 [ true U "eat"] |
|||
@ -1,4 +0,0 @@ |
|||
label "hungry" = ((p1>0) & (p1<8)) | ((p2>0) & (p2<8)) | ((p3>0) & (p3<8)) | ((p4>0) & (p4<8)) | ((p5>0) & (p5<8)) | ((p6>0) & (p6<8)) | ((p7>0) & (p7<8)) | ((p8>0) & (p8<8)) | ((p9>0) & (p9<8)) | ((p10>0) & (p10<8)) | ((p11>0) & (p11<8)) | ((p12>0) & (p12<8)) | ((p13>0) & (p13<8)) | ((p14>0) & (p14<8)) | ((p15>0) & (p15<8)) | ((p16>0) & (p16<8)) | ((p17>0) & (p17<8)) | ((p18>0) & (p18<8)) | ((p19>0) & (p19<8)) | ((p20>0) & (p20<8)); |
|||
label "eat" = (p1=8..9) | (p2=8..9) | (p3=8..9) | (p4=8..9) | (p5=8..9) | (p6=8..9) | (p7=8..9) | (p8=8..9) | (p9=8..9) | (p10=8..9) | (p11=8..9) | (p12=8..9) | (p13=8..9) | (p14=8..9) | (p15=8..9) | (p16=8..9) | (p17=8..9) | (p18=8..9) | (p19=8..9) | (p20=8..9); |
|||
// liveness (if a philosopher is hungry then eventually some philosopher eats) |
|||
"hungry" => P>=1 [ true U "eat"] |
|||
@ -1,4 +0,0 @@ |
|||
label "hungry" = ((p1>0) & (p1<8)) | ((p2>0) & (p2<8)) | ((p3>0) & (p3<8)) | ((p4>0) & (p4<8)) | ((p5>0) & (p5<8)) | ((p6>0) & (p6<8)) | ((p7>0) & (p7<8)) | ((p8>0) & (p8<8)) | ((p9>0) & (p9<8)) | ((p10>0) & (p10<8)) | ((p11>0) & (p11<8)) | ((p12>0) & (p12<8)) | ((p13>0) & (p13<8)) | ((p14>0) & (p14<8)) | ((p15>0) & (p15<8)) | ((p16>0) & (p16<8)) | ((p17>0) & (p17<8)) | ((p18>0) & (p18<8)) | ((p19>0) & (p19<8)) | ((p20>0) & (p20<8)) | ((p21>0) & (p21<8)) | ((p22>0) & (p22<8)) | ((p23>0) & (p23<8)) | ((p24>0) & (p24<8)) | ((p25>0) & (p25<8)); |
|||
label "eat" = (p1=8..9) | (p2=8..9) | (p3=8..9) | (p4=8..9) | (p5=8..9) | (p6=8..9) | (p7=8..9) | (p8=8..9) | (p9=8..9) | (p10=8..9) | (p11=8..9) | (p12=8..9) | (p13=8..9) | (p14=8..9) | (p15=8..9) | (p16=8..9) | (p17=8..9) | (p18=8..9) | (p19=8..9) | (p20=8..9) | (p21=8..9) | (p22=8..9) | (p23=8..9) | (p24=8..9) | (p25=8..9); |
|||
// liveness (if a philosopher is hungry then eventually some philosopher eats) |
|||
"hungry" => P>=1 [ true U "eat"] |
|||
@ -1,4 +0,0 @@ |
|||
label "hungry" = ((p1>0) & (p1<8)) | ((p2>0) & (p2<8)) | ((p3>0) & (p3<8)); |
|||
label "eat" = (p1=8..9) | (p2=8..9) | (p3=8..9); |
|||
// liveness (if a philosopher is hungry then eventually some philosopher eats) |
|||
"hungry" => P>=1 [ true U "eat"] |
|||
@ -1,4 +0,0 @@ |
|||
label "hungry" = ((p1>0) & (p1<8)) | ((p2>0) & (p2<8)) | ((p3>0) & (p3<8)) | ((p4>0) & (p4<8)) | ((p5>0) & (p5<8)) | ((p6>0) & (p6<8)) | ((p7>0) & (p7<8)) | ((p8>0) & (p8<8)) | ((p9>0) & (p9<8)) | ((p10>0) & (p10<8)) | ((p11>0) & (p11<8)) | ((p12>0) & (p12<8)) | ((p13>0) & (p13<8)) | ((p14>0) & (p14<8)) | ((p15>0) & (p15<8)) | ((p16>0) & (p16<8)) | ((p17>0) & (p17<8)) | ((p18>0) & (p18<8)) | ((p19>0) & (p19<8)) | ((p20>0) & (p20<8)) | ((p21>0) & (p21<8)) | ((p22>0) & (p22<8)) | ((p23>0) & (p23<8)) | ((p24>0) & (p24<8)) | ((p25>0) & (p25<8)) | ((p26>0) & (p26<8)) | ((p27>0) & (p27<8)) | ((p28>0) & (p28<8)) | ((p29>0) & (p29<8)) | ((p30>0) & (p30<8)); |
|||
label "eat" = (p1=8..9) | (p2=8..9) | (p3=8..9) | (p4=8..9) | (p5=8..9) | (p6=8..9) | (p7=8..9) | (p8=8..9) | (p9=8..9) | (p10=8..9) | (p11=8..9) | (p12=8..9) | (p13=8..9) | (p14=8..9) | (p15=8..9) | (p16=8..9) | (p17=8..9) | (p18=8..9) | (p19=8..9) | (p20=8..9) | (p21=8..9) | (p22=8..9) | (p23=8..9) | (p24=8..9) | (p25=8..9) | (p26=8..9) | (p27=8..9) | (p28=8..9) | (p29=8..9) | (p30=8..9); |
|||
// liveness (if a philosopher is hungry then eventually some philosopher eats) |
|||
"hungry" => P>=1 [ true U "eat"] |
|||
@ -1,4 +0,0 @@ |
|||
label "hungry" = ((p1>0) & (p1<8)) | ((p2>0) & (p2<8)) | ((p3>0) & (p3<8)) | ((p4>0) & (p4<8)); |
|||
label "eat" = (p1=8..9) | (p2=8..9) | (p3=8..9) | (p4=8..9); |
|||
// liveness (if a philosopher is hungry then eventually some philosopher eats) |
|||
"hungry" => P>=1 [ true U "eat"] |
|||
@ -1,4 +0,0 @@ |
|||
label "hungry" = ((p1>0) & (p1<8)) | ((p2>0) & (p2<8)) | ((p3>0) & (p3<8)) | ((p4>0) & (p4<8)) | ((p5>0) & (p5<8)); |
|||
label "eat" = (p1=8..9) | (p2=8..9) | (p3=8..9) | (p4=8..9) | (p5=8..9); |
|||
// liveness (if a philosopher is hungry then eventually some philosopher eats) |
|||
"hungry" => P>=1 [ true U "eat"] |
|||
@ -1,4 +0,0 @@ |
|||
label "hungry" = ((p1>0) & (p1<8)) | ((p2>0) & (p2<8)) | ((p3>0) & (p3<8)) | ((p4>0) & (p4<8)) | ((p5>0) & (p5<8)) | ((p6>0) & (p6<8)); |
|||
label "eat" = (p1=8..9) | (p2=8..9) | (p3=8..9) | (p4=8..9) | (p5=8..9) | (p6=8..9); |
|||
// liveness (if a philosopher is hungry then eventually some philosopher eats) |
|||
"hungry" => P>=1 [ true U "eat"] |
|||
@ -1,4 +0,0 @@ |
|||
label "hungry" = ((p1>0) & (p1<8)) | ((p2>0) & (p2<8)) | ((p3>0) & (p3<8)) | ((p4>0) & (p4<8)) | ((p5>0) & (p5<8)) | ((p6>0) & (p6<8)) | ((p7>0) & (p7<8)); |
|||
label "eat" = (p1=8..9) | (p2=8..9) | (p3=8..9) | (p4=8..9) | (p5=8..9) | (p6=8..9) | (p7=8..9); |
|||
// liveness (if a philosopher is hungry then eventually some philosopher eats) |
|||
"hungry" => P>=1 [ true U "eat"] |
|||
@ -1,4 +0,0 @@ |
|||
label "hungry" = ((p1>0) & (p1<8)) | ((p2>0) & (p2<8)) | ((p3>0) & (p3<8)) | ((p4>0) & (p4<8)) | ((p5>0) & (p5<8)) | ((p6>0) & (p6<8)) | ((p7>0) & (p7<8)) | ((p8>0) & (p8<8)); |
|||
label "eat" = (p1=8..9) | (p2=8..9) | (p3=8..9) | (p4=8..9) | (p5=8..9) | (p6=8..9) | (p7=8..9) | (p8=8..9); |
|||
// liveness (if a philosopher is hungry then eventually some philosopher eats) |
|||
"hungry" => P>=1 [ true U "eat"] |
|||
@ -1,4 +0,0 @@ |
|||
label "hungry" = ((p1>0) & (p1<8)) | ((p2>0) & (p2<8)) | ((p3>0) & (p3<8)) | ((p4>0) & (p4<8)) | ((p5>0) & (p5<8)) | ((p6>0) & (p6<8)) | ((p7>0) & (p7<8)) | ((p8>0) & (p8<8)) | ((p9>0) & (p9<8)); |
|||
label "eat" = (p1=8..9) | (p2=8..9) | (p3=8..9) | (p4=8..9) | (p5=8..9) | (p6=8..9) | (p7=8..9) | (p8=8..9) | (p9=8..9); |
|||
// liveness (if a philosopher is hungry then eventually some philosopher eats) |
|||
"hungry" => P>=1 [ true U "eat"] |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue