8 changed files with 239 additions and 7 deletions
-
83prism-tests/functionality/verify/ptas/reach/firewire_abst.nm
-
11prism-tests/functionality/verify/ptas/reach/firewire_abst.nm.props
-
4prism-tests/functionality/verify/ptas/reach/firewire_abst.nm.props.args
-
12prism-tests/functionality/verify/ptas/reach/timebounded.nm
-
17prism-tests/functionality/verify/ptas/reach/timebounded.nm.props
-
4prism-tests/functionality/verify/ptas/reach/timebounded.nm.props.args
-
8prism-tests/functionality/verify/ptas/reach/zeroconf.nm.props
-
103prism/src/pta/DigitalClocks.java
@ -0,0 +1,83 @@ |
|||
// Abstract model of Firewire protocol (PTA model) |
|||
// dxp/gxn 08/07/09 |
|||
|
|||
pta |
|||
|
|||
// maximum and minimum delays |
|||
// fast |
|||
const int rc_fast_max = 850; |
|||
const int rc_fast_min = 760; |
|||
// slow |
|||
const int rc_slow_max = 1670; |
|||
const int rc_slow_min = 1590; |
|||
// delay caused by the wire length |
|||
const int delay; |
|||
// probability of choosing fast and slow |
|||
const double fast = 0.5; |
|||
const double slow = 1-fast; |
|||
|
|||
module abstract_firewire |
|||
|
|||
// clock |
|||
x : clock; |
|||
// local state |
|||
s : [0..9]; |
|||
// 0 - start_start |
|||
// 1 - fast_start |
|||
// 2 - start_fast |
|||
// 3 - start_slow |
|||
// 4 - slow_start |
|||
// 5 - fast_fast |
|||
// 6 - fast_slow |
|||
// 7 - slow_fast |
|||
// 8 - slow_slow |
|||
// 9 - done |
|||
|
|||
// clock invariant |
|||
invariant |
|||
(s=0 => x<=delay) & |
|||
(s=1 => x<=delay) & |
|||
(s=2 => x<=delay) & |
|||
(s=3 => x<=delay) & |
|||
(s=4 => x<=delay) & |
|||
(s=5 => x<=rc_fast_max) & |
|||
(s=6 => x<=rc_slow_max) & |
|||
(s=7 => x<=rc_slow_max) & |
|||
(s=8 => x<=rc_slow_max) |
|||
endinvariant |
|||
|
|||
// start_start (initial state) |
|||
[] s=0 -> fast : (s'=1) + slow : (s'=4); |
|||
[] s=0 -> fast : (s'=2) + slow : (s'=3); |
|||
// fast_start |
|||
[] s=1 -> fast : (s'=5) & (x'=0) + slow : (s'=6) & (x'=0); |
|||
// start_fast |
|||
[] s=2 -> fast : (s'=5) & (x'=0) + slow : (s'=7) & (x'=0); |
|||
// start_slow |
|||
[] s=3 -> fast : (s'=6) & (x'=0) + slow : (s'=8) & (x'=0); |
|||
// slow_start |
|||
[] s=4 -> fast : (s'=7) & (x'=0) + slow : (s'=8) & (x'=0); |
|||
// fast_fast |
|||
[] s=5 & (x>=rc_fast_min) -> (s'=0) & (x'=0); |
|||
[] s=5 & (x>=rc_fast_min-delay) -> (s'=9) & (x'=0); |
|||
// fast_slow |
|||
[] s=6 & x>=rc_slow_min-delay -> (s'=9) & (x'=0); |
|||
// slow_fast |
|||
[] s=7 & x>=rc_slow_min-delay -> (s'=9) & (x'=0); |
|||
// slow_slow |
|||
[] s=8 & x>=rc_slow_min -> (s'=0) & (x'=0); |
|||
[] s=8 & x>=rc_slow_min-delay -> (s'=9) & (x'=0); |
|||
// done |
|||
[] s=9 -> true; |
|||
|
|||
endmodule |
|||
|
|||
// labels |
|||
label "done" = (s=9); |
|||
|
|||
// reward structures |
|||
// time |
|||
rewards "time" |
|||
true : 1; |
|||
endrewards |
|||
|
|||
@ -0,0 +1,11 @@ |
|||
// Minimum probability that a leader is eventually elected |
|||
// RESULT (delay=30): 1.0 |
|||
"eventually": Pmin=? [ F "done" ]; |
|||
|
|||
// Minimum probability that a leader has been elected by time T |
|||
// RESULT (delay=30): 0.851563 |
|||
"deadline_min": Pmin=? [ F<=5000 "done" ]; |
|||
|
|||
// Maximum probability that a leader has been elected by time T |
|||
// RESULT (delay=30): 0.25 |
|||
"deadline_max": Pmax=? [ F<=750 "done" ]; |
|||
@ -0,0 +1,4 @@ |
|||
-const delay=30 -const L=2 -ptamethod digital |
|||
-const delay=30 -const L=2 -ptamethod digital -ex |
|||
-const delay=30 -const L=2 -ptamethod games |
|||
#-const delay=30 -const L=2 -ptamethod backwards |
|||
@ -0,0 +1,12 @@ |
|||
pta |
|||
|
|||
module M |
|||
|
|||
s : [0..1]; |
|||
x : clock; |
|||
|
|||
[a] s=0 & x=2 -> 0.5:(x'=0) + 0.5:(s'=1); |
|||
|
|||
endmodule |
|||
|
|||
label "target" = s=1; |
|||
@ -0,0 +1,17 @@ |
|||
const int K = 2; |
|||
const int L; |
|||
|
|||
// RESULT: 7/8 |
|||
Pmax=? [ F<=6 s=1 ]; |
|||
|
|||
// RESULT: 3/4 |
|||
Pmax=? [ F<=4 "target" ]; |
|||
|
|||
// RESULT: 1/2 |
|||
Pmax=? [ F<=K "target" ]; |
|||
|
|||
// RESULT: 1/2 |
|||
Pmax=? [ F<=L "target" ]; |
|||
|
|||
// RESULT: Error:upper |
|||
Pmax=? [ F>=2 "target" ]; |
|||
@ -0,0 +1,4 @@ |
|||
-const L=2 -ptamethod digital |
|||
-const L=2 -ptamethod digital -ex |
|||
-const L=2 -ptamethod games |
|||
-const L=2 -ptamethod backwards |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue