chore: Tune Boogie encoding for better solver performance #6194
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains three changes to our Boogie encoding to improve performance of Z3 when solving Dafny generated problems:
$Unbox
and$Box
as each other's inverseeager_threshold
and linear scaling of existing weightsI arrived at those by benchmarking on a set of code bases, most of which are closed source. They have been pseudonymized (A.0, A.1, B.old, and B.new). A.0 and A.1 share some code and talk about the same problem. B.old and B.new are snapshots of the some code base, but changes have been made to improve proof stability. The open source one, are the Dafny standard libraries. To ensure the changes don't overfit, I added another code base (C) on the final evaluation and tested on a more recent version of Z3 (4.14.1 vs. 4.12.1). The table below shows the changes to the runtime of Z3 on those code bases when making the proposed changes.
Below, there are more detailed statistics.
Z3 v4.12.1
Z3 v4.14.1