Skip to content

Create an API for loop contracts #3168

@qinheping

Description

@qinheping

Requested feature: Loop contracts
Use case: Verify the provided loop contracts, and use the loop contracts to abstract out the loops from the verification process.
Link to relevant documentation (Rust reference, Nomicon, RFC): #3167

Test case:

#[kani::proof]
fn main() {
    let mut x: u64 = kani::any_where(|i| *i >= 1);

    #[kani::loop_invariant(x >= 1)]
    while x > 1{
        x = x - 1;
    };

    assert!(x == 1);
}

Metadata

Metadata

Assignees

Labels

Z-ContractsIssue related to code contracts[C] Feature / EnhancementA new feature request or enhancement to an existing feature.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions