Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use bolero generators from any location in kani proof #194

Open
camshaft opened this issue Oct 26, 2023 · 0 comments
Open

Use bolero generators from any location in kani proof #194

camshaft opened this issue Oct 26, 2023 · 0 comments

Comments

@camshaft
Copy link
Owner

camshaft commented Oct 26, 2023

Currently, bolero generators require a Driver to generate a value. This requires some set up and implementing quite a few trait methods. For kani proofs, generating arbitrary values can potentially happen in any location. Ideally, we would include a method on the ValueGenerator trait that would allow kani proofs to leverage bolero generators.

#[derive(Debug, TypeGenerator)]
struct MyStruct {
    #[generator(0..4)]
    my_field: u64
}

#[kani::proof]
fn my_proof() {
    let v = gen::<MyStruct>().any();
    assert!((0..4).contains(&v.my_field));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant