generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 134
Closed
Labels
[C] Feature / EnhancementA new feature request or enhancement to an existing feature.A new feature request or enhancement to an existing feature.
Description
Requested feature: loop_old similar to old that can refers to historic values in loop contracts
Use case:
#[kani::loop_invariants(loop_old(x) == y)]
where loop_old(x) refers to the value of x upon the entrance of the loop.
Link to relevant documentation (Rust reference, Nomicon, RFC): #3167
Test case:
let mut x: u8 = kani::any_where(|v| *v < 10);
let mut y: u8 = kani::any();
let mut i = 0;
#[kani::loop_invariants(i == 0 || loop_old(x) == y)]
while i < 5{
if i == 0{
y = x
}
x += 1;
i += 1;
}Metadata
Metadata
Assignees
Labels
[C] Feature / EnhancementA new feature request or enhancement to an existing feature.A new feature request or enhancement to an existing feature.