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

Update Bitwuzla to version 0.7.X #427

Merged
merged 10 commits into from
Jan 16, 2025
Merged

Conversation

daniel-raffler
Copy link
Contributor

Hello,
this will update Bitwuzla to a version just past release 0.7.0. The upgrade is minor, but includes a bug fix for bitwuzla/bitwuzla#149 which is currently affecting CPAchecker when trying to use different solvers for interpolation and regular solving (see this issue).

We may still want to wait for #395 to be merged to avoid having to update our bindings twice.

…IG headers where some exceptions were not properly caught
The new test executes the new simplify-method,
but simplification returns an identical term.
It is unclear, whether or how far Bitwuzla modifies a term at all.
@kfriedberger kfriedberger self-assigned this Jan 11, 2025
Copy link
Member

@kfriedberger kfriedberger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good so far.

I will compile and test, then merge this.
With some inter-branch-merging, we can build the x64 and arm64 version of Bitwuzla, as given from #395 without publishing the binaries twice.

@kfriedberger
Copy link
Member

kfriedberger commented Jan 12, 2025

ModelTest and FloatingPointFormulaManagerTest seem to fail with the latest version of Bitwuzla.

Reasons:

  • FP theory only supports limited standard bitsizes by default: bitwuzla/bitwuzla@c4085cc --> we can provide a library with the corresponding flag enabled. maybe we should also add a runtime flag for JavaSMT about this.
  • Model evaluation of UFs does no longer simplify constant terms. --> this needs to be reported to the developers.

The solver partially returns constant nested expressions.
We need to simplify them before conversion to Java type.
This reverts commit 874f5a4.

The term simplification would work and satisfy the ModelTest,
but it is too slow and quote memory-inefficient.
To avoid bugs, Bitwuzla disabled uncommon sizes for FP types.
See bitwuzla/bitwuzla@c4085cc .
@kfriedberger
Copy link
Member

@daniel-raffler can you take a look at the fialing tests with model evaluation and report to the developers of Bitwuzla. Thanks.

After fixing it, we can compile Bitwuzla again and merge this PR.

@daniel-raffler
Copy link
Contributor Author

@daniel-raffler can you take a look at the fialing tests with model evaluation and report to the developers of Bitwuzla. Thanks.

After fixing it, we can compile Bitwuzla again and merge this PR.

I'll have a look at it tomorrow. Thanks for all your work so far!

We used to set this option to 0 to completely disable rewriting of formulas, but this is now causing issues in some of the tests. Leaving the option at its default value (= fully rewriting) seems to solve the problem.
@daniel-raffler
Copy link
Contributor Author

* Model evaluation of UFs does no longer simplify constant terms. --> this needs to be reported to the developers.

This only seems to be any issue when we use the option REWRITE_LEVEL=0 (docs) to disable all term rewriting. I've tried removing this option in a22a009 and this appears to have fixed the problem.

Should I still report this as a bug? It's probably OK for Bitwuzla to return the terms unsimplified when the option is set to zero, and I didn't see any other issues when just leaving it at its default value. Then again there might be some performance implications if we just always leave rewriting on.

@kfriedberger
Copy link
Member

Thanks for the quick fix. Looks good.
Basic term rewriting is required for simplifying constant terms. I missed that change in the review.
No need to report a bug.

@kfriedberger kfriedberger merged commit 1e5b4cc into master Jan 16, 2025
1 of 3 checks passed
@kfriedberger kfriedberger deleted the update_bitwuzla_for_sbv_bugfix branch January 16, 2025 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants