Browse Source
Herman: tidy up + pp files.
Herman: tidy up + pp files.
git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@455 bbc10eb1-c90d-0410-af57-cb519fbb1720master
22 changed files with 443 additions and 571 deletions
-
7prism-examples/self-stabilisation/herman/.autopp
-
36prism-examples/self-stabilisation/herman/.hermanN.pm.pp
-
12prism-examples/self-stabilisation/herman/auto
-
8prism-examples/self-stabilisation/herman/herman.pctl
-
19prism-examples/self-stabilisation/herman/herman11.pctl
-
84prism-examples/self-stabilisation/herman/herman11.pm
-
19prism-examples/self-stabilisation/herman/herman13.pctl
-
88prism-examples/self-stabilisation/herman/herman13.pm
-
19prism-examples/self-stabilisation/herman/herman15.pctl
-
92prism-examples/self-stabilisation/herman/herman15.pm
-
19prism-examples/self-stabilisation/herman/herman17.pctl
-
96prism-examples/self-stabilisation/herman/herman17.pm
-
19prism-examples/self-stabilisation/herman/herman19.pctl
-
100prism-examples/self-stabilisation/herman/herman19.pm
-
19prism-examples/self-stabilisation/herman/herman21.pctl
-
104prism-examples/self-stabilisation/herman/herman21.pm
-
68prism-examples/self-stabilisation/herman/herman3.pm
-
19prism-examples/self-stabilisation/herman/herman5.pctl
-
72prism-examples/self-stabilisation/herman/herman5.pm
-
19prism-examples/self-stabilisation/herman/herman7.pctl
-
76prism-examples/self-stabilisation/herman/herman7.pm
-
19prism-examples/self-stabilisation/herman/herman9.pctl
@ -0,0 +1,7 @@ |
|||
#!/bin/csh |
|||
|
|||
foreach N ( 3 5 7 11 13 15 17 19 21 ) |
|||
echo "Generating for N=$N" |
|||
prismpp .hermanN.pm.pp $N >! herman$N.pm |
|||
unix2dos herman$N.pm |
|||
end |
|||
@ -0,0 +1,36 @@ |
|||
#const N# |
|||
// herman's self stabilising algorithm [Her90] |
|||
// gxn/dxp 13/07/02 |
|||
|
|||
// the procotol is synchronous with no nondeterminism (a DTMC) |
|||
dtmc |
|||
|
|||
// module for process 1 |
|||
module process1 |
|||
|
|||
// Boolean variable for process 1 |
|||
x1 : [0..1]; |
|||
|
|||
[step] (x1=x#N#) -> 0.5 : (x1'=0) + 0.5 : (x1'=1); |
|||
[step] !(x1=x#N#) -> (x1'=x#N#); |
|||
|
|||
endmodule |
|||
|
|||
// add further processes through renaming |
|||
#for i=2:N# |
|||
module process#i# = process1 [ x1=x#i#, x#N#=x#i-1# ] endmodule |
|||
#end# |
|||
|
|||
// cost - 1 in each state (expected number of steps) |
|||
rewards "steps" |
|||
|
|||
true : 1; |
|||
|
|||
endrewards |
|||
|
|||
// set of initial states: all (i.e. any possible initial configuration of tokens) |
|||
init true endinit |
|||
|
|||
// formula, for use in properties: number of tokens |
|||
// (i.e. number of processes that have the same value as the process to their left) |
|||
formula num_tokens = #+ i=1:N#(x#i#=x#func(mod, i, N)+1#?1:0)#end#; |
|||
@ -1,6 +1,6 @@ |
|||
#!/bin/csh |
|||
|
|||
prism herman7.pm herman7.pctl -prop 1 -const k=0 |
|||
prism herman7.pm herman7.pctl -prop 2 -const k=0 |
|||
prism herman7.pm herman7.pctl -prop 3 -const k=1:2:7 |
|||
prism herman7.pm herman7.pctl -prop 4 -const k=1:2:7 |
|||
#!/bin/csh |
|||
|
|||
prism herman7.pm herman.pctl -prop 1 -const k=0 |
|||
prism herman7.pm herman.pctl -prop 2 -const k=0 |
|||
prism herman7.pm herman.pctl -prop 3 -const k=1:2:7 |
|||
prism herman7.pm herman.pctl -prop 4 -const k=1:2:7 |
|||
@ -1,13 +1,13 @@ |
|||
const int k; |
|||
|
|||
// States with k tokens - where only k processes have the same value as the process to its left |
|||
label "k_tokens" = (x1=x2?1:0)+(x2=x3?1:0)+(x3=x1?1:0) = k; |
|||
// States with k tokens |
|||
label "k_tokens" = num_tokens=k; |
|||
|
|||
// Stable states - where only one process has a token |
|||
label "stable" = (x1=x2?1:0)+(x2=x3?1:0)+(x3=x1?1:0) = 1; |
|||
label "stable" = num_tokens=1; |
|||
|
|||
// A stable state is reached with probability 1 |
|||
"init" => P>=1 [ true U "stable" ] |
|||
"init" => P>=1 [ F "stable" ] |
|||
|
|||
// Maximum expected time to reach a stable state (for all configurations) |
|||
R=? [ F "stable" {"init"}{max} ] |
|||
@ -1,19 +0,0 @@ |
|||
const int k; |
|||
|
|||
// States with k tokens - where only k processes have the same value as the process to its left |
|||
label "k_tokens" = (x1=x2?1:0)+(x2=x3?1:0)+(x3=x4?1:0)+(x4=x5?1:0)+(x5=x6?1:0)+(x6=x7?1:0)+(x7=x8?1:0)+(x8=x9?1:0)+(x9=x10?1:0)+(x10=x11?1:0)+(x11=x1?1:0) = k; |
|||
|
|||
// Stable states - where only one process has a token |
|||
label "stable" = (x1=x2?1:0)+(x2=x3?1:0)+(x3=x4?1:0)+(x4=x5?1:0)+(x5=x6?1:0)+(x6=x7?1:0)+(x7=x8?1:0)+(x8=x9?1:0)+(x9=x10?1:0)+(x10=x11?1:0)+(x11=x1?1:0) = 1; |
|||
|
|||
// A stable state is reached with probability 1 |
|||
"init" => P>=1 [ true U "stable" ] |
|||
|
|||
// Maximum expected time to reach a stable state (for all configurations) |
|||
R=? [ F "stable" {"init"}{max} ] |
|||
|
|||
// Maximum expected time to reach a stable state (for all k-token configurations) |
|||
R=? [ F "stable" {"k_tokens"}{max} ] |
|||
|
|||
// Minimum expected time to reach a stable state (for all k-token configurations) |
|||
R=? [ F "stable" {"k_tokens"}{min} ] |
|||
@ -1,42 +1,42 @@ |
|||
// herman's self stabilising algorithm [Her90] |
|||
// gxn/dxp 13/07/02 |
|||
|
|||
// the procotol is synchronous with no non-determinism (a DTMC) |
|||
dtmc |
|||
|
|||
// module for process 1 |
|||
module process1 |
|||
|
|||
// Boolean variable for process 1 |
|||
x1 : [0..1]; |
|||
|
|||
[step] (x1=x11) -> 0.5 : (x1'=0) + 0.5 : (x1'=1); |
|||
[step] !(x1=x11) -> (x1'=x11); |
|||
|
|||
endmodule |
|||
|
|||
// add further processes through renaming |
|||
module process2 = process1[x1=x2, x11=x1 ] endmodule |
|||
module process3 = process1[x1=x3, x11=x2 ] endmodule |
|||
module process4 = process1[x1=x4, x11=x3 ] endmodule |
|||
module process5 = process1[x1=x5, x11=x4 ] endmodule |
|||
module process6 = process1[x1=x6, x11=x5 ] endmodule |
|||
module process7 = process1[x1=x7, x11=x6 ] endmodule |
|||
module process8 = process1[x1=x8, x11=x7 ] endmodule |
|||
module process9 = process1[x1=x9, x11=x8 ] endmodule |
|||
module process10 = process1[x1=x10, x11=x9 ] endmodule |
|||
module process11 = process1[x1=x11, x11=x10 ] endmodule |
|||
|
|||
// cost - 1 in each state (expected steps) |
|||
rewards |
|||
|
|||
true : 1; |
|||
|
|||
endrewards |
|||
|
|||
// any initial state (consider any possible initial configuration of tokens) |
|||
init |
|||
|
|||
true |
|||
|
|||
endinit |
|||
// herman's self stabilising algorithm [Her90] |
|||
// gxn/dxp 13/07/02 |
|||
|
|||
// the procotol is synchronous with no nondeterminism (a DTMC) |
|||
dtmc |
|||
|
|||
// module for process 1 |
|||
module process1 |
|||
|
|||
// Boolean variable for process 1 |
|||
x1 : [0..1]; |
|||
|
|||
[step] (x1=x11) -> 0.5 : (x1'=0) + 0.5 : (x1'=1); |
|||
[step] !(x1=x11) -> (x1'=x11); |
|||
|
|||
endmodule |
|||
|
|||
// add further processes through renaming |
|||
module process2 = process1 [ x1=x2, x11=x1 ] endmodule |
|||
module process3 = process1 [ x1=x3, x11=x2 ] endmodule |
|||
module process4 = process1 [ x1=x4, x11=x3 ] endmodule |
|||
module process5 = process1 [ x1=x5, x11=x4 ] endmodule |
|||
module process6 = process1 [ x1=x6, x11=x5 ] endmodule |
|||
module process7 = process1 [ x1=x7, x11=x6 ] endmodule |
|||
module process8 = process1 [ x1=x8, x11=x7 ] endmodule |
|||
module process9 = process1 [ x1=x9, x11=x8 ] endmodule |
|||
module process10 = process1 [ x1=x10, x11=x9 ] endmodule |
|||
module process11 = process1 [ x1=x11, x11=x10 ] endmodule |
|||
|
|||
// cost - 1 in each state (expected number of steps) |
|||
rewards "steps" |
|||
|
|||
true : 1; |
|||
|
|||
endrewards |
|||
|
|||
// set of initial states: all (i.e. any possible initial configuration of tokens) |
|||
init true endinit |
|||
|
|||
// formula, for use in properties: number of tokens |
|||
// (i.e. number of processes that have the same value as the process to their left) |
|||
formula num_tokens = (x1=x2?1:0)+(x2=x3?1:0)+(x3=x4?1:0)+(x4=x5?1:0)+(x5=x6?1:0)+(x6=x7?1:0)+(x7=x8?1:0)+(x8=x9?1:0)+(x9=x10?1:0)+(x10=x11?1:0)+(x11=x1?1:0); |
|||
@ -1,19 +0,0 @@ |
|||
const int k; |
|||
|
|||
// States with k tokens - where only k processes have the same value as the process to its left |
|||
label "k_tokens" = (x1=x2?1:0)+(x2=x3?1:0)+(x3=x4?1:0)+(x4=x5?1:0)+(x5=x6?1:0)+(x6=x7?1:0)+(x7=x8?1:0)+(x8=x9?1:0)+(x9=x10?1:0)+(x10=x11?1:0)+(x11=x12?1:0)+(x12=x13?1:0)+(x13=x1?1:0) = k; |
|||
|
|||
// Stable states - where only one process has a token |
|||
label "stable" = (x1=x2?1:0)+(x2=x3?1:0)+(x3=x4?1:0)+(x4=x5?1:0)+(x5=x6?1:0)+(x6=x7?1:0)+(x7=x8?1:0)+(x8=x9?1:0)+(x9=x10?1:0)+(x10=x11?1:0)+(x11=x12?1:0)+(x12=x13?1:0)+(x13=x1?1:0) = 1; |
|||
|
|||
// A stable state is reached with probability 1 |
|||
"init" => P>=1 [ true U "stable" ] |
|||
|
|||
// Maximum expected time to reach a stable state (for all configurations) |
|||
R=? [ F "stable" {"init"}{max} ] |
|||
|
|||
// Maximum expected time to reach a stable state (for all k-token configurations) |
|||
R=? [ F "stable" {"k_tokens"}{max} ] |
|||
|
|||
// Minimum expected time to reach a stable state (for all k-token configurations) |
|||
R=? [ F "stable" {"k_tokens"}{min} ] |
|||
@ -1,44 +1,44 @@ |
|||
// herman's self stabilising algorithm [Her90] |
|||
// gxn/dxp 13/07/02 |
|||
|
|||
// the procotol is synchronous with no non-determinism (a DTMC) |
|||
dtmc |
|||
|
|||
// module for process 1 |
|||
module process1 |
|||
|
|||
// Boolean variable for process 1 |
|||
x1 : [0..1]; |
|||
|
|||
[step] (x1=x13) -> 0.5 : (x1'=0) + 0.5 : (x1'=1); |
|||
[step] !(x1=x13) -> (x1'=x13); |
|||
|
|||
endmodule |
|||
|
|||
// add further processes through renaming |
|||
module process2 = process1[x1=x2, x13=x1 ] endmodule |
|||
module process3 = process1[x1=x3, x13=x2 ] endmodule |
|||
module process4 = process1[x1=x4, x13=x3 ] endmodule |
|||
module process5 = process1[x1=x5, x13=x4 ] endmodule |
|||
module process6 = process1[x1=x6, x13=x5 ] endmodule |
|||
module process7 = process1[x1=x7, x13=x6 ] endmodule |
|||
module process8 = process1[x1=x8, x13=x7 ] endmodule |
|||
module process9 = process1[x1=x9, x13=x8 ] endmodule |
|||
module process10 = process1[x1=x10, x13=x9 ] endmodule |
|||
module process11 = process1[x1=x11, x13=x10 ] endmodule |
|||
module process12 = process1[x1=x12, x13=x11 ] endmodule |
|||
module process13 = process1[x1=x13, x13=x12 ] endmodule |
|||
|
|||
// cost - 1 in each state (expected steps) |
|||
rewards |
|||
|
|||
true : 1; |
|||
|
|||
endrewards |
|||
|
|||
// any initial state (consider any possible initial configuration of tokens) |
|||
init |
|||
|
|||
true |
|||
|
|||
endinit |
|||
// herman's self stabilising algorithm [Her90] |
|||
// gxn/dxp 13/07/02 |
|||
|
|||
// the procotol is synchronous with no nondeterminism (a DTMC) |
|||
dtmc |
|||
|
|||
// module for process 1 |
|||
module process1 |
|||
|
|||
// Boolean variable for process 1 |
|||
x1 : [0..1]; |
|||
|
|||
[step] (x1=x13) -> 0.5 : (x1'=0) + 0.5 : (x1'=1); |
|||
[step] !(x1=x13) -> (x1'=x13); |
|||
|
|||
endmodule |
|||
|
|||
// add further processes through renaming |
|||
module process2 = process1 [ x1=x2, x13=x1 ] endmodule |
|||
module process3 = process1 [ x1=x3, x13=x2 ] endmodule |
|||
module process4 = process1 [ x1=x4, x13=x3 ] endmodule |
|||
module process5 = process1 [ x1=x5, x13=x4 ] endmodule |
|||
module process6 = process1 [ x1=x6, x13=x5 ] endmodule |
|||
module process7 = process1 [ x1=x7, x13=x6 ] endmodule |
|||
module process8 = process1 [ x1=x8, x13=x7 ] endmodule |
|||
module process9 = process1 [ x1=x9, x13=x8 ] endmodule |
|||
module process10 = process1 [ x1=x10, x13=x9 ] endmodule |
|||
module process11 = process1 [ x1=x11, x13=x10 ] endmodule |
|||
module process12 = process1 [ x1=x12, x13=x11 ] endmodule |
|||
module process13 = process1 [ x1=x13, x13=x12 ] endmodule |
|||
|
|||
// cost - 1 in each state (expected number of steps) |
|||
rewards "steps" |
|||
|
|||
true : 1; |
|||
|
|||
endrewards |
|||
|
|||
// set of initial states: all (i.e. any possible initial configuration of tokens) |
|||
init true endinit |
|||
|
|||
// formula, for use in properties: number of tokens |
|||
// (i.e. number of processes that have the same value as the process to their left) |
|||
formula num_tokens = (x1=x2?1:0)+(x2=x3?1:0)+(x3=x4?1:0)+(x4=x5?1:0)+(x5=x6?1:0)+(x6=x7?1:0)+(x7=x8?1:0)+(x8=x9?1:0)+(x9=x10?1:0)+(x10=x11?1:0)+(x11=x12?1:0)+(x12=x13?1:0)+(x13=x1?1:0); |
|||
@ -1,19 +0,0 @@ |
|||
const int k; |
|||
|
|||
// States with k tokens - where only k processes have the same value as the process to its left |
|||
label "k_tokens" = (x1=x2?1:0)+(x2=x3?1:0)+(x3=x4?1:0)+(x4=x5?1:0)+(x5=x6?1:0)+(x6=x7?1:0)+(x7=x8?1:0)+(x8=x9?1:0)+(x9=x10?1:0)+(x10=x11?1:0)+(x11=x12?1:0)+(x12=x13?1:0)+(x13=x14?1:0)+(x14=x15?1:0)+(x15=x1?1:0) = k; |
|||
|
|||
// Stable states - where only one process has a token |
|||
label "stable" = (x1=x2?1:0)+(x2=x3?1:0)+(x3=x4?1:0)+(x4=x5?1:0)+(x5=x6?1:0)+(x6=x7?1:0)+(x7=x8?1:0)+(x8=x9?1:0)+(x9=x10?1:0)+(x10=x11?1:0)+(x11=x12?1:0)+(x12=x13?1:0)+(x13=x14?1:0)+(x14=x15?1:0)+(x15=x1?1:0) = 1; |
|||
|
|||
// A stable state is reached with probability 1 |
|||
"init" => P>=1 [ true U "stable" ] |
|||
|
|||
// Maximum expected time to reach a stable state (for all configurations) |
|||
R=? [ F "stable" {"init"}{max} ] |
|||
|
|||
// Maximum expected time to reach a stable state (for all k-token configurations) |
|||
R=? [ F "stable" {"k_tokens"}{max} ] |
|||
|
|||
// Minimum expected time to reach a stable state (for all k-token configurations) |
|||
R=? [ F "stable" {"k_tokens"}{min} ] |
|||
@ -1,46 +1,46 @@ |
|||
// herman's self stabilising algorithm [Her90] |
|||
// gxn/dxp 13/07/02 |
|||
|
|||
// the procotol is synchronous with no non-determinism (a DTMC) |
|||
dtmc |
|||
|
|||
// module for process 1 |
|||
module process1 |
|||
|
|||
// Boolean variable for process 1 |
|||
x1 : [0..1]; |
|||
|
|||
[step] (x1=x15) -> 0.5 : (x1'=0) + 0.5 : (x1'=1); |
|||
[step] !(x1=x15) -> (x1'=x15); |
|||
|
|||
endmodule |
|||
|
|||
// add further processes through renaming |
|||
module process2 = process1[x1=x2, x15=x1 ] endmodule |
|||
module process3 = process1[x1=x3, x15=x2 ] endmodule |
|||
module process4 = process1[x1=x4, x15=x3 ] endmodule |
|||
module process5 = process1[x1=x5, x15=x4 ] endmodule |
|||
module process6 = process1[x1=x6, x15=x5 ] endmodule |
|||
module process7 = process1[x1=x7, x15=x6 ] endmodule |
|||
module process8 = process1[x1=x8, x15=x7 ] endmodule |
|||
module process9 = process1[x1=x9, x15=x8 ] endmodule |
|||
module process10 = process1[x1=x10, x15=x9 ] endmodule |
|||
module process11 = process1[x1=x11, x15=x10 ] endmodule |
|||
module process12 = process1[x1=x12, x15=x11 ] endmodule |
|||
module process13 = process1[x1=x13, x15=x12 ] endmodule |
|||
module process14 = process1[x1=x14, x15=x13 ] endmodule |
|||
module process15 = process1[x1=x15, x15=x14 ] endmodule |
|||
|
|||
// cost - 1 in each state (expected steps) |
|||
rewards |
|||
|
|||
true : 1; |
|||
|
|||
endrewards |
|||
|
|||
// any initial state (consider any possible initial configuration of tokens) |
|||
init |
|||
|
|||
true |
|||
|
|||
endinit |
|||
// herman's self stabilising algorithm [Her90] |
|||
// gxn/dxp 13/07/02 |
|||
|
|||
// the procotol is synchronous with no nondeterminism (a DTMC) |
|||
dtmc |
|||
|
|||
// module for process 1 |
|||
module process1 |
|||
|
|||
// Boolean variable for process 1 |
|||
x1 : [0..1]; |
|||
|
|||
[step] (x1=x15) -> 0.5 : (x1'=0) + 0.5 : (x1'=1); |
|||
[step] !(x1=x15) -> (x1'=x15); |
|||
|
|||
endmodule |
|||
|
|||
// add further processes through renaming |
|||
module process2 = process1 [ x1=x2, x15=x1 ] endmodule |
|||
module process3 = process1 [ x1=x3, x15=x2 ] endmodule |
|||
module process4 = process1 [ x1=x4, x15=x3 ] endmodule |
|||
module process5 = process1 [ x1=x5, x15=x4 ] endmodule |
|||
module process6 = process1 [ x1=x6, x15=x5 ] endmodule |
|||
module process7 = process1 [ x1=x7, x15=x6 ] endmodule |
|||
module process8 = process1 [ x1=x8, x15=x7 ] endmodule |
|||
module process9 = process1 [ x1=x9, x15=x8 ] endmodule |
|||
module process10 = process1 [ x1=x10, x15=x9 ] endmodule |
|||
module process11 = process1 [ x1=x11, x15=x10 ] endmodule |
|||
module process12 = process1 [ x1=x12, x15=x11 ] endmodule |
|||
module process13 = process1 [ x1=x13, x15=x12 ] endmodule |
|||
module process14 = process1 [ x1=x14, x15=x13 ] endmodule |
|||
module process15 = process1 [ x1=x15, x15=x14 ] endmodule |
|||
|
|||
// cost - 1 in each state (expected number of steps) |
|||
rewards "steps" |
|||
|
|||
true : 1; |
|||
|
|||
endrewards |
|||
|
|||
// set of initial states: all (i.e. any possible initial configuration of tokens) |
|||
init true endinit |
|||
|
|||
// formula, for use in properties: number of tokens |
|||
// (i.e. number of processes that have the same value as the process to their left) |
|||
formula num_tokens = (x1=x2?1:0)+(x2=x3?1:0)+(x3=x4?1:0)+(x4=x5?1:0)+(x5=x6?1:0)+(x6=x7?1:0)+(x7=x8?1:0)+(x8=x9?1:0)+(x9=x10?1:0)+(x10=x11?1:0)+(x11=x12?1:0)+(x12=x13?1:0)+(x13=x14?1:0)+(x14=x15?1:0)+(x15=x1?1:0); |
|||
@ -1,19 +0,0 @@ |
|||
const int k; |
|||
|
|||
// States with k tokens - where only k processes have the same value as the process to its left |
|||
label "k_tokens" = (x1=x2?1:0)+(x2=x3?1:0)+(x3=x4?1:0)+(x4=x5?1:0)+(x5=x6?1:0)+(x6=x7?1:0)+(x7=x8?1:0)+(x8=x9?1:0)+(x9=x10?1:0)+(x10=x11?1:0)+(x11=x12?1:0)+(x12=x13?1:0)+(x13=x14?1:0)+(x14=x15?1:0)+(x15=x16?1:0)+(x16=x17?1:0)+(x17=x1?1:0) = k; |
|||
|
|||
// Stable states - where only one process has a token |
|||
label "stable" = (x1=x2?1:0)+(x2=x3?1:0)+(x3=x4?1:0)+(x4=x5?1:0)+(x5=x6?1:0)+(x6=x7?1:0)+(x7=x8?1:0)+(x8=x9?1:0)+(x9=x10?1:0)+(x10=x11?1:0)+(x11=x12?1:0)+(x12=x13?1:0)+(x13=x14?1:0)+(x14=x15?1:0)+(x15=x16?1:0)+(x16=x17?1:0)+(x17=x1?1:0) = 1; |
|||
|
|||
// A stable state is reached with probability 1 |
|||
"init" => P>=1 [ true U "stable" ] |
|||
|
|||
// Maximum expected time to reach a stable state (for all configurations) |
|||
R=? [ F "stable" {"init"}{max} ] |
|||
|
|||
// Maximum expected time to reach a stable state (for all k-token configurations) |
|||
R=? [ F "stable" {"k_tokens"}{max} ] |
|||
|
|||
// Minimum expected time to reach a stable state (for all k-token configurations) |
|||
R=? [ F "stable" {"k_tokens"}{min} ] |
|||
@ -1,48 +1,48 @@ |
|||
// herman's self stabilising algorithm [Her90] |
|||
// gxn/dxp 13/07/02 |
|||
|
|||
// the procotol is synchronous with no non-determinism (a DTMC) |
|||
dtmc |
|||
|
|||
// module for process 1 |
|||
module process1 |
|||
|
|||
// Boolean variable for process 1 |
|||
x1 : [0..1]; |
|||
|
|||
[step] (x1=x17) -> 0.5 : (x1'=0) + 0.5 : (x1'=1); |
|||
[step] !(x1=x17) -> (x1'=x17); |
|||
|
|||
endmodule |
|||
|
|||
// add further processes through renaming |
|||
module process2 = process1[x1=x2, x17=x1 ] endmodule |
|||
module process3 = process1[x1=x3, x17=x2 ] endmodule |
|||
module process4 = process1[x1=x4, x17=x3 ] endmodule |
|||
module process5 = process1[x1=x5, x17=x4 ] endmodule |
|||
module process6 = process1[x1=x6, x17=x5 ] endmodule |
|||
module process7 = process1[x1=x7, x17=x6 ] endmodule |
|||
module process8 = process1[x1=x8, x17=x7 ] endmodule |
|||
module process9 = process1[x1=x9, x17=x8 ] endmodule |
|||
module process10 = process1[x1=x10, x17=x9 ] endmodule |
|||
module process11 = process1[x1=x11, x17=x10 ] endmodule |
|||
module process12 = process1[x1=x12, x17=x11 ] endmodule |
|||
module process13 = process1[x1=x13, x17=x12 ] endmodule |
|||
module process14 = process1[x1=x14, x17=x13 ] endmodule |
|||
module process15 = process1[x1=x15, x17=x14 ] endmodule |
|||
module process16 = process1[x1=x16, x17=x15 ] endmodule |
|||
module process17 = process1[x1=x17, x17=x16 ] endmodule |
|||
|
|||
// cost - 1 in each state (expected steps) |
|||
rewards |
|||
|
|||
true : 1; |
|||
|
|||
endrewards |
|||
|
|||
// any initial state (consider any possible initial configuration of tokens) |
|||
init |
|||
|
|||
true |
|||
|
|||
endinit |
|||
// herman's self stabilising algorithm [Her90] |
|||
// gxn/dxp 13/07/02 |
|||
|
|||
// the procotol is synchronous with no nondeterminism (a DTMC) |
|||
dtmc |
|||
|
|||
// module for process 1 |
|||
module process1 |
|||
|
|||
// Boolean variable for process 1 |
|||
x1 : [0..1]; |
|||
|
|||
[step] (x1=x17) -> 0.5 : (x1'=0) + 0.5 : (x1'=1); |
|||
[step] !(x1=x17) -> (x1'=x17); |
|||
|
|||
endmodule |
|||
|
|||
// add further processes through renaming |
|||
module process2 = process1 [ x1=x2, x17=x1 ] endmodule |
|||
module process3 = process1 [ x1=x3, x17=x2 ] endmodule |
|||
module process4 = process1 [ x1=x4, x17=x3 ] endmodule |
|||
module process5 = process1 [ x1=x5, x17=x4 ] endmodule |
|||
module process6 = process1 [ x1=x6, x17=x5 ] endmodule |
|||
module process7 = process1 [ x1=x7, x17=x6 ] endmodule |
|||
module process8 = process1 [ x1=x8, x17=x7 ] endmodule |
|||
module process9 = process1 [ x1=x9, x17=x8 ] endmodule |
|||
module process10 = process1 [ x1=x10, x17=x9 ] endmodule |
|||
module process11 = process1 [ x1=x11, x17=x10 ] endmodule |
|||
module process12 = process1 [ x1=x12, x17=x11 ] endmodule |
|||
module process13 = process1 [ x1=x13, x17=x12 ] endmodule |
|||
module process14 = process1 [ x1=x14, x17=x13 ] endmodule |
|||
module process15 = process1 [ x1=x15, x17=x14 ] endmodule |
|||
module process16 = process1 [ x1=x16, x17=x15 ] endmodule |
|||
module process17 = process1 [ x1=x17, x17=x16 ] endmodule |
|||
|
|||
// cost - 1 in each state (expected number of steps) |
|||
rewards "steps" |
|||
|
|||
true : 1; |
|||
|
|||
endrewards |
|||
|
|||
// set of initial states: all (i.e. any possible initial configuration of tokens) |
|||
init true endinit |
|||
|
|||
// formula, for use in properties: number of tokens |
|||
// (i.e. number of processes that have the same value as the process to their left) |
|||
formula num_tokens = (x1=x2?1:0)+(x2=x3?1:0)+(x3=x4?1:0)+(x4=x5?1:0)+(x5=x6?1:0)+(x6=x7?1:0)+(x7=x8?1:0)+(x8=x9?1:0)+(x9=x10?1:0)+(x10=x11?1:0)+(x11=x12?1:0)+(x12=x13?1:0)+(x13=x14?1:0)+(x14=x15?1:0)+(x15=x16?1:0)+(x16=x17?1:0)+(x17=x1?1:0); |
|||
@ -1,19 +0,0 @@ |
|||
const int k; |
|||
|
|||
// States with k tokens - where only k processes have the same value as the process to its left |
|||
label "k_tokens" = (x1=x2?1:0)+(x2=x3?1:0)+(x3=x4?1:0)+(x4=x5?1:0)+(x5=x6?1:0)+(x6=x7?1:0)+(x7=x8?1:0)+(x8=x9?1:0)+(x9=x10?1:0)+(x10=x11?1:0)+(x11=x12?1:0)+(x12=x13?1:0)+(x13=x14?1:0)+(x14=x15?1:0)+(x15=x16?1:0)+(x16=x17?1:0)+(x17=x18?1:0)+(x18=x19?1:0)+(x19=x1?1:0) = k; |
|||
|
|||
// Stable states - where only one process has a token |
|||
label "stable" = (x1=x2?1:0)+(x2=x3?1:0)+(x3=x4?1:0)+(x4=x5?1:0)+(x5=x6?1:0)+(x6=x7?1:0)+(x7=x8?1:0)+(x8=x9?1:0)+(x9=x10?1:0)+(x10=x11?1:0)+(x11=x12?1:0)+(x12=x13?1:0)+(x13=x14?1:0)+(x14=x15?1:0)+(x15=x16?1:0)+(x16=x17?1:0)+(x17=x18?1:0)+(x18=x19?1:0)+(x19=x1?1:0) = 1; |
|||
|
|||
// A stable state is reached with probability 1 |
|||
"init" => P>=1 [ true U "stable" ] |
|||
|
|||
// Maximum expected time to reach a stable state (for all configurations) |
|||
R=? [ F "stable" {"init"}{max} ] |
|||
|
|||
// Maximum expected time to reach a stable state (for all k-token configurations) |
|||
R=? [ F "stable" {"k_tokens"}{max} ] |
|||
|
|||
// Minimum expected time to reach a stable state (for all k-token configurations) |
|||
R=? [ F "stable" {"k_tokens"}{min} ] |
|||
@ -1,50 +1,50 @@ |
|||
// herman's self stabilising algorithm [Her90] |
|||
// gxn/dxp 13/07/02 |
|||
|
|||
// the procotol is synchronous with no non-determinism (a DTMC) |
|||
dtmc |
|||
|
|||
// module for process 1 |
|||
module process1 |
|||
|
|||
// Boolean variable for process 1 |
|||
x1 : [0..1]; |
|||
|
|||
[step] (x1=x19) -> 0.5 : (x1'=0) + 0.5 : (x1'=1); |
|||
[step] !(x1=x19) -> (x1'=x19); |
|||
|
|||
endmodule |
|||
|
|||
// add further processes through renaming |
|||
module process2 = process1[x1=x2, x19=x1 ] endmodule |
|||
module process3 = process1[x1=x3, x19=x2 ] endmodule |
|||
module process4 = process1[x1=x4, x19=x3 ] endmodule |
|||
module process5 = process1[x1=x5, x19=x4 ] endmodule |
|||
module process6 = process1[x1=x6, x19=x5 ] endmodule |
|||
module process7 = process1[x1=x7, x19=x6 ] endmodule |
|||
module process8 = process1[x1=x8, x19=x7 ] endmodule |
|||
module process9 = process1[x1=x9, x19=x8 ] endmodule |
|||
module process10 = process1[x1=x10, x19=x9 ] endmodule |
|||
module process11 = process1[x1=x11, x19=x10 ] endmodule |
|||
module process12 = process1[x1=x12, x19=x11 ] endmodule |
|||
module process13 = process1[x1=x13, x19=x12 ] endmodule |
|||
module process14 = process1[x1=x14, x19=x13 ] endmodule |
|||
module process15 = process1[x1=x15, x19=x14 ] endmodule |
|||
module process16 = process1[x1=x16, x19=x15 ] endmodule |
|||
module process17 = process1[x1=x17, x19=x16 ] endmodule |
|||
module process18 = process1[x1=x18, x19=x17 ] endmodule |
|||
module process19 = process1[x1=x19, x19=x18 ] endmodule |
|||
|
|||
// cost - 1 in each state (expected steps) |
|||
rewards |
|||
|
|||
true : 1; |
|||
|
|||
endrewards |
|||
|
|||
// any initial state (consider any possible initial configuration of tokens) |
|||
init |
|||
|
|||
true |
|||
|
|||
endinit |
|||
// herman's self stabilising algorithm [Her90] |
|||
// gxn/dxp 13/07/02 |
|||
|
|||
// the procotol is synchronous with no nondeterminism (a DTMC) |
|||
dtmc |
|||
|
|||
// module for process 1 |
|||
module process1 |
|||
|
|||
// Boolean variable for process 1 |
|||
x1 : [0..1]; |
|||
|
|||
[step] (x1=x19) -> 0.5 : (x1'=0) + 0.5 : (x1'=1); |
|||
[step] !(x1=x19) -> (x1'=x19); |
|||
|
|||
endmodule |
|||
|
|||
// add further processes through renaming |
|||
module process2 = process1 [ x1=x2, x19=x1 ] endmodule |
|||
module process3 = process1 [ x1=x3, x19=x2 ] endmodule |
|||
module process4 = process1 [ x1=x4, x19=x3 ] endmodule |
|||
module process5 = process1 [ x1=x5, x19=x4 ] endmodule |
|||
module process6 = process1 [ x1=x6, x19=x5 ] endmodule |
|||
module process7 = process1 [ x1=x7, x19=x6 ] endmodule |
|||
module process8 = process1 [ x1=x8, x19=x7 ] endmodule |
|||
module process9 = process1 [ x1=x9, x19=x8 ] endmodule |
|||
module process10 = process1 [ x1=x10, x19=x9 ] endmodule |
|||
module process11 = process1 [ x1=x11, x19=x10 ] endmodule |
|||
module process12 = process1 [ x1=x12, x19=x11 ] endmodule |
|||
module process13 = process1 [ x1=x13, x19=x12 ] endmodule |
|||
module process14 = process1 [ x1=x14, x19=x13 ] endmodule |
|||
module process15 = process1 [ x1=x15, x19=x14 ] endmodule |
|||
module process16 = process1 [ x1=x16, x19=x15 ] endmodule |
|||
module process17 = process1 [ x1=x17, x19=x16 ] endmodule |
|||
module process18 = process1 [ x1=x18, x19=x17 ] endmodule |
|||
module process19 = process1 [ x1=x19, x19=x18 ] endmodule |
|||
|
|||
// cost - 1 in each state (expected number of steps) |
|||
rewards "steps" |
|||
|
|||
true : 1; |
|||
|
|||
endrewards |
|||
|
|||
// set of initial states: all (i.e. any possible initial configuration of tokens) |
|||
init true endinit |
|||
|
|||
// formula, for use in properties: number of tokens |
|||
// (i.e. number of processes that have the same value as the process to their left) |
|||
formula num_tokens = (x1=x2?1:0)+(x2=x3?1:0)+(x3=x4?1:0)+(x4=x5?1:0)+(x5=x6?1:0)+(x6=x7?1:0)+(x7=x8?1:0)+(x8=x9?1:0)+(x9=x10?1:0)+(x10=x11?1:0)+(x11=x12?1:0)+(x12=x13?1:0)+(x13=x14?1:0)+(x14=x15?1:0)+(x15=x16?1:0)+(x16=x17?1:0)+(x17=x18?1:0)+(x18=x19?1:0)+(x19=x1?1:0); |
|||
@ -1,19 +0,0 @@ |
|||
const int k; |
|||
|
|||
// States with k tokens - where only k processes have the same value as the process to its left |
|||
label "k_tokens" = (x1=x2?1:0)+(x2=x3?1:0)+(x3=x4?1:0)+(x4=x5?1:0)+(x5=x6?1:0)+(x6=x7?1:0)+(x7=x8?1:0)+(x8=x9?1:0)+(x9=x10?1:0)+(x10=x11?1:0)+(x11=x12?1:0)+(x12=x13?1:0)+(x13=x14?1:0)+(x14=x15?1:0)+(x15=x16?1:0)+(x16=x17?1:0)+(x17=x18?1:0)+(x18=x19?1:0)+(x19=x20?1:0)+(x20=x21?1:0)+(x21=x1?1:0) = k; |
|||
|
|||
// Stable states - where only one process has a token |
|||
label "stable" = (x1=x2?1:0)+(x2=x3?1:0)+(x3=x4?1:0)+(x4=x5?1:0)+(x5=x6?1:0)+(x6=x7?1:0)+(x7=x8?1:0)+(x8=x9?1:0)+(x9=x10?1:0)+(x10=x11?1:0)+(x11=x12?1:0)+(x12=x13?1:0)+(x13=x14?1:0)+(x14=x15?1:0)+(x15=x16?1:0)+(x16=x17?1:0)+(x17=x18?1:0)+(x18=x19?1:0)+(x19=x20?1:0)+(x20=x21?1:0)+(x21=x1?1:0) = 1; |
|||
|
|||
// A stable state is reached with probability 1 |
|||
"init" => P>=1 [ true U "stable" ] |
|||
|
|||
// Maximum expected time to reach a stable state (for all configurations) |
|||
R=? [ F "stable" {"init"}{max} ] |
|||
|
|||
// Maximum expected time to reach a stable state (for all k-token configurations) |
|||
R=? [ F "stable" {"k_tokens"}{max} ] |
|||
|
|||
// Minimum expected time to reach a stable state (for all k-token configurations) |
|||
R=? [ F "stable" {"k_tokens"}{min} ] |
|||
@ -1,52 +1,52 @@ |
|||
// herman's self stabilising algorithm [Her90] |
|||
// gxn/dxp 13/07/02 |
|||
|
|||
// the procotol is synchronous with no non-determinism (a DTMC) |
|||
dtmc |
|||
|
|||
// module for process 1 |
|||
module process1 |
|||
|
|||
// Boolean variable for process 1 |
|||
x1 : [0..1]; |
|||
|
|||
[step] (x1=x21) -> 0.5 : (x1'=0) + 0.5 : (x1'=1); |
|||
[step] !(x1=x21) -> (x1'=x21); |
|||
|
|||
endmodule |
|||
|
|||
// add further processes through renaming |
|||
module process2 = process1[x1=x2, x21=x1 ] endmodule |
|||
module process3 = process1[x1=x3, x21=x2 ] endmodule |
|||
module process4 = process1[x1=x4, x21=x3 ] endmodule |
|||
module process5 = process1[x1=x5, x21=x4 ] endmodule |
|||
module process6 = process1[x1=x6, x21=x5 ] endmodule |
|||
module process7 = process1[x1=x7, x21=x6 ] endmodule |
|||
module process8 = process1[x1=x8, x21=x7 ] endmodule |
|||
module process9 = process1[x1=x9, x21=x8 ] endmodule |
|||
module process10 = process1[x1=x10, x21=x9 ] endmodule |
|||
module process11 = process1[x1=x11, x21=x10 ] endmodule |
|||
module process12 = process1[x1=x12, x21=x11 ] endmodule |
|||
module process13 = process1[x1=x13, x21=x12 ] endmodule |
|||
module process14 = process1[x1=x14, x21=x13 ] endmodule |
|||
module process15 = process1[x1=x15, x21=x14 ] endmodule |
|||
module process16 = process1[x1=x16, x21=x15 ] endmodule |
|||
module process17 = process1[x1=x17, x21=x16 ] endmodule |
|||
module process18 = process1[x1=x18, x21=x17 ] endmodule |
|||
module process19 = process1[x1=x19, x21=x18 ] endmodule |
|||
module process20 = process1[x1=x20, x21=x19 ] endmodule |
|||
module process21 = process1[x1=x21, x21=x20 ] endmodule |
|||
|
|||
// cost - 1 in each state (expected steps) |
|||
rewards |
|||
|
|||
true : 1; |
|||
|
|||
endrewards |
|||
|
|||
// any initial state (consider any possible initial configuration of tokens) |
|||
init |
|||
|
|||
true |
|||
|
|||
endinit |
|||
// herman's self stabilising algorithm [Her90] |
|||
// gxn/dxp 13/07/02 |
|||
|
|||
// the procotol is synchronous with no nondeterminism (a DTMC) |
|||
dtmc |
|||
|
|||
// module for process 1 |
|||
module process1 |
|||
|
|||
// Boolean variable for process 1 |
|||
x1 : [0..1]; |
|||
|
|||
[step] (x1=x21) -> 0.5 : (x1'=0) + 0.5 : (x1'=1); |
|||
[step] !(x1=x21) -> (x1'=x21); |
|||
|
|||
endmodule |
|||
|
|||
// add further processes through renaming |
|||
module process2 = process1 [ x1=x2, x21=x1 ] endmodule |
|||
module process3 = process1 [ x1=x3, x21=x2 ] endmodule |
|||
module process4 = process1 [ x1=x4, x21=x3 ] endmodule |
|||
module process5 = process1 [ x1=x5, x21=x4 ] endmodule |
|||
module process6 = process1 [ x1=x6, x21=x5 ] endmodule |
|||
module process7 = process1 [ x1=x7, x21=x6 ] endmodule |
|||
module process8 = process1 [ x1=x8, x21=x7 ] endmodule |
|||
module process9 = process1 [ x1=x9, x21=x8 ] endmodule |
|||
module process10 = process1 [ x1=x10, x21=x9 ] endmodule |
|||
module process11 = process1 [ x1=x11, x21=x10 ] endmodule |
|||
module process12 = process1 [ x1=x12, x21=x11 ] endmodule |
|||
module process13 = process1 [ x1=x13, x21=x12 ] endmodule |
|||
module process14 = process1 [ x1=x14, x21=x13 ] endmodule |
|||
module process15 = process1 [ x1=x15, x21=x14 ] endmodule |
|||
module process16 = process1 [ x1=x16, x21=x15 ] endmodule |
|||
module process17 = process1 [ x1=x17, x21=x16 ] endmodule |
|||
module process18 = process1 [ x1=x18, x21=x17 ] endmodule |
|||
module process19 = process1 [ x1=x19, x21=x18 ] endmodule |
|||
module process20 = process1 [ x1=x20, x21=x19 ] endmodule |
|||
module process21 = process1 [ x1=x21, x21=x20 ] endmodule |
|||
|
|||
// cost - 1 in each state (expected number of steps) |
|||
rewards "steps" |
|||
|
|||
true : 1; |
|||
|
|||
endrewards |
|||
|
|||
// set of initial states: all (i.e. any possible initial configuration of tokens) |
|||
init true endinit |
|||
|
|||
// formula, for use in properties: number of tokens |
|||
// (i.e. number of processes that have the same value as the process to their left) |
|||
formula num_tokens = (x1=x2?1:0)+(x2=x3?1:0)+(x3=x4?1:0)+(x4=x5?1:0)+(x5=x6?1:0)+(x6=x7?1:0)+(x7=x8?1:0)+(x8=x9?1:0)+(x9=x10?1:0)+(x10=x11?1:0)+(x11=x12?1:0)+(x12=x13?1:0)+(x13=x14?1:0)+(x14=x15?1:0)+(x15=x16?1:0)+(x16=x17?1:0)+(x17=x18?1:0)+(x18=x19?1:0)+(x19=x20?1:0)+(x20=x21?1:0)+(x21=x1?1:0); |
|||
@ -1,34 +1,34 @@ |
|||
// herman's self stabilising algorithm [Her90] |
|||
// gxn/dxp 13/07/02 |
|||
|
|||
// the procotol is synchronous with no non-determinism (a DTMC) |
|||
dtmc |
|||
|
|||
// module for process 1 |
|||
module process1 |
|||
|
|||
// Boolean variable for process 1 |
|||
x1 : [0..1]; |
|||
|
|||
[step] (x1=x3) -> 0.5 : (x1'=0) + 0.5 : (x1'=1); |
|||
[step] !(x1=x3) -> (x1'=x3); |
|||
|
|||
endmodule |
|||
|
|||
// add further processes through renaming |
|||
module process2 = process1[x1=x2, x3=x1 ] endmodule |
|||
module process3 = process1[x1=x3, x3=x2 ] endmodule |
|||
|
|||
// cost - 1 in each state (expected steps) |
|||
rewards |
|||
|
|||
true : 1; |
|||
|
|||
endrewards |
|||
|
|||
// any initial state (consider any possible initial configuration of tokens) |
|||
init |
|||
|
|||
true |
|||
|
|||
endinit |
|||
// herman's self stabilising algorithm [Her90] |
|||
// gxn/dxp 13/07/02 |
|||
|
|||
// the procotol is synchronous with no nondeterminism (a DTMC) |
|||
dtmc |
|||
|
|||
// module for process 1 |
|||
module process1 |
|||
|
|||
// Boolean variable for process 1 |
|||
x1 : [0..1]; |
|||
|
|||
[step] (x1=x3) -> 0.5 : (x1'=0) + 0.5 : (x1'=1); |
|||
[step] !(x1=x3) -> (x1'=x3); |
|||
|
|||
endmodule |
|||
|
|||
// add further processes through renaming |
|||
module process2 = process1 [ x1=x2, x3=x1 ] endmodule |
|||
module process3 = process1 [ x1=x3, x3=x2 ] endmodule |
|||
|
|||
// cost - 1 in each state (expected number of steps) |
|||
rewards "steps" |
|||
|
|||
true : 1; |
|||
|
|||
endrewards |
|||
|
|||
// set of initial states: all (i.e. any possible initial configuration of tokens) |
|||
init true endinit |
|||
|
|||
// formula, for use in properties: number of tokens |
|||
// (i.e. number of processes that have the same value as the process to their left) |
|||
formula num_tokens = (x1=x2?1:0)+(x2=x3?1:0)+(x3=x1?1:0); |
|||
@ -1,19 +0,0 @@ |
|||
const int k; |
|||
|
|||
// States with k tokens - where only k processes have the same value as the process to its left |
|||
label "k_tokens" = (x1=x2?1:0)+(x2=x3?1:0)+(x3=x4?1:0)+(x4=x5?1:0)+(x5=x1?1:0) = k; |
|||
|
|||
// Stable states - where only one process has a token |
|||
label "stable" = (x1=x2?1:0)+(x2=x3?1:0)+(x3=x4?1:0)+(x4=x5?1:0)+(x5=x1?1:0) = 1; |
|||
|
|||
// A stable state is reached with probability 1 |
|||
"init" => P>=1 [ true U "stable" ] |
|||
|
|||
// Maximum expected time to reach a stable state (for all configurations) |
|||
R=? [ F "stable" {"init"}{max} ] |
|||
|
|||
// Maximum expected time to reach a stable state (for all k-token configurations) |
|||
R=? [ F "stable" {"k_tokens"}{max} ] |
|||
|
|||
// Minimum expected time to reach a stable state (for all k-token configurations) |
|||
R=? [ F "stable" {"k_tokens"}{min} ] |
|||
@ -1,36 +1,36 @@ |
|||
// herman's self stabilising algorithm [Her90] |
|||
// gxn/dxp 13/07/02 |
|||
|
|||
// the procotol is synchronous with no non-determinism (a DTMC) |
|||
dtmc |
|||
|
|||
// module for process 1 |
|||
module process1 |
|||
|
|||
// Boolean variable for process 1 |
|||
x1 : [0..1]; |
|||
|
|||
[step] (x1=x5) -> 0.5 : (x1'=0) + 0.5 : (x1'=1); |
|||
[step] !(x1=x5) -> (x1'=x5); |
|||
|
|||
endmodule |
|||
|
|||
// add further processes through renaming |
|||
module process2 = process1[x1=x2, x5=x1 ] endmodule |
|||
module process3 = process1[x1=x3, x5=x2 ] endmodule |
|||
module process4 = process1[x1=x4, x5=x3 ] endmodule |
|||
module process5 = process1[x1=x5, x5=x4 ] endmodule |
|||
|
|||
// cost - 1 in each state (expected steps) |
|||
rewards |
|||
|
|||
true : 1; |
|||
|
|||
endrewards |
|||
|
|||
// any initial state (consider any possible initial configuration of tokens) |
|||
init |
|||
|
|||
true |
|||
|
|||
endinit |
|||
// herman's self stabilising algorithm [Her90] |
|||
// gxn/dxp 13/07/02 |
|||
|
|||
// the procotol is synchronous with no nondeterminism (a DTMC) |
|||
dtmc |
|||
|
|||
// module for process 1 |
|||
module process1 |
|||
|
|||
// Boolean variable for process 1 |
|||
x1 : [0..1]; |
|||
|
|||
[step] (x1=x5) -> 0.5 : (x1'=0) + 0.5 : (x1'=1); |
|||
[step] !(x1=x5) -> (x1'=x5); |
|||
|
|||
endmodule |
|||
|
|||
// add further processes through renaming |
|||
module process2 = process1 [ x1=x2, x5=x1 ] endmodule |
|||
module process3 = process1 [ x1=x3, x5=x2 ] endmodule |
|||
module process4 = process1 [ x1=x4, x5=x3 ] endmodule |
|||
module process5 = process1 [ x1=x5, x5=x4 ] endmodule |
|||
|
|||
// cost - 1 in each state (expected number of steps) |
|||
rewards "steps" |
|||
|
|||
true : 1; |
|||
|
|||
endrewards |
|||
|
|||
// set of initial states: all (i.e. any possible initial configuration of tokens) |
|||
init true endinit |
|||
|
|||
// formula, for use in properties: number of tokens |
|||
// (i.e. number of processes that have the same value as the process to their left) |
|||
formula num_tokens = (x1=x2?1:0)+(x2=x3?1:0)+(x3=x4?1:0)+(x4=x5?1:0)+(x5=x1?1:0); |
|||
@ -1,19 +0,0 @@ |
|||
const int k; |
|||
|
|||
// States with k tokens - where only k processes have the same value as the process to its left |
|||
label "k_tokens" = (x1=x2?1:0)+(x2=x3?1:0)+(x3=x4?1:0)+(x4=x5?1:0)+(x5=x6?1:0)+(x6=x7?1:0)+(x7=x1?1:0) = k; |
|||
|
|||
// Stable states - where only one process has a token |
|||
label "stable" = (x1=x2?1:0)+(x2=x3?1:0)+(x3=x4?1:0)+(x4=x5?1:0)+(x5=x6?1:0)+(x6=x7?1:0)+(x7=x1?1:0) = 1; |
|||
|
|||
// A stable state is reached with probability 1 |
|||
"init" => P>=1 [ true U "stable" ] |
|||
|
|||
// Maximum expected time to reach a stable state (for all configurations) |
|||
R=? [ F "stable" {"init"}{max} ] |
|||
|
|||
// Maximum expected time to reach a stable state (for all k-token configurations) |
|||
R=? [ F "stable" {"k_tokens"}{max} ] |
|||
|
|||
// Minimum expected time to reach a stable state (for all k-token configurations) |
|||
R=? [ F "stable" {"k_tokens"}{min} ] |
|||
@ -1,38 +1,38 @@ |
|||
// herman's self stabilising algorithm [Her90] |
|||
// gxn/dxp 13/07/02 |
|||
|
|||
// the procotol is synchronous with no non-determinism (a DTMC) |
|||
dtmc |
|||
|
|||
// module for process 1 |
|||
module process1 |
|||
|
|||
// Boolean variable for process 1 |
|||
x1 : [0..1]; |
|||
|
|||
[step] (x1=x7) -> 0.5 : (x1'=0) + 0.5 : (x1'=1); |
|||
[step] !(x1=x7) -> (x1'=x7); |
|||
|
|||
endmodule |
|||
|
|||
// add further processes through renaming |
|||
module process2 = process1[x1=x2, x7=x1 ] endmodule |
|||
module process3 = process1[x1=x3, x7=x2 ] endmodule |
|||
module process4 = process1[x1=x4, x7=x3 ] endmodule |
|||
module process5 = process1[x1=x5, x7=x4 ] endmodule |
|||
module process6 = process1[x1=x6, x7=x5 ] endmodule |
|||
module process7 = process1[x1=x7, x7=x6 ] endmodule |
|||
|
|||
// cost - 1 in each state (expected steps) |
|||
rewards |
|||
|
|||
true : 1; |
|||
|
|||
endrewards |
|||
|
|||
// any initial state (consider any possible initial configuration of tokens) |
|||
init |
|||
|
|||
true |
|||
|
|||
endinit |
|||
// herman's self stabilising algorithm [Her90] |
|||
// gxn/dxp 13/07/02 |
|||
|
|||
// the procotol is synchronous with no nondeterminism (a DTMC) |
|||
dtmc |
|||
|
|||
// module for process 1 |
|||
module process1 |
|||
|
|||
// Boolean variable for process 1 |
|||
x1 : [0..1]; |
|||
|
|||
[step] (x1=x7) -> 0.5 : (x1'=0) + 0.5 : (x1'=1); |
|||
[step] !(x1=x7) -> (x1'=x7); |
|||
|
|||
endmodule |
|||
|
|||
// add further processes through renaming |
|||
module process2 = process1 [ x1=x2, x7=x1 ] endmodule |
|||
module process3 = process1 [ x1=x3, x7=x2 ] endmodule |
|||
module process4 = process1 [ x1=x4, x7=x3 ] endmodule |
|||
module process5 = process1 [ x1=x5, x7=x4 ] endmodule |
|||
module process6 = process1 [ x1=x6, x7=x5 ] endmodule |
|||
module process7 = process1 [ x1=x7, x7=x6 ] endmodule |
|||
|
|||
// cost - 1 in each state (expected number of steps) |
|||
rewards "steps" |
|||
|
|||
true : 1; |
|||
|
|||
endrewards |
|||
|
|||
// set of initial states: all (i.e. any possible initial configuration of tokens) |
|||
init true endinit |
|||
|
|||
// formula, for use in properties: number of tokens |
|||
// (i.e. number of processes that have the same value as the process to their left) |
|||
formula num_tokens = (x1=x2?1:0)+(x2=x3?1:0)+(x3=x4?1:0)+(x4=x5?1:0)+(x5=x6?1:0)+(x6=x7?1:0)+(x7=x1?1:0); |
|||
@ -1,19 +0,0 @@ |
|||
const int k; |
|||
|
|||
// States with k tokens - where only k processes have the same value as the process to its left |
|||
label "k_tokens" = (x1=x2?1:0)+(x2=x3?1:0)+(x3=x4?1:0)+(x4=x5?1:0)+(x5=x6?1:0)+(x6=x7?1:0)+(x7=x8?1:0)+(x8=x9?1:0)+(x9=x1?1:0) = k; |
|||
|
|||
// Stable states - where only one process has a token |
|||
label "stable" = (x1=x2?1:0)+(x2=x3?1:0)+(x3=x4?1:0)+(x4=x5?1:0)+(x5=x6?1:0)+(x6=x7?1:0)+(x7=x8?1:0)+(x8=x9?1:0)+(x9=x1?1:0) = 1; |
|||
|
|||
// A stable state is reached with probability 1 |
|||
"init" => P>=1 [ true U "stable" ] |
|||
|
|||
// Maximum expected time to reach a stable state (for all configurations) |
|||
R=? [ F "stable" {"init"}{max} ] |
|||
|
|||
// Maximum expected time to reach a stable state (for all k-token configurations) |
|||
R=? [ F "stable" {"k_tokens"}{max} ] |
|||
|
|||
// Minimum expected time to reach a stable state (for all k-token configurations) |
|||
R=? [ F "stable" {"k_tokens"}{min} ] |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue