Repository navigation
Open
Labels
T-CBMCIssue related to an existing CBMC issueIssue related to an existing CBMC issueZ-QuantifiersIssues related to quantifiersIssues related to quantifiers[C] BugThis is a bug. Something isn't working.This is a bug. Something isn't working.[F] Spurious FailureIssues that cause Kani verification to fail despite the code being correct.Issues that cause Kani verification to fail despite the code being correct.
Milestone
Description
I tried this code:
#[kani::proof]
fn main() {
let a: [usize; 60] = kani::any();
kani::assume(kani::forall!(|i in (0,60)| a[i] <= 20));
let mut b: [usize; 60] = a.clone();
let mut i = 0;
#[kani::loop_invariant( i<= 60 && kani::forall!(|j in (0, i)| b[j] == a[j]+ 1))]
while i < 60 {
b[i] = a[i] + 1;
i += 1;
}
} using the following command line invocation:
kani main.rs -Z loop-contracts -Z quantifiers
with Kani version: 0.64.0
I expected to see this happen: VERIFICATION:- SUCCESSFUL
Instead, this happened:
warning: ignoring forall
* type: bool
0: tuple
... (very long)
Failed Checks: Check invariant after step for loop main2.0
When I try to add #[kani::solver(cvc5)]
The output is:
Running SMT2 ALL (with FPA) using CVC5
SMT2 solver returned "unknown"
Runtime Solver: 0.216097s
Runtime decision procedure: 0.222155s
thread '<unnamed>' panicked at kani-driver/src/cbmc_output_parser.rs:470:25:
called `Result::unwrap()` on an `Err` value: Error("unknown variant `ERROR`, expected one of `FAILURE`, `COVERED`, `SATISFIED`, `SUCCESS`, `UNDETERMINED`, `UNKNOWN`, `UNREACHABLE`, `UNCOVERED`, `UNSATISFIABLE`", line: 12, column: 25)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Metadata
Metadata
Assignees
Labels
T-CBMCIssue related to an existing CBMC issueIssue related to an existing CBMC issueZ-QuantifiersIssues related to quantifiersIssues related to quantifiers[C] BugThis is a bug. Something isn't working.This is a bug. Something isn't working.[F] Spurious FailureIssues that cause Kani verification to fail despite the code being correct.Issues that cause Kani verification to fail despite the code being correct.
Activity
tautschnig commentedon Aug 8, 2025
What about Z3 instead of cvc5?
thanhnguyen-aws commentedon Aug 8, 2025
Here is Z3's result:
tautschnig commentedon Aug 12, 2025
We'll need a Z3 release that includes the fix for Z3Prover/z3#7743 or the workaround in CBMC in diffblue/cbmc#8703 to be merged. Bitwuzla usually works fine in such situations, but it might take a lot longer to complete.