You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Verify all 38 NonZero functions listed in the challenge specification.
432 Kani proof harnesses across all 12 integer types, 0 failures.
Part 1: Harnesses for `new` (iff + value equality assertions) and
`from_mut` (iff + dereference). Pre-existing contracts and harnesses
for `new_unchecked` and `from_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_pow in uint_macros.rs and
int_macros.rs from `true` to `self == 0 || (acc > 0 && base > 0)`.
This is a verification-only annotation (no-op at runtime) that
preserves the nonzero property through exponentiation loop iterations.
abs and neg harnesses exclude T::MIN (documented overflow behavior).
The MIN case is separately verified by wrapping_abs, overflowing_abs,
wrapping_neg, and overflowing_neg which pass for all inputs.
Resolves#71
### Part 2: Absolute Value & Negation (signed only)
138
+
139
+
| Function | Harness | Types | Notes |
140
+
|----------|---------|-------|-------|
141
+
|`abs`|`nonzero_check_abs`| 6 signed | Excludes MIN (documented overflow) |
142
+
|`checked_abs`|`nonzero_check_checked_abs`| 6 signed ||
143
+
|`overflowing_abs`|`nonzero_check_overflowing_abs`| 6 signed ||
144
+
|`saturating_abs`|`nonzero_check_saturating_abs`| 6 signed ||
145
+
|`wrapping_abs`|`nonzero_check_wrapping_abs`| 6 signed | Covers MIN |
146
+
|`unsigned_abs`|`nonzero_check_unsigned_abs`| 6 signed ||
147
+
|`neg`|`nonzero_check_neg`| 6 signed | Excludes MIN (documented overflow) |
148
+
|`checked_neg`|`nonzero_check_checked_neg`| 6 signed ||
149
+
|`overflowing_neg`|`nonzero_check_overflowing_neg`| 6 signed | Covers MIN |
150
+
|`wrapping_neg`|`nonzero_check_wrapping_neg`| 6 signed | Covers MIN |
151
+
|`max`|`nonzero_check_max` (pre-existing) | all 12 ||
152
+
|`min`|`nonzero_check_min` (pre-existing) | all 12 ||
153
+
|`clamp`|`nonzero_check_clamp` (pre-existing) | all 12 ||
154
+
155
+
### Additional Changes
156
+
157
+
Strengthened `#[safety::loop_invariant]` on `checked_pow` in `uint_macros.rs` and `int_macros.rs` from `true` to a property that preserves the nonzero invariant through loop iterations. This is a verification annotation fix, not a runtime logic change.
0 commit comments