Z3 C++ API yields “unknown” while binary on serialized output yields “unsat”

a 夏天 提交于 2019-12-25 06:46:23

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/41865116/z3-c-api-yields-unknown-while-binary-on-serialized-output-yields-unsat

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!