Skip to content

Challenge 17: Kani contracts for slice functions - #647

Open
sankalpsthakur wants to merge 6 commits into
model-checking:mainfrom
sankalpsthakur:challenge/17-slice
Open

Challenge 17: Kani contracts for slice functions#647
sankalpsthakur wants to merge 6 commits into
model-checking:mainfrom
sankalpsthakur:challenge/17-slice

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.

Slice module unsafe operations.

Validation

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

Fixes#281

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.
Fixesrust-lang#281
@sankalpsthakur
sankalpsthakur requested a review from a team as a code ownerAugust 20, 2026 12:08
Apply rust-lang rustfmt (use_small_heuristics = Max) to the slice
files from this challenge so upstream_test format passes.
Overflow-safe invariants and loop_modifies so
check_binary_search_by and check_partition_dedup_by verify.
Autoharness ubuntu ended with runner shutdown after 1h11m, not a Kani counterexample.
CAP=8 plus symbolic mid times out autoharness's 10m CBMC cap on
ptr_rotate, rotate_left, rotate_right, and swap_with_slice (1423/4).
Fixed length 2 still runs the real memmove / swap_nonoverlapping path.
@feliperodrifeliperodri added the Challenge Used to tag a challenge label Aug 20, 2026
GOTO codegen failed E0502: rotate_left/right mut-borrow arr while
any_where reads arr.len() in the same argument. Snapshot len first.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ChallengeUsed to tag a challenge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Challenge 17: Verify the safety of slice functions

2 participants

@sankalpsthakur@feliperodri