Use other built-in solvers in Z3

I am using the Z3 Python interface to create formulas for my experiments. Then I send this formula to the Z3 solver. If I'm right, Z3 uses its own solver!

How do I use a different SAT / SMT solver with Z3py?

The way I use it in CBMC (C constrained model validation): Run the program and align the DIMAC intermediate representation (in a file) and then use that file as input for other SAT solvers. Can I do similar things in Z3. Thank.

+3


source to share


2 answers


It looks like you really should be using the incompatible SMT interface instead of the Z3py interface. Several attempts have been made to create such interfaces with varying degrees of support for multiple solvers:



This is not an exhaustive list. I'm sure there are others, in different languages, with varying degrees of maturity. Which one you should choose really depends on your language preference and the particulars provided by each system; which can vary widely.

+4


source


All SMT solvers support the SMT2 input format, so you can do the same with Z3 and other SMT solvers. Z3py can translate Solver and Goal objects to SMT2 compatible strings (some complex variable declarations, for example, some data types may be missing).



Z3py is a Z3 specific API (as the name suggests), it does not provide a way to use other SMT solvers.

+2


source







All Articles