ballot
accepted
curr_state | incoming_message | next_state |
---|---|---|
S.ballot S.accepted |
m <P1A, b, m.b > S.ballot |
S.ballot = s.ballot |
m <P1A, b, m.b <= S.ballot |
S | |
m <P2A, m.b = S.ballot |
S.accepted[m.s] = m.<b,s,c> | |
m <P2A, m.b != S.ballot |
S | |
m <P1B, b, accepted>
- S.ballot <= m.b
- S.accepted is a subset of m.accepted or they are equal
m <P2B, b>
- S.ballot <= m.b
m <P1B, b, accepted>
- S.ballot = m.b
- S.accepted = m.accepted
m <P2B, b>
- S.ballot = m.b
ballot
proposals
pvalues
,p1b_count
,p2b_count
(for simulating the job of Scouts and commanders)
curr_state | incoming_message | next_state |
---|---|---|
S.ballot S.proposals S.p1b_count S.p2b_count |
m <propose, s, c> m.propose |
S |
m <propose, s, c> m.propose |
S.proposals.add(m.<s, c>) | |
m <adoption, b, pvalues> |
update S.proposals with pvalues | |
m <preemption, b> m.b > S.ballot |
S |
Scout $$ \begin{aligned} Scout\space such&\space that\ &scout.ballot > S.ballot\ \end{aligned} $$ Commander $$ \begin{aligned} &Commander \space such\space that\ &cmd.ballot = S.ballot\ &cmd.proposal \in S.accepted \implies\ cmd.proposal.<s,c> &=S.accepted.<s,c> \end{aligned} $$
- simply do the total simulation, enforce all invariants
- do not do total simulation, then we can never ensure all invariants, but detect errors in some situations by extra assertions
- total simulation + redundency extra assertion