Closed msooseth closed 1 year ago
It is because pre-processing in the main mode of Z3 does not work well with incrementality. So far Z3 used tactics that are one-shot pre-processing hammes to simplify goals. Your problem cannot be solved if you keep bsdiv because bv reasoning is dead with 256 let alone 32 bits for bsdiv, bvudiv, bvsrem, ..
I am working on incremental pre-processing that is transparent for push/pop. It happens not to solve your problem (it is enabled by passing sat.smt=true from the command line) either. It is not directly fixable within the current implementation because mystuff gets bit-blasted for the first solver call and the simplified version of the formula that uses mystuff is not going to be re-created. I end up not substituting in solutions for variables in previous constraints. The alternative is to substitute mystuff into the formulas where they occur, simplify them, and reassert the simplified formulas. I don't think this stratetegy always works well. So some users would suffer from this behavior. Therefore, you are more likely much better off using z3 with separate queries in one-shot modes for this methdology.
Oh wow, thank you for the detailed explanation. That makes a lot of sense. Thank you!
Hi,
This SMT2:
Has two
check-sat
-s, the first timemystuff
is not defined, later it is defined to be(bvsdiv (_ bv0 256) arg1))
. This givessat
immediately and then runs for 500+ seconds without a result for the secondcheck-sat
. If however I replacemystuff
in the original query with(bvsdiv (_ bv0 256) arg1))
, and remove the definition & the 2ndcheck-sat
, then it returnsunsat
in about 20 seconds. This is odd.To be clear, the second query is:
My expectation was that it shouldn't be such a radical performance difference?
Not a bug, just a performance bug. Running
Z3 version 4.12.2