Skip to content

State the assumptions and split the model into MCbtree - #231

Open
lemmy wants to merge 2 commits into
masterfrom
mku-btree
Open

State the assumptions and split the model into MCbtree#231
lemmy wants to merge 2 commits into
masterfrom
mku-btree

Conversation

@lemmy

@lemmy lemmy commented Aug 22, 2026

Copy link
Copy Markdown
Member

@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.

lemmy and others added 2 commits August 22, 2026 07:59
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>
@lorin

lorin commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants