Setting logic for solver in Z3 (API)

前端 未结 2 1427
一生所求
一生所求 2021-01-22 00:58

I notice that the Z3 C++ (and C) API allows you to supply the logic to be used.

I have two questions about this that I couldn\'t answer by looking online:

相关标签:
2条回答
  • 2021-01-22 01:47

    Z3 will also try to figure out what the logic is (when run with default options), but it doesn't have custom tactics for all combinations of theories (see default_tactic.cpp and smt_strategic_solver.cpp). When you are not sure what Z3 will decide to do, then it's best to set the tactic right up front, so that you will get errors if you try to use things that are not in that logic. It will also use that information to set up the smt kernel, e.g., enabling various preprocessors, various solver features, and chosing heuristics (see e.g., smt_setup.cpp).

    0 讨论(0)
  • 2021-01-22 01:49

    Try it out and see!

    Usually it does make a big difference. Setting the logic means the solver will use a specialized tactic to solve the formula, instead of going through the generic loop. Z3 will also try to guess the logic, but it's usually better to just provide it upfront.

    0 讨论(0)
提交回复
热议问题