1
- ---------- MODULE SIMCoverageccfraft ----------
2
- EXTENDS ccfraft , TLC , Integers , CSV , TLCExt
3
1
4
- CONSTANTS
5
- NodeOne , NodeTwo , NodeThree , NodeFour , NodeFive
2
+ $ wget https://nightly.tlapl.us/dist/tla2tools.jar
3
+ $ wget https://github.com/tlaplus/CommunityModules/releases/latest/download/CommunityModules-deps.jar
4
+ ## Run with as many workers as you like to parallelize the nested simulation runs (auto uses all your cores).
5
+ $ java -jar tla2tools.jar -config SIMCoverageccfraft.tla SIMCoverageccfraft.tla -workers auto
6
6
7
- Servers_mc == { NodeOne , NodeTwo , NodeThree , NodeFour , NodeFive }
7
+ ----------------------------- MODULE SIMCoverageccfraft -----------------------------
8
+ EXTENDS TLC , Naturals , Sequences , IOUtils
8
9
9
- Baseline ==
10
- { << "Next" , 0 .. 0 , 0 .. 0 , 0 .. 0 >> }
10
+ CmdLine ==
11
+ << "sh" , "-c" ,
12
+ "java " \o
13
+ "-XX:+UseParallelGC " \o
14
+ "-Dtlc2.tool.impl.Tool.cdot=true " \o
15
+ "-Dtlc2.tool.Simulator.extendedStatistics=true " \o
16
+ "-jar tla2tools.jar " \o
17
+ "-depth 1000 " \o
18
+ "-simulate SIMccfraft.tla >> SIMCoverageccfraft.txt 2>&1" >>
11
19
12
- Confs ==
13
- Baseline \cup
14
- ( { "SIMNext" } \X { 1 .. 1 , 1 .. 10 , 1 .. 100 } \X { 201 .. 201 , 201 .. 210 , 201 .. 300 } \X { 401 .. 401 , 401 .. 410 , 401 .. 500 } )
20
+ -----------------------------------------------------------------------------
15
21
16
- VARIABLE conf
22
+ VARIABLE c , d
17
23
18
- CCF == INSTANCE ccfraft
24
+ Init ==
25
+ /\ c \in [ R : { 10 , 1000 } , C : { 10 , 1000 } , Q : { 10 , 1000 } , T : { 10 , 1000 } ]
26
+ /\ d = FALSE
19
27
20
- SIMInitReconfigurationVars ==
21
- \/ CCF ! InitLogConfigServerVars ( Servers , JoinedLog )
22
- \/ CCF ! InitReconfigurationVars
28
+ Next ==
29
+ /\ ~ d
30
+ /\ d ' = TRUE
31
+ /\ PrintT ( << "conf" , c >> )
32
+ /\ IOEnvExec ( c , CmdLine ) . exitValue = 0
33
+ /\ UNCHANGED c
23
34
24
- SIMCheckQuorum ( i ) ==
25
- /\ conf [ 1 ] # "Next" => RandomElement ( 1 .. 1000 ) \in conf [ 3 ]
26
- /\ CCF ! CheckQuorum ( i )
27
-
28
- SIMChangeConfigurationInt ( i , newConfiguration ) ==
29
- /\ conf [ 1 ] # "Next" => RandomElement ( 1 .. 1000 ) \in conf [ 4 ]
30
- /\ CCF ! ChangeConfigurationInt ( i , newConfiguration )
31
-
32
- SIMTimeout ( i ) ==
33
- /\ \/ RandomElement ( 1 .. 1000 ) \in conf [ 2 ]
34
- \/ conf [ 1 ] # "Next"
35
- \* Always allow Timeout if no messages are in the network
36
- \* and no node is a candidate or leader. Otherwise, the system
37
- \* will deadlock if 1 # RandomElement(...).
38
- \/ /\ \A s \in Servers : leadershipState [ s ] \notin { Leader , Candidate }
39
- /\ Network ! Messages = { }
40
- /\ CCF ! Timeout ( i )
41
-
42
- SIMCoverageSpec ==
43
- /\ Init
44
- /\ conf \in Confs
45
- /\ [] [ UNCHANGED conf /\ Next ]_ << vars , conf >>
46
-
47
- ------------------------------------------------------------------------------
48
-
49
- CSVFile == "SIMCoverageccfraft_S" \o ToString ( Cardinality ( Servers ) ) \o ".csv"
50
-
51
- CSVColumnHeaders ==
52
- "Spec#P#Q#R#currentTerm#state#commitIndex#log#node"
53
-
54
- ASSUME
55
- CSVRecords ( CSVFile ) = 0 =>
56
- CSVWrite ( CSVColumnHeaders , << >> , CSVFile )
57
-
58
- StatisticsStateConstraint ==
59
- ( TLCGet ( "level" ) > TLCGet ( "config" ) . depth ) =>
60
- TLCDefer ( \A s \in Servers : CSVWrite ( "%1$s#%2$s#%3$s#%4$s#%5$s#%6$s#%7$s#%8$s#%9$s" ,
61
- << conf [ 1 ] , Cardinality ( conf [ 2 ] ) , Cardinality ( conf [ 3 ] ) , Cardinality ( conf [ 4 ] ) ,
62
- currentTerm [ s ] , leadershipState [ s ] , commitIndex [ s ] , Len ( log [ s ] ) , s
63
- >> ,
64
- CSVFile ) )
65
35
=============================================================================
36
+ ---- CONFIG SIMCoverageccfraft ----
37
+ INIT Init
38
+ NEXT Next
39
+ CHECK_DEADLOCK FALSE
40
+ ====
0 commit comments