Conversation
The three constants were declared without any ASSUME, and they are not the same kind of constraint. MaxOccupancy is the branching factor, so the tree itself requires it: below 2, PivotOf leaves one side of every split empty, the emptied leaf is still reachable from its parent, and IsFree reports it as free for ChooseFreeNode to hand out a second time. At MaxOccupancy = 1 that corrupts the tree and KeyOrderPreserved fails in 24 steps. MaxNode must likewise cover the root that Init allocates, or the CHOOSE in ChooseFreeNode has nothing to pick and TLC dies while computing initial states. MaxKey is different. The algorithm bounds neither the key domain nor the node pool; both bounds exist so Keys, Nodes and the domains of childOf and valOf stay finite for TLC, which is also what FreeNodesRemain really checks. An empty key domain leaves the tree well formed but enables no request action, so TLC reports a deadlock on Init rather than a defect. The comments group the assumptions accordingly. Co-authored-by: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: Markus Alexander Kuppe <github.com@lemmster.de>
Keeping the datastructure and the definitions that exist only to make model checking finite in one module left no way to tell which was which. btree.tla is now the algorithm alone, MCbtree.tla the model. Co-authored-by: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: Markus Alexander Kuppe <github.com@lemmster.de>
Contributor
|
👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
@lorin, could please confirm and approve the refactoring of your btree TLA+ spec. The refactorings are a predecessor to eventually proving properties of btree with TLAPS.