You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Kani is now sure we've unwound the loop enough to verify our proof harness, and now we're seeing just the bound checking failures from the off-by-one error.
81
81
82
+
## Unwinding value specification
83
+
84
+
Kani allows three options to specify the unwind value for a particular harness:
85
+
86
+
1. The unwind annotation `#[kani::unwind(<num>)]`. This sets the unwind value for the harness with the annotation. Example -
87
+
```rust,noplaypen
88
+
#[kani::proof]
89
+
#[kani::unwind(3)]
90
+
fn proof_harness() {
91
+
[...]
92
+
}
93
+
```
94
+
2.`--default-unwind` flag. This sets the global or default unwind value for the entire file/crate on which kani or cargo-kani is called. Example -
95
+
```
96
+
kani file.rs --default-unwind 3
97
+
```
98
+
3.`--unwind` flag. This overrides any annotation and forces the harness to use the specified value. This needs to be used alongside `--harness` and sets the unwind value for the harness specified. Example -
99
+
```
100
+
kani file.rs --unwind 2 --harness proof_harness
101
+
```
102
+
103
+
### Exercises -
104
+
82
105
1. Exercise: Fix the off-by-one bounds error and get Kani to verify successfully.
83
106
2. Exercise: After fixing the error, `--default-unwind 11` works. Why?
0 commit comments