Skip to content
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

Bitwuzla reports error on simple function verification #8384

Closed
rod-chapman opened this issue Jul 16, 2024 · 1 comment · Fixed by #8387
Closed

Bitwuzla reports error on simple function verification #8384

rod-chapman opened this issue Jul 16, 2024 · 1 comment · Fixed by #8387
Labels
aws Bugs or features of importance to AWS CBMC users bug pending merge SMT Backend Interface Solvers

Comments

@rod-chapman
Copy link
Collaborator

CBMC version: 6.0.1 (HEAD of develop branch, 16th July 2024)
Operating system: macOS
Exact command line resulting in the issue: See below
What behaviour did you expect: success
What happened instead: error from Bitwuzla

Verification of the "zero_slice" function here:
https://github.com/rod-chapman/cbmc-examples/tree/main/arrays

works fine with Z3, but causes a weird error from Bitwuzla 0.5.0

To reproduce - clone and pull the repo above, then

cd arrays
goto-cc --function zero_slice_harness -DCBMC -o ar.goto ar.c
goto-instrument --dfcc zero_slice_harness --apply-loop-contracts --enforce-contract zero_slice  ar.goto ar_contracts.goto
cbmc --verbosity 6 --bounds-check --pointer-check --memory-cleanup-check --div-by-zero-check --signed-overflow-check --unsigned-overflow-check --pointer-overflow-check --conversion-check --undefined-shift-check --enum-range-check --pointer-primitive-check --smt2 ar_contracts.goto

so far so good - it all works fine with Z3. But try the final step with Bitwuzla 0.5.0:

cbmc --verbosity 6 --bounds-check --pointer-check --memory-cleanup-check --div-by-zero-check --signed-overflow-check --unsigned-overflow-check --pointer-overflow-check --conversion-check --undefined-shift-check --enum-range-check --pointer-primitive-check --bitwuzla ar_contracts.goto

and it fails with many "ERROR" lines on the output.

To see a bit more details, we can capture the SMT2 output, thus:

cbmc --verbosity 6 --bounds-check --pointer-check --memory-cleanup-check --div-by-zero-check --signed-overflow-check --unsigned-overflow-check --pointer-overflow-check --conversion-check --undefined-shift-check --enum-range-check --pointer-primitive-check --bitwuzla --outfile zero_slice_bitwuzla.smt2 --bitwuzla ar_contracts.goto

then

bitwuzla zero_slice_bitwuzla.smt2

yields

[error] zero_slice_bitwuzla.smt2:3409:89: undefined symbol 'lambda'

Line 3409 of that file contains

(define-fun |symex_dynamic::dynamic_object$10#3| () (Array (_ BitVec 64) (_ BitVec 8)) (lambda (($array_comprehension_index_u_a_v1 (_ BitVec 64))) (ite (or (not (bvsge $array_comprehension_index_u_a_v1 (_ bv0 64))) (bvuge $array_comprehension_index_u_a_v1 |__CPROVER_contracts_write_set_havoc_slice::1::car!0@1#2..size|)) (select |symex_dynamic::dynamic_object$10#2| $array_comprehension_index_u_a_v1) (select |__CPROVER_contracts_write_set_havoc_slice::$tmp::tmp_nondet_contents!0@1#1| $array_comprehension_index_u_a_v1))))

Note the appearance of "lambda" in that line - it does not appear anywhere else in the file... so not sure what's going wrong there...

@tautschnig
Copy link
Collaborator

tautschnig commented Jul 17, 2024

It seems that Bitwuzla doesn't actually support lambda expressions. Fixed in #8387. Your example appears to work fine with Bitwuzla with that change in place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aws Bugs or features of importance to AWS CBMC users bug pending merge SMT Backend Interface Solvers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants