-
Notifications
You must be signed in to change notification settings - Fork 223
Expand file tree
/
Copy pathTLCSailfish2.tla
More file actions
46 lines (36 loc) · 1.69 KB
/
Copy pathTLCSailfish2.tla
File metadata and controls
46 lines (36 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
----------------------------- MODULE TLCSailfish2 -----------------------------
(**************************************************************************************)
(* In this configuartion, we have 4 nodes among which one is Byzantine, every set *)
(* of 3 nodes (i.e. n-f nodes) is a quorum, and every set of 2 nodes (i.e. f+1 *)
(* nodes) is a blocking set. *)
(**************************************************************************************)
EXTENDS Integers, FiniteSets
VARIABLES vs, es, round, log
CONSTANTS
n1,n2,n3,n4
N == {n1,n2,n3,n4}
F == {n1}
R == 1..5
IsQuorum(Q) == Cardinality(Q) >= 3
IsBlocking(B) == Cardinality(B) >= 2
LeaderSchedule == <<n1,n2,n3,n4>>
Leader(r) == LeaderSchedule[((r-1) % Cardinality(N))+1]
GST == 6
INSTANCE Sailfish
(**************************************************************************************)
(* TLC does not check the assumptions of an instantiated module, so we assume them *)
(* again here to have them checked against the parameters defined above. *)
(**************************************************************************************)
ASSUME NodesAreFinite
ASSUME ByzantineNodesAreNodes
ASSUME RoundsStartAtOne
ASSUME LeadersAreNodes
ASSUME GSTIsARoundNumber
ASSUME CorrectNodesFormQuorum
ASSUME QuorumMinusByzantineIsBlocking
ASSUME BlockingSetsIntersectQuorums
StateConstraint == \A n \in N \ F : round[n] \in 0..Max(R)
Done == \A n \in N \ F : round[n] = Max(R)
Terminate == Done /\ UNCHANGED <<vs, es, round, log>>
TerminatingSpec == Init /\ [][Next \/ Terminate]_<<vs, es, round, log>>
===========================================================================