generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 141
Closed
Labels
T-UserTag user issues / requestsTag user issues / requests[C] Feature / EnhancementA new feature request or enhancement to an existing feature.A new feature request or enhancement to an existing feature.[E] Unsupported ConstructAdd support to an unsupported constructAdd support to an unsupported construct
Description
Requested feature: powf
Use case: I want to verify a function that uses powf
Link to relevant documentation (Rust reference, Nomicon, RFC): https://doc.rust-lang.org/std/primitive.f64.html#method.powf
Test case:
pub fn f(a: u64) -> u64 {
const C: f64 = 0.618;
(a as f64).powf(C) as u64
}
#[cfg(kani)]
mod verification {
use super::*;
#[kani::proof]
fn verify_f() {
const LIMIT: u64 = 10;
let x: u64 = kani::any();
let y: u64 = kani::any();
kani::assume(x < LIMIT || x > u64::MAX - LIMIT);
kani::assume(y < LIMIT || y > u64::MAX - LIMIT);
kani::assume(x > y);
let x_ = f(x);
let y_ = f(y);
assert!(x_ >= y_);
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
T-UserTag user issues / requestsTag user issues / requests[C] Feature / EnhancementA new feature request or enhancement to an existing feature.A new feature request or enhancement to an existing feature.[E] Unsupported ConstructAdd support to an unsupported constructAdd support to an unsupported construct