-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAsyncRaft_small_logs.config.json
258 lines (258 loc) · 13.9 KB
/
AsyncRaft_small_logs.config.json
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
{
"preds_other": [
"(currentTerm[VARI] > currentTerm[VARJ])",
"(currentTerm[VARJ] > currentTerm[VARI])",
"(currentTerm[VARI] >= currentTerm[VARJ])",
"(currentTerm[VARJ] >= currentTerm[VARI])",
"(currentTerm[VARI] <= currentTerm[VARJ])",
"(currentTerm[VARJ] <= currentTerm[VARI])",
"(currentTerm[VARI] = currentTerm[VARJ])",
"(state[VARI] = Leader)",
"(state[VARI] = Follower)",
"(state[VARI] = Candidate)",
"(state[VARJ] = Leader)",
"(state[VARJ] = Follower)",
"(state[VARJ] = Candidate)",
"(state[VARI] = Leader /\\ VARI # VARJ)",
"(state[VARI] = Candidate /\\ VARI # VARJ)",
"(state[VARI] \\in {Leader,Candidate})",
"(state[VARI] \\in {Follower,Candidate})",
"(state[VARI] \\in {Leader,Candidate} /\\ VARJ \\in votesGranted[VARI])",
"(state[VARI] \\in {Leader,Candidate} /\\ VARI # VARJ)",
"VARREQVRES.mterm = currentTerm[VARI] /\\ VARREQVRES.msource = VARJ /\\ VARREQVRES.mdest # VARI /\\ VARREQVRES.mvoteGranted",
"(state[VARI] \\in {Follower,Candidate} /\\ VARI # VARJ)",
"(state[VARI] = Leader /\\ VARI # VARJ /\\ currentTerm[VARI] = currentTerm[VARJ])",
"(state[VARI] = Candidate /\\ VARI # VARJ)",
"(state[VARI] = Candidate /\\ VARI # VARJ /\\ currentTerm[VARI] = currentTerm[VARJ])",
"(state[VARI] = Follower /\\ VARI # VARJ)",
"(state[VARJ] \\in {Leader,Candidate} /\\ VARI # VARJ)",
"votesGranted[VARI] \\in Quorum",
"votesGranted[VARJ] \\in Quorum",
"VARI \\in votesGranted[VARI]",
"VARJ \\in votesGranted[VARI]",
"VARI \\in votesGranted[VARJ]",
"votesGranted[VARI] \\cap votesGranted[VARJ] = {}",
"VARREQVRES.mterm = currentTerm[VARI]",
"VARREQVRES.mterm = currentTerm[VARJ]",
"VARREQVRES.msource = VARI",
"VARREQVRES.msource = VARJ",
"VARREQVRES.mdest = VARI",
"VARREQVRES.mdest = VARJ",
"VARREQVRES.mvoteGranted",
"VARREQVRES.mterm = currentTerm[VARREQVRES.mdest]",
"VARREQVRES.mterm = currentTerm[VARREQVRES.msource]",
"currentTerm[VARREQVRES.msource] >= VARREQVRES.mterm",
"currentTerm[VARREQVRES.mdest] >= VARREQVRES.mterm",
"VARREQVRES.msource \\in votesGranted[VARREQVRES.mdest]",
"VARI \\in votesGranted[VARREQVRES.mdest]",
"VARI \\in votesGranted[VARREQVRES.msource]",
"VARJ \\in votesGranted[VARREQVRES.mdest]",
"votedFor = [votedFor EXCEPT ![VARI] = VARI]",
"votedFor = [votedFor EXCEPT ![VARJ] = VARJ]",
"votedFor[VARI] = VARJ",
"(commitIndex[VARI] > 0)",
"CanAppend(VARM, VARI) /\\ log = log",
"Len(log[VARI]) = VARM.mprevLogIndex",
"LogOk(VARI, VARM) /\\ log = log",
"log = [log EXCEPT ![VARI] = Append(log[VARI], currentTerm[VARI])]",
"log = [log EXCEPT ![VARJ] = Append(log[VARJ], currentTerm[VARJ])]",
"VARI \\in VARQ",
"VARJ \\in VARQ",
"VARREQVM.mterm = currentTerm[VARI]",
"VARREQVM.msource = VARI",
"\\E INDK \\in DOMAIN log[VARJ] : log[VARJ][INDK] = currentTerm[VARI]",
"\\E INDK \\in DOMAIN log[VARJ] : ~\\E INDI \\in DOMAIN log[VARI] : (INDI = INDK /\\ log[VARI][INDK] = log[VARJ][INDK])",
"VARREQVM.mlastLogTerm >= currentTerm[VARI]",
"VARREQVM.mlastLogTerm >= currentTerm[VARJ]",
"VARREQVM.mlastLogIndex >= Len(log[VARI])",
"VARREQVM.mlastLogIndex = Len(log[VARI])",
"VARREQVM.mlastLogIndex >= Len(log[VARJ])",
"currentTerm[VARREQVM.msource] = VARREQVM.mterm",
"currentTerm[VARREQVM.msource] >= VARREQVM.mterm",
"commitIndex[VARI] > VARM.mcommitIndex",
"VARM.mcommitIndex > 0",
"VARM.mprevLogIndex = nextIndex[VARI][VARJ]",
"VARM.mprevLogTerm = currentTerm[VARI]",
"VARLOGINDI = VARM.mprevLogIndex + 1",
"VARM.mentries = <<>>",
"VARM.mentries # <<>> /\\ VARLOGINDI \\in DOMAIN log[VARI] /\\ log[VARI][VARLOGINDI] = VARM.mentries[1]",
"VARLOGINDI \\in DOMAIN log[VARI] /\\ log[VARI][VARLOGINDI] = currentTerm[VARI]",
"VARLOGINDI \\in DOMAIN log[VARI] /\\ log[VARI][VARLOGINDI] = currentTerm[VARJ]",
"Len(log[VARI]) >= commitIndex[VARI]",
"Len(log[VARI]) >= commitIndex[VARJ]",
"Len(log[VARJ]) >= commitIndex[VARJ]",
"Len(log[VARI]) >= commitIndex[VARI] /\\ Len(log[VARJ]) >= commitIndex[VARI] /\\ commitIndex[VARI] > 0 /\\ log[VARI][commitIndex[VARI]] = log[VARJ][commitIndex[VARI]]",
"VARLOGINDI \\in DOMAIN log[VARI]",
"VARLOGINDI \\in DOMAIN log[VARJ]",
"VARLOGINDI \\in DOMAIN log[VARI] /\\ VARLOGINDI \\in DOMAIN log[VARJ] /\\ log[VARI][VARLOGINDI] = log[VARJ][VARLOGINDI]",
"VARLOGINDI \\in DOMAIN log[VARI] /\\ Agree(VARI, VARLOGINDI) \\in Quorum /\\ matchIndex = matchIndex",
"VARLOGINDI \\in DOMAIN log[VARI] /\\ Agree(VARI, VARLOGINDI) = {} /\\ matchIndex = matchIndex",
"AgreeIndexes(VARI) = {} /\\ matchIndex = matchIndex",
"AgreeIndexes(VARI) # {} /\\ log[VARI][Max(AgreeIndexes(VARI))] = currentTerm[VARI] /\\ matchIndex = matchIndex",
"AgreeIndexes(VARI) # {} /\\ commitIndex[VARI] > Max(AgreeIndexes(VARI)) /\\ matchIndex = matchIndex",
"AgreeIndexes(VARI) # {} /\\ commitIndex[VARI] = Max(AgreeIndexes(VARI)) /\\ matchIndex = matchIndex",
"Len(log[VARI]) >= matchIndex[VARI][VARJ]",
"Len(log[VARI]) > matchIndex[VARI][VARJ]",
"H_CommitIndexCoveredOnQuorum /\\ commitIndex = commitIndex /\\ log = log",
"IsPrefix(log[VARI], log[VARJ])",
"IsPrefix(log[VARJ], log[VARI])",
"commitIndex[VARI] \\in DOMAIN log[VARI] /\\ commitIndex[VARI] \\in DOMAIN log[VARJ] /\\ log[VARJ][commitIndex[VARI]] = log[VARI][commitIndex[VARI]]",
"Len(log[VARMAERES.msource]) >= VARMAERES.mmatchIndex",
"Len(log[VARMAERES.mdest]) >= VARMAERES.mmatchIndex",
"log[VARMAERES.msource][VARMAERES.mmatchIndex] = log[VARMAERES.mdest][VARMAERES.mmatchIndex]",
"VARMAERES.mterm = currentTerm[VARMAERES.mdest]",
"VARMAERES.mterm = currentTerm[VARMAERES.msource]",
"VARMAERES.mterm > currentTerm[VARMAERES.msource]",
"VARMAERES.mterm = currentTerm[VARI]",
"matchIndex[VARI][VARJ] = VARMAERES.mmatchIndex",
"VARMAERES.msuccess",
"H_VoteGrantedImpliesNodeSafeAtTerm2 /\\ state = state /\\ currentTerm = currentTerm /\\ votesGranted = votesGranted /\\ votedFor = votedFor",
"H_RequestVoteResponseTermsMatchSource /\\ requestVoteResponseMsgs = requestVoteResponseMsgs /\\ currentTerm = currentTerm",
"H_RequestVoteResponseTermsMatchSource2 /\\ requestVoteResponseMsgs = requestVoteResponseMsgs /\\ currentTerm = currentTerm /\\ votedFor = votedFor"
],
"preds" : [
"H_CandidateWithVotesGrantedInTermImplyNoOtherLeader /\\ state = state /\\ votesGranted = votesGranted /\\ currentTerm = currentTerm",
"H_VotesCantBeGrantedTwiceToCandidatesInSameTerm /\\ state = state /\\ currentTerm = currentTerm /\\ votesGranted = votesGranted",
"H_VoteGrantedImpliesVoteResponseMsgConsistent /\\ requestVoteResponseMsgs = requestVoteResponseMsgs /\\ state = state /\\ votesGranted = votesGranted /\\ currentTerm = currentTerm",
"H_CandidateWithVotesGrantedInTermImplyVotersSafeAtTerm /\\ state = state /\\ currentTerm = currentTerm",
"H_CandidateWithVotesGrantedInTermImplyVotersSafeAtTerm2 /\\ state = state /\\ currentTerm = currentTerm /\\ votedFor = votedFor",
"H_RequestVoteResponseMsgsInTermUnique /\\ requestVoteResponseMsgs = requestVoteResponseMsgs",
"H_VoteInGrantedImpliesVotedFor /\\ state = state /\\ votesGranted = votesGranted /\\ currentTerm = currentTerm /\\ votedFor = votedFor",
"H_VoteInGrantedImpliesVotedFor2 /\\ state = state /\\ votesGranted = votesGranted /\\ currentTerm = currentTerm",
"(state[VARI] = Leader)",
"(state[VARI] = Follower)",
"(state[VARI] = Candidate)",
"(state[VARJ] = Leader)",
"(state[VARJ] = Follower)",
"(state[VARJ] = Candidate)",
"(state[VARI] = Leader /\\ VARI # VARJ)",
"(state[VARI] = Candidate /\\ VARI # VARJ)",
"(state[VARI] \\in {Leader,Candidate})",
"(state[VARI] \\in {Follower,Candidate})",
"(state[VARI] \\in {Leader,Candidate} /\\ VARI # VARJ)",
"votesGranted[VARI] \\in Quorum",
"votesGranted[VARJ] \\in Quorum",
"VARJ \\in votesGranted[VARI]",
"currentTerm[VARJ] >= currentTerm[VARI]",
"(currentTerm[VARI] = currentTerm[VARJ])",
"votedFor[VARI] = VARJ",
"votedFor[VARJ] = VARI",
"(state[VARI] \\in {Leader,Candidate} /\\ VARJ \\in votesGranted[VARI])",
"currentTerm[VARREQVRES.msource] >= VARREQVRES.mterm",
"currentTerm[VARREQVRES.msource] = VARREQVRES.mterm",
"votedFor[VARREQVRES.msource] = VARREQVRES.mdest",
"VARREQVRES.mvoteGranted"
],
"preds_alt" : [],
"safety" : "H_LogMatching",
"constants" : {
"n1" : "n1",
"n2" : "n2",
"n3" : "n3",
"Server" : [ "{n1,n2}", "{n1,n2,n3}"],
"Follower" : "Follower",
"Candidate" : "Candidate",
"Leader" : "Leader",
"Nil" : "Nil",
"RequestVoteRequest" : "RequestVoteRequest",
"RequestVoteResponse" : "RequestVoteResponse",
"AppendEntriesRequest" : "AppendEntriesRequest",
"AppendEntriesResponse" : "AppendEntriesResponse",
"MaxTerm" : ["2"],
"MaxLogLen" : ["1", "1"],
"MaxNumVoteMsgs": ["0"]
},
"constraint" : "StateConstraint",
"quant_inv": "\\A VARI \\in Server : \\A VARJ \\in Server : \\E VARQ \\in Quorum : \\A VARM \\in appendEntriesRequestMsgs : \\A VARMAERES \\in appendEntriesResponseMsgs : \\A VARREQVM \\in requestVoteRequestMsgs : \\A VARREQVRES \\in requestVoteResponseMsgs : \\A VARLOGINDI \\in LogIndices : ",
"quant_vars": ["VARI", "VARJ", "VARIND", "VARM", "VARLOGINDI"],
"model_consts" : "CONSTANT n1,n2,n3",
"max_tlc_inv_depth": 17,
"simulation_inv_check": true,
"simulation_inv_check_num_states": 2500000,
"simulation_inv_check_depth": 40,
"symmetry" : true,
"typeok" : "TypeOKRandom",
"tlc_specific_spec": true,
"try_final_minimize": false,
"simulate" : true,
"actions": [
"RequestVoteAction",
"BecomeLeaderAction",
"ClientRequestAction",
"AdvanceCommitIndexAction",
"AppendEntriesAction",
"UpdateTermRVReqAction",
"UpdateTermRVResAction",
"UpdateTermAEReqAction",
"UpdateTermAEResAction",
"HandleRequestVoteRequestAction",
"HandleRequestVoteResponseAction",
"RejectAppendEntriesRequestAction",
"AcceptAppendEntriesRequestAppendAction",
"AcceptAppendEntriesRequestLearnCommitAction",
"HandleAppendEntriesResponseAction"
],
"local_grammars": {
"AcceptAppendEntriesRequestTruncateAction": {
"H_LeaderMatchIndexValid": {
"quant_inv": "\\A VS \\in Server : \\A VIND \\in DOMAIN log[VS] : \\A VM \\in appendEntriesMsgs : ",
"quant_vars": ["VS", "VIND", "VM"],
"preds":[
"state[VS] = Leader",
"state[VS] \\in { Follower, Candidate }",
"VM.mtype = AppendEntriesRequest /\\ Len(log[VS]) >= (VM.mprevLogIndex + 1)",
"VM.mtype = AppendEntriesRequest /\\ VM.mentries # << >>",
"VM.mtype = AppendEntriesRequest /\\ (VM.mprevLogIndex + 1) \\in DOMAIN log[VS] /\\ VM.mentries # << >> /\\ VM.mentries[1] > log[VS][(VM.mprevLogIndex + 1)]"
],
"max_depth": 20
}
},
"RequestVoteAction": {
"H_LogEntryInTermImpliesSafeAtTermCandidateAppendEntries": {
"quant_inv": "\\A VS \\in Server : \\A VM \\in appendEntriesRequestMsgs : ",
"quant_vars": ["VS", "VIND", "VM"],
"preds":[
"state[VS] = Leader",
"state[VS] \\in { Follower, Candidate }",
"VM.mtype = AppendEntriesRequest /\\ VM.mentries # << >>"
],
"max_depth": 20
}
},
"BecomeLeaderAction": {
"H_LogMatchingInAppendEntriesMsgsLeaders": {
"quant_inv": "\\A VS \\in Server : \\A VIND \\in DOMAIN log[VS] : \\A VM \\in appendEntriesRequestMsgs : \\E VQ \\in Quorum : \\A VN \\in VQ :",
"quant_vars": ["VS", "VIND", "VM", "VQ", "VN"],
"preds":[
"state[VS] = Leader",
"state[VS] \\in { Follower, Candidate }",
"votesGranted[VS] \\in Quorum",
"currentTerm[VN] >= currentTerm[VS]",
"VM.mtype = AppendEntriesRequest /\\ Len(log[VS]) >= (VM.mprevLogIndex + 1)",
"VM.mtype = AppendEntriesRequest /\\ VM.mentries # << >>",
"VM.mtype = AppendEntriesRequest /\\ (VM.mprevLogIndex + 1) \\in DOMAIN log[VS] /\\ VM.mentries # << >> /\\ VM.mentries[1] > log[VS][(VM.mprevLogIndex + 1)]"
],
"max_depth": 19
}
}
},
"tlaps_proof_config": {
"assumes": [
"IsFiniteSet(Server)",
"Nil \\notin Server",
"(Leader # Follower) /\\ (Leader # Candidate)",
"(Follower # Candidate)",
"Server = Server",
"Quorum \\subseteq Server",
"MaxLogLen \\in Nat",
"MaxTerm \\in Nat"
],
"lemma_def_expands": {
"H_RequestVoteQuorumInTermImpliesNoOtherLogsInTerm": ["ExistsRequestVoteResponseQuorum"]
},
"action_def_expands":{
"HandleRequestVoteRequestAction": ["LastTerm","RequestVoteRequestType","RequestVoteResponseType","Terms","LogIndicesWithZero"],
"HandleRequestVoteResponseAction": ["LastTerm","RequestVoteRequestType","RequestVoteResponseType","Terms","LogIndicesWithZero"]
}
}
}