I have an arbitrary set of constraints. For example:
A, B, C and D are 8-bit integers.
A + B + C + D = 50
(A + B) = 25
(C + D) = 30
A < 10
I can convert this to a SAT problem that can be solved by picosat (I can't get minisat to compile on my Mac), or to a SMT problem that can be solved by CVC4. To do that I need to:
- Map these equations into a Boolean circuit.
- Apply Tseitin's transformation to the circuit and convert it into DIMACS format.
My questions:
- What tools do I use to do the conversion to the circuit?
- What are the file formats for circuits and which ones are commonly used?
- What tools do I use to transform the circuit to DIMACS format?
In MiniZinc, you could just write a constraint programming model:
The example constraints cannot be satisfied, because of
25 + 30 > 50
.The Python interface of Z3 would allow the following: