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
QF_UFBV performance #1150
Comments
Just to confirm: this is QF_UFBV (no quantifiers). Of course, it's completely expected that Z3 does not perform as good as other tools on at least one of the benchmarks. Does it also outperform the other tools on at least one benchmark? Further, in the presence of UFs, Z3 is forced to use the oldest, slowest solver and it can't use the pure, new, fast SAT solver. We'd be very happy about improvements on that end, but afaik nobody is currently working on this. |
@wintersteiger Yes, QF_UFBV, no quantifiers are present. I'm not quite sure how Z3 compares to others on QF_UFBV; but this test case stood out in my test suite. (I usually only test with Z3, unless there's a case that seems to be a bottleneck. Then I try others.) Use of UFs: Unfortunately UF's are part of the general story for me. I guess it can also be coded using arrays, but that's not what the backend generates currently. (And I had better luck with UFs compared to Arrays in the past.) In essence, any time there's a table-lookup I end up creating UFs. Would be really nice if the new solver supported UFs! |
@LeventErkok Just to note the I started experiment with a custom tactic that tries to reduce the problem to |
@LeventErkok Sorry looks like this doesn't help. Using
doesn't remove the UF function. It would be nice if there was a Z3 tactic that could replace all applications of @wintersteiger @NikolajBjorner Does a tactic doing what I describe exist? |
Thanks for the example. It is a very good case for bit-width reduction as the 64 bits can be reduced to 8 with some analysis. Even the bvule tests with #000...000100 should be possible to eliminate with a suitable strong analysis (because bit-wise and with #0000...000ff always produces 8 bits worth). After manual bit-width reduction it solves in 0.05s, but of course you could use something automatic and reusable. |
@delcypher : Indeed, you can use the ackermannization for this type of query, but you don't need
And, using that information to build a sat checking tactic:
yields unsat in 21 seconds on my machine. |
Thanks that's good to know. I saw the option
but I ignored it because I thought it was related to division. To be honest even if it didn't say |
@wintersteiger Fantastic! I can confirm that on my rather old Mac the proof gets completed in 21 seconds as well with your magic incantation! |
@LeventErkok If you want to this more robust you could combine this with a probe. Something like this might do it.
After applying |
@delcypher Thanks! I'm still quite new to the tactic language, but the above is definitely helpful. Maybe these recipes can be added to the tutorial somehow? Also @NikolajBjorner mentioned he can get this benchmark to run in half a second here: #1150 (comment), but I think that was a manual tweak as opposed to a tactic. I wonder if it's possible to achieve the same with a tactic too. |
There is at this point no tactic to perform the simplifications I did by hand (and the ones I did could easily have been unsound). Examples like these are useful to learn from. |
For the attached UFBV benchmark, Z3 is performing rather badly compared to other solvers I tried:
I killed the process after 10 minutes where z3 failed to produce
unsat
. (CVC4 was also part of my tests, which also failed to produce a result in 10 minutes.)I understand going after individual benchmarks can be a never ending goose-chase, but thought you guys might want to look at this one given the compared performance with other tools.
test.smt2.txt
The text was updated successfully, but these errors were encountered: