Skip to content

Challenge 4: Kani contracts for BTreeMap node - #641

Open
sankalpsthakur wants to merge 5 commits into
model-checking:mainfrom
sankalpsthakur:challenge/04-btree-node
Open

Challenge 4: Kani contracts for BTreeMap node#641
sankalpsthakur wants to merge 5 commits into
model-checking:mainfrom
sankalpsthakur:challenge/04-btree-node

Conversation

@sankalpsthakur

Copy link
Copy Markdown

Summary

Kani safety contracts and proof harnesses for this challenge. Runtime stdlib logic is unchanged; annotations are cfg(kani) / contract attributes.

Memory-safety contracts on btree::node.

Validation

  • Local worktree on challenge/04-btree-node
  • Kani CI on this PR is the authoritative run (scripts/run-kani.sh)

Fixes #77

AI/LLM disclosure

  • AI coding tools (including Grok and/or Codex agent-assisted editing) were used to help draft or modify code and this PR description.
  • I reviewed the complete change, understand the reasoning, and take responsibility for the contracts and harnesses.
  • This submission is original work of authorship under the project contributor terms; AI output was not pasted unreviewed.

Kani contracts and harnesses for verify-rust-std challenge.

Fixes rust-lang#77
@sankalpsthakur
sankalpsthakur requested a review from a team as a code owner August 20, 2026 12:08
Drop the duplicate super imports that failed rustc fmt. Build
symbolic leaves without nested Handle::new_kv so the contract
proof has a single top-level call. Replace n+count in any_where
predicates with saturating_sub so Kani does not fail on usize
overflow.
Drop the weak loop_invariant that havocs SplitResult node pointers
into unconstrained values. Copy leaf occupancy with ptr::copy so
insert_recursing proofs can use unwind 3 instead of 13.
Partition 1 and autoharness ubuntu ended with runner shutdown, not a Kani counterexample.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Challenge 4: Memory safety of BTreeMap's btree::node module

1 participant