When I build up a certain set of constraints using the Z3 C++ API I get " unknown " in response. However, if I serialize the z3::solver
object using operator<<() and pass the output to the z3 binary, it yields " unsat " as expected. Interestingly enough, if I use z3::solver::to_smt2()
instead of operator<<(), the Z3 binary outputs " unknown ".
Why is this occurring? How can I get Z3 using the C++ API to "see" what the standalone binary "sees"?
I've uploaded the serialized constraint files to pastebin in case that helps
Using operator<<(): http://pastebin.com/uRfP90W5
Using to_smt2(): http://pastebin.com/6qQ6WsHN
The example uses non-linear arithmetic, so ends up using an incomplete solver in spite of the fact that it is non-linear arithmetic over the reals. You can query why z3 returns unknown using the command
(get-info :reason-unknown)
after the (check-sat) call. It will then say:
(:reason-unknown "smt tactic failed to show goal to be sat/unsat (incomplete (theory arithmetic))")
Digging into the formula we see a couple of multiplications between function applications. There is no complete integration in Z3 of non-linear reasoning on reals and formulas using free functions.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.