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
Add loop_invariants for some Int power functions (#327)
Is PR add loop_invariants for `checked_pow`, `wrapping_pow`,
`overflowing_pow` functions in `library/core/src/num/uint_macros.rs` and
`library/core/src/num/int_macros.rs`.
Side notes:
- We need the feature that separate panic and other UBs to verify the
function `strict_pow`, because this function calls `strict_mul`, which
will panic when overflow happens.
- The function `pow` can overflow and may require contracts, such as
```
#[kani::requires(self.checked_pow(exp).is_some())]
#[kani::ensures(|x| *x == self.checked_pow(exp).unwrap())]
```
By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 and MIT licenses.
Co-authored-by: Michael Tautschnig <[email protected]>
0 commit comments