type round = R1 | R2 | R3 | R4 | R5 | R6 | R7
type prep = M2 | M1 | MValid
var Round : round
array Estimate[proc] : bool
array State[proc] : bool
array Coord[proc] : bool
array ACoord [proc] : bool
array Done[proc] : bool
var Request : bool
array DecisionValue[proc] : bool
array Faulty[proc] : bool
array Received[proc] : bool
array Nack[proc] : bool
array Id[proc] : proc
array Id_valid[proc] : prep
var MaxId : proc
var MaxId_valid : prep
var TmpEstimate : bool
array ProcessReceivedEstimate[proc] : bool
init (x) {
Round = R1 && State[x] = False && Coord[x] = False &&
ACoord[x] = False && Done[x] = False && Received[x] = False &&
Nack[x] = False &&
Id_valid[x] = M1 && MaxId_valid = M2 &&
ProcessReceivedEstimate[x] = False
}
unsafe (x y) {
Coord[x] = True && Coord[y] = True
}
unsafe (x y) {
Coord[x] = True && ACoord[y] = False && y < x
}
unsafe(x) {
Coord[x] = True && Id_valid[x] = MValid && x < Id[x]
}
unsafe (x y) {
Coord[x] = True && Id_valid[y] = MValid && x < Id[y]
}
unsafe (x y) {
Round = R1 && Coord[x] = True && Id_valid[y] = MValid && Id[y] = x
}
unsafe (x) {
Faulty[x] = False && Nack[x] = True
}
unsafe (x y) {
Coord[x] = True && ACoord[y] = True && x < y
}
unsafe (x y z) {
State[x] = True && Received[x] = True && Coord[y] = True &&
State[z] = False && Faulty[z]= False && Estimate[y] <> Estimate[z]
}
unsafe (x y) {
Round <> R1 && State[x] = False && Faulty[x] = False &&
ProcessReceivedEstimate[x] = True && Coord[y] = True &&
Estimate[x] <> Estimate[y]
}
unsafe (x y) {
Coord[x] = True && Faulty[x] = False && Round = R6 &&
State[y] = False && Faulty[y] = False
}
unsafe (x y) {
State[x] = True && Faulty[x] = False &&
State[y] = True && Faulty[y] = False &&
DecisionValue[x] <> DecisionValue[y]
}
transition t1_v (x y)
requires { Round = R1 && Done[x] = False && State[x] = False &&
Coord[y] = True &&
Id_valid[x] = MValid && MaxId_valid = MValid && MaxId < Id[x] }
{
Done[x] := True;
MaxId := Id[x];
TmpEstimate := Estimate[x];
}
transition t1_nv (x y)
requires { Round = R1 && Done[x] = False && State[x] = False &&
Coord[y] = True &&
Id_valid[x] = M1 && MaxId_valid = M2 }
{
Done[x] := True;
MaxId := Id[x];
MaxId_valid := Id_valid[x];
TmpEstimate := Estimate[x];
}
transition t1_nv2 (x y)
requires { Round = R1 && Done[x] = False && State[x] = False &&
Coord[y] = True &&
Id_valid[x] = MValid && MaxId_valid = M2 }
{
Done[x] := True;
MaxId := Id[x];
MaxId_valid := Id_valid[x];
TmpEstimate := Estimate[x];
}
transition t1_nv3 (x y)
requires { Round = R1 && Done[x] = False && State[x] = False &&
Coord[y] = True &&
Id_valid[x] = MValid && MaxId_valid = M1 }
{
Done[x] := True;
MaxId := Id[x];
MaxId_valid := Id_valid[x];
TmpEstimate := Estimate[x];
}
transition t2_v (x y)
requires { Round = R1 && Done[x] = False && State[x] = False &&
Coord[y] = True &&
Id_valid[x] = MValid && MaxId_valid = MValid && Id[x] <= MaxId }
{
Done[x] := True;
}
transition t2_nv (x y)
requires { Round = R1 && Done[x] = False && State[x] = False &&
Coord[y] = True &&
Id_valid[x] = M1 && MaxId_valid = MValid }
{
Done[x] := True;
}
transition t2_nv2 (x y)
requires { Round = R1 && Done[x] = False && State[x] = False &&
Coord[y] = True &&
Id_valid[x] = M1 && MaxId_valid = M1 }
{
Done[x] := True;
}
transition t3 (x y)
requires { Round = R1 && Done[x] = False && State[x] = False &&
Coord[y] = True && Faulty[x] = True }
{
Done[x] := True;
}
transition t4 (x)
requires { Round = R1 && Done[x] = False && State[x] = False &&
Coord[x] = True &&
Id_valid[x] = MValid && MaxId_valid = MValid && MaxId < Id[x] }
{
Done[x] := True;
MaxId := Id[x];
TmpEstimate := Estimate[x];
}
transition t4_nv (x)
requires { Round = R1 && Done[x] = False && State[x] = False &&
Coord[x] = True &&
Id_valid[x] = M1 && MaxId_valid = M2 }
{
Done[x] := True;
MaxId := Id[x];
MaxId_valid := Id_valid[x];
TmpEstimate := Estimate[x];
}
transition t4_nv2 (x)
requires { Round = R1 && Done[x] = False && State[x] = False &&
Coord[x] = True &&
Id_valid[x] = MValid && MaxId_valid = M2 }
{
Done[x] := True;
MaxId := Id[x];
MaxId_valid := Id_valid[x];
TmpEstimate := Estimate[x];
}
transition t4_nv3 (x)
requires { Round = R1 && Done[x] = False && State[x] = False &&
Coord[x] = True &&
Id_valid[x] = MValid && MaxId_valid = M1 }
{
Done[x] := True;
MaxId := Id[x];
MaxId_valid := Id_valid[x];
TmpEstimate := Estimate[x];
}
transition t5 (x)
requires { Round = R1 && Done[x] = False && State[x] = False &&
Coord[x] = True &&
Id_valid[x] = MValid && MaxId_valid = MValid && Id[x] <= MaxId }
{
Done[x] := True;
}
transition t5_nv (x)
requires { Round = R1 && Done[x] = False && State[x] = False &&
Coord[x] = True &&
Id_valid[x] = M1 && MaxId_valid = MValid }
{
Done[x] := True;
}
transition t5_nv2 (x)
requires { Round = R1 && Done[x] = False && State[x] = False &&
Coord[x] = True &&
Id_valid[x] = M1 && MaxId_valid = M1 }
{
Done[x] := True;
}
transition t6 (x)
requires { Round = R1 && Done[x] = False && State[x] = True }
{
Done[x] := True;
}
transition t7 (x)
requires { Round = R1 && MaxId_valid <> M2 &&
Done[x] = True && Coord[x] = True &&
forall_other j. Done[j] = True }
{
Round := R2;
Done[j] := case | _ : False;
Estimate[x] := TmpEstimate;
}
transition t8 (x)
requires { Round = R1 && MaxId_valid = M2 &&
Done[x] = True && Coord[x] = True &&
forall_other j. Done[j] = True }
{
Coord[x] := False;
ACoord[x] := True;
}
transition t9 (x y)
requires { Round = R2 && Done[x] = False &&
State[x] = False && Coord[y] = True }
{
Estimate[x] := Estimate[y];
Done[x] := True;
Received[x] := True;
Id[x] := y;
Id_valid[x] := MValid;
ProcessReceivedEstimate[x] := True;
}
transition t10 (x y)
requires { Round = R2 && Done[x] = False && State[x] = False &&
Coord[y] = True && Faulty[y] = True }
{
Done[x] := True;
}
transition t11 (x)
requires { Round = R2 && Done[x] = False &&
State[x] = False && Coord[x] = True }
{
Done[x] := True;
Received[x] := True;
Id[x] := x;
Id_valid[x] := MValid;
ProcessReceivedEstimate[x] := True;
}
transition t12 (x)
requires { Round = R2 && Done[x] = False && State[x] = True }
{
Done[x] := True;
}
transition t13 (x)
requires { Round = R2 && Done[x] = True && Coord[x] = True &&
forall_other j. Done[j] = True }
{
Round := R3;
Done[j] := case | _ : False;
}
transition t14 (x y)
requires { Round = R3 && State[x] = False && Done[x] = False &&
Received[x] = False && Coord[y] = True }
{
Done[x] := True;
Nack[y] := True;
}
transition t15 (x y)
requires { Round = R3 && State[x] = False && Done[x] = False &&
Received[x] = False && Coord[y] = True && Faulty[x] = True }
{
Done[x] := True;
}
transition t16 (x y)
requires { Round = R3 && State[x] = False && Done[x] = False &&
Received[x] = True && Coord[y] = True }
{
Done[x] := True;
}
transition t17 (x)
requires { Round = R3 && Done[x] = False && Coord[x] = True }
{
Done[x] := True;
}
transition t18 (x y)
requires { Round = R3 && State[x] = True &&
Done[x] = False && Coord[y] = True }
{
Done[x] := True;
}
transition t19 (x)
requires { Round = R3 && Done[x] = True && Coord[x] = True &&
forall_other j. Done[j] = True }
{
Round := R4;
}
transition t20 (x)
requires { Round = R4 && Coord[x] = False &&
forall_other j. Nack[j] = False }
{
Round := R5;
Done[j] := case | _ : False;
}
transition t21 (x y)
requires { Round = R5 && Done[x] = False &&
State[x] = False && Coord[y] = True }
{
State[x] := True;
Done[x] := True;
DecisionValue[x] := Estimate[x];
}
transition t22 (x y)
requires { Round = R5 && Done[x] = False && State[x] = False &&
Coord[y] = True && Faulty[y] = True }
{
Done[x] := True;
}
transition t23 (x)
requires { Round = R5 && Done[x] = False &&
State[x] = False && Coord[x] = True }
{
State[x] := True;
Done[x] := True;
DecisionValue[x] := Estimate[x];
}
transition t24 (x)
requires { Round = R5 && Done[x] = False && State[x] = True }
{
Done[x] := True;
}
transition t25 (x)
requires { Round = R5 && Done[x] = True && Coord[x] = True &&
forall_other j. Done[j] = True }
{
Round := R6;
Done[j] := case | _ : False;
}
transition t26 (x)
requires { Round = R6 && Coord[x] = True }
{
Round := R7;
Coord[x] := False;
ACoord[x] := True;
}
transition t27 (x)
requires { Coord[x] = False && forall_other y. Coord[y] = False }
{
Round := R7;
}
transition t28 (x)
requires { Coord[x] = False && ACoord[x] = False && Round = R7 &&
forall_other y. (x <= y || y < x && ACoord[y] = True) }
{
Round := R1;
Coord[x] := True;
Received[j] := case | _ : False;
Done[j] := case | _ : False;
Nack[j] := case | _ : False;
MaxId_valid := M2;
}