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

Add support for uninterpreted function stub #3112

Open
celinval opened this issue Mar 27, 2024 · 2 comments
Open

Add support for uninterpreted function stub #3112

celinval opened this issue Mar 27, 2024 · 2 comments
Labels
[C] Feature / Enhancement A new feature request or enhancement to an existing feature. T-User Tag user issues / requests

Comments

@celinval
Copy link
Contributor

celinval commented Mar 27, 2024

Requested feature: Stubs that behave like an uninterpreted function.
Use case: Generating stubs that return the same arbitrary value for multiple invocations if the inputs are the same.
Link to relevant documentation (Rust reference, Nomicon, RFC): http://www.cprover.org/cprover-manual/modeling/nondeterminism/ and https://model-checking.github.io/kani/rfc/rfcs/0002-function-stubbing.html#future-possibilities

Example:

/// This harness has some code that is conditional on the value of a few arguments.
/// Check that it behaves for all combination of arguments, however,
/// an argument should always have the same value.
#[kani::proof]
#[kani::stub_uninterpreted(Arg::is_enabled)]
fn check_uninterpreted() {
    /* logic goes here */
}

Note: We will have to figure out the best mechanism to only return valid values.

@celinval celinval added [C] Feature / Enhancement A new feature request or enhancement to an existing feature. T-User Tag user issues / requests labels Mar 27, 2024
@celinval
Copy link
Contributor Author

@nchong-at-aws would that make sense?

@nchong-at-aws
Copy link
Contributor

Yes, exactly right. The behavior I want is a function whose result is non-deterministic but different calls will return the same value if the inputs are the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C] Feature / Enhancement A new feature request or enhancement to an existing feature. T-User Tag user issues / requests
Projects
None yet
Development

No branches or pull requests

2 participants