-
Notifications
You must be signed in to change notification settings - Fork 101
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
Match expressions with | and variables causing spurious failure. #3432
Comments
Hi @B-Lorentz , thanks for reporting this issue! I have been able to reproduce it using Kani v0.53.0. Luckily, it looks like it's fixed in the next version, which is going to be released very soon. If you don't want to wait for the release, please compile from source to avoid this issue. |
We still need to figure out why this is now fixed, i.e., which change made the difference. |
I did some debugging here, and it looks like the problem was related to handling of To confirm that, I checkout the parent commit of e4078b4 which contains the spurious failure. Then applied the changes to # All of this requires old CBMC 5.95.1
git co e4078b4bdb2~
cargo build-dev
kani match_pattern.rs # This fails
git diff HEAD..e4078b4bdb2 -- kani-compiler/ cprover_bindings/src/env.rs cprover_bindings/src/lib.rs > /tmp/kani.patch
patch -p1 < /tmp/kani.patch
cargo build-dev
kani match_pattern.rs # This succeeds |
Let me add the test case first. |
Thank you all. |
In some cases, Kani would report a spurious counter example for cases where a match arm contained more than one pattern. This was fixed by changing how we handle storage lifecycle in #2995. This PR is only adding the related test to the regression. Resolves #3432 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.
I tried this code:
and the equivalent implementaion of merge, using a | in the pattern:
using the following command line invocation:
with Kani version: Kani Rust Verifier 0.53.0 (standalone)
I expected to see this happen: I expected the proof to verify with both implementations of merge.
Instead, this happened: The proof verifies with the implementation where (Bottom, x) and (x, Bottom) are on separate lines, but fails when they are on the same line separated by a |:
The text was updated successfully, but these errors were encountered: