Skip to content

Commit

Permalink
Move refinement mapping from TLC-specific module into ccfraft.
Browse files Browse the repository at this point in the history
Depends on TLA+ PR tlaplus/tlaplus#1014

Signed-off-by: Markus Alexander Kuppe <github.com@lemmster.de>
  • Loading branch information
lemmy committed Sep 12, 2024
1 parent cb9542e commit 619a4e8
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
2 changes: 2 additions & 0 deletions tla/consensus/MCccfraft.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ CONSTANTS
NodeTwo = n2
NodeThree = n3

RefinementToAbsProp <- MCRefinementToAbsProp

SYMMETRY Symmetry
VIEW View

Expand Down
11 changes: 1 addition & 10 deletions tla/consensus/MCccfraft.tla
Original file line number Diff line number Diff line change
Expand Up @@ -128,18 +128,9 @@ DebugNotTooManySigsInv ==

----
\* Refinement

\* The inital log is up to 4 entries long + one log entry per request/reconfiguration + one signature per request/reconfiguration or new view (no consecutive sigs except across views)
MaxLogLength ==
4 + ((RequestLimit + Len(Configurations)) * 2) + MaxTermLimit

MappingToAbs ==
INSTANCE abs WITH
Servers <- Servers,
Terms <- StartTerm..MaxTermLimit,
MaxLogLength <- MaxLogLength,
cLogs <- [i \in Servers |-> [j \in 1..commitIndex[i] |-> log[i][j].term]]

RefinementToAbsProp == MappingToAbs!AbsSpec
MCRefinementToAbsProp == MappingToAbs(StartTerm..MaxTermLimit, MaxLogLength)!AbsSpec

===================================
16 changes: 16 additions & 0 deletions tla/consensus/ccfraft.tla
Original file line number Diff line number Diff line change
Expand Up @@ -1671,4 +1671,20 @@ DebugCommittedEntriesTermsInv ==
k <= commitIndex[i]
=> log[i][k].term >= log[j][k].term


------------------------------------------------------------------------------
\* Refinement of the more high-level specification abs.tla that abstracts the
\* asynchronous network and the message passing between nodes. Instead, any
\* node may atomically observe the state of any other node.

MappingToAbs(T, MLL) ==
INSTANCE abs WITH
Servers <- Servers,
Terms <- T,
MaxLogLength <- MLL,
cLogs <- [i \in Servers |-> [j \in 1..commitIndex[i] |-> log[i][j].term]]

RefinementToAbsProp == \EE T, M : MappingToAbs(T, M)!AbsSpec
THEOREM Spec => RefinementToAbsProp

===============================================================================

0 comments on commit 619a4e8

Please sign in to comment.