Skip to content

Commit

Permalink
Rename kani::any_value_where to kani::any_where (#2139)
Browse files Browse the repository at this point in the history
  • Loading branch information
adpaco-aws authored Jan 20, 2023
1 parent 47014e6 commit c90f447
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions library/kani/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,15 @@ pub fn any<T: Arbitrary>() -> T {
/// under all possible `NonZeroU8` input values between 0 and 12.
///
/// ```rust
/// let inputA = kani::any_value_where::<std::num::NonZeroU8>(|x| *x < 12, "explanation");
/// let inputA = kani::any_where::<std::num::NonZeroU8>(|x| *x < 12, "explanation");
/// fn_under_verification(inputA);
/// ```
///
/// Note: This is a safe construct and can only be used with types that implement the `Arbitrary`
/// trait. The Arbitrary trait is used to build a symbolic value that represents all possible
/// valid values for type `T`.
#[inline(always)]
pub fn any_value_where<T: Arbitrary, F: FnOnce(&T) -> bool>(f: F, _msg: &'static str) -> T {
pub fn any_where<T: Arbitrary, F: FnOnce(&T) -> bool>(f: F, _msg: &'static str) -> T {
let result = T::any();
assume(f(&result));
result
Expand Down
4 changes: 2 additions & 2 deletions tests/kani/Assume/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ fn main() {
}

#[kani::proof]
fn verify_any_value_where() {
let i: i32 = kani::any_value_where(|x| *x < 10, "Only single digit values are legal");
fn verify_any_where() {
let i: i32 = kani::any_where(|x| *x < 10, "Only single digit values are legal");
assert!(i < 20);
}

0 comments on commit c90f447

Please sign in to comment.