-
Notifications
You must be signed in to change notification settings - Fork 123
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
all-sat performance #1125
Comments
Thanks for the link, I'll definitely be interested in learning about it. As to the performance difference, that's absolutely something I'm interested in tracking down. |
Speculative hypothesis: the What4 backend is currently slow for all-sat because it spawns a separate solver process for each subsequent query instead of doing incremental solving, whereas I think SBV is doing incremental solving in these cases. We know from experience that the process creation overhead alone can be quite significant in cases like this. We should probably switch over to using incremental solving modes for the solvers that support them. |
That's correct. SBV uses incremental mode for |
The solvers we currently support all have an incremental/online mode, and we reconfigure the `:sat` `:prove` and `:safe` commands to use them. In particular, we use incremental solving to significantly speed up multi-SAT queries, partially addressing #1125.
The solvers we currently support all have an incremental/online mode, and we reconfigure the `:sat` `:prove` and `:safe` commands to use them. In particular, we use incremental solving to significantly speed up multi-SAT queries, partially addressing #1125.
For this program:
The current SBV backend finds all solutions in about 20 seconds:
The w4 backend seems to be about 15 times slower:
I'm not sure why there's such a big discrepancy; perhaps something to look at.
Furthermore, the new SBV release (v8.13) (https://hackage.haskell.org/package/sbv-8.13) has an improved
allSat
algorithm. To wit:Which is about 8 times faster than the previous SBV algorithm, and about 130 times faster than the w4-z3 backend as it stands.
You can get a performance boost simply by upgrading to SBV8.13 of course; but for w4 maybe you also want to implement the faster algorithm, which is described at: http://theory.stanford.edu/%7Enikolaj/programmingz3.html#sec-blocking-evaluations
The text was updated successfully, but these errors were encountered: