Skip to content

Commit

Permalink
mc without reconfiguration
Browse files Browse the repository at this point in the history
  • Loading branch information
heidihoward authored Oct 31, 2023
1 parent 6fe397f commit 3a3e4b9
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions tla/consensus/MCccfraft.tla
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@ CCF == INSTANCE ccfraft
\* This file controls the constants as seen below.
\* In addition to basic settings of how many nodes are to be model checked,
\* the model allows to place additional limitations on the state space of the program.

\* Limit the reconfigurations to the next configuration in Configurations
MCChangeConfigurationInt(i, newConfiguration) ==
/\ reconfigurationCount < Len(Configurations)
/\ reconfigurationCount < Len(Configurations)-1
\* +1 because TLA+ sequences are 1-index
/\ newConfiguration = Configurations[reconfigurationCount+1]
\* +1 to get the next configuration
/\ newConfiguration = Configurations[reconfigurationCount+2]
/\ CCF!ChangeConfigurationInt(i, newConfiguration)

\* Limit the terms that can be reached. Needs to be set to at least 3 to
Expand Down Expand Up @@ -90,7 +93,25 @@ MCNotifyCommit(i,j) ==
MCInMaxSimultaneousCandidates(i) ==
Cardinality({ s \in GetServerSetForIndex(i, commitIndex[i]) : state[s] = Candidate}) < 1

mc_spec == Spec
\* Alternative to CCF!InitReconfigurationVars that sets the initial configuration to the first config defined in Configurations
MCInitReconfigurationVars ==
/\ reconfigurationCount = 0
/\ removedFromConfiguration = {}
/\ configurations = [i \in Servers |-> 0 :> Configurations[1]]

\* Alternative to CCF!Init that uses the above MCInitReconfigurationVars
MCInit ==
/\ MCInitReconfigurationVars
/\ CCF!InitMessagesVars
/\ CCF!InitServerVars
/\ CCF!InitCandidateVars
/\ CCF!InitLeaderVars
/\ CCF!InitLogVars

\* Alternative to CCF!Spec that uses the above MCInit
mc_spec ==
/\ MCInit
/\ [][Next]_vars

\* Symmetry set over possible servers. May dangerous and is only enabled
\* via the Symmetry option in cfg file.
Expand All @@ -103,7 +124,7 @@ View == << reconfigurationVars, <<messages, commitsNotified>>, serverVars, candi

AllReconfigurationsCommitted ==
\E s \in ToServers:
\A c \in ToSet(Configurations):
\A c \in ToSet(Tail(Configurations)):
\E i \in DOMAIN Committed(s):
/\ HasTypeReconfiguration(Committed(s)[i])
/\ Committed(s)[i].configuration = c
Expand Down

0 comments on commit 3a3e4b9

Please sign in to comment.