Add history variable to the cluster state machine #542
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR augments the cluster state machine with a history that records all the past global state of the cluster. The history will help us prove some invariants that involve resource version of state objects.
Instead of modifying the cluster state machine's definition (and all its references) to maintain the history, this PR adds a new state machine, called retentive cluster, that wraps up the original state machine's
init
andnext
and meanwhile maintains a history of the original state machine. This brings several benefits: (1) it minimizes the changes we need to make to the current spec and lemmas (in fact, no changes are needed) to use the history variable, (2) it allows us to stick with the original state machine (w/o the history) in the cases where we don't need to use the history variable just like what we are doing.It is obvious that any invariant on the cluster state (not the history) can be transferred between the two state machines because they are identical except the history recording. To transfer invariants, this PR also introduces two lemmas
transfer_invariant_to_cluster
andtransfer_invariant_from_cluster
.