Challenge 12: Verify safety of NonZero#565
Open
Samuelsills wants to merge 1 commit intomodel-checking:mainfrom
Open
Challenge 12: Verify safety of NonZero#565Samuelsills wants to merge 1 commit intomodel-checking:mainfrom
Samuelsills wants to merge 1 commit intomodel-checking:mainfrom
Conversation
938fdd1 to
32bbacc
Compare
Verify all 38 NonZero functions listed in the challenge specification. 432 Kani proof harnesses across all 12 integer types, 0 failures. Resolves model-checking#71 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.
32bbacc to
71e54d0
Compare
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.
Summary
Verify all 38 NonZero functions listed in Challenge 12. 432 Kani proof harnesses across all 12 integer types, 0 failures.
Part 1: Harnesses for
new(iff + value equality assertions) andfrom_mut(iff + dereference). Pre-existing contracts and harnesses fornew_uncheckedandfrom_mut_unchecked.Part 2: Harnesses for all 34 listed functions including bitor (3 impls), count_ones, rotate_left/right, swap_bytes, reverse_bits, endianness conversions, checked/saturating mul/pow/add, checked_next_power_of_two, midpoint, isqrt, abs variants (6), and neg variants (4).
Strengthened loop invariant on
checked_powinuint_macros.rsandint_macros.rsfromtrueto a property that preserves the nonzero invariant through loop iterations. This is a verification-only annotation (no-op at runtime).absandnegharnesses excludeT::MIN(documented overflow behavior). The MIN case is separately verified bywrapping_abs,overflowing_abs,wrapping_neg, andoverflowing_negwhich pass for all inputs.Resolves #71
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.