1

In eager SMT solvers, a SMT formula is encoded as a equisatisfiable boolean formula which is fed to a SAT solver. Typically, for QF_UF formulae, uninterpreted functions are reduced by Ackermann's reduction or Bryant's reduction, and then a equisatisfiable boolean formula is constructed by equality graph approach.

So I want to know if it is possible to invoke an existing SMT solver to get the equisatisfiable boolean formula given a QF_UF formula without hacking the low-level implementation of the solver. For example, Z3 has some tactics to transform the input problem (such as tseitin-cnf and elim-term-ite), and is there a tactic for such translation?

cxcfan
  • 185
  • 9

1 Answers1

2

In z3 you can dump DIMACS with a patch like https://gist.github.com/nunoplopes/8cd9fb433b2663c99cb34c8a95ae812f

You can also use the bit-blast tactic to get the SAT formula, which will be over Boolean Z3 variables. I don't think that's guaranteed to be in CNF or NNF or whatever form.

Nuno Lopes
  • 868
  • 6
  • 13
  • I will try the first solution later. For the second one, when I attempt to apply `bit-blast` tactic to a QF_UF problem ([link](http://rise4fun.com/Z3/hWVI)), the output is still a QF_UF problem. Did I do something wrong or `bit-blast` tactic only supports BV problem? – cxcfan Jul 13 '17 at 13:35
  • 1
    Ah, yes. You need to get rid of the UF symbols first. There's now an Ackermannization tactic. The name is ackermannize_bv IIRC. – Nuno Lopes Jul 13 '17 at 17:37
  • Thank you very much. Now UF symbols are reduced. But I found that `bit-blast` is still not working for converting QF_UF problem to SAT formula ([example](http://rise4fun.com/Z3/MSfEo)). So is there any working tactic to translate a QF_UF formula without uninterpreted functions of non-zero arity to SAT formula? Thank you! – cxcfan Jul 14 '17 at 15:41
  • What do you mean by a SAT formula? If you want DIMACS you need to use the patch I've provided; I don't think that functionality is exposed. – Nuno Lopes Jul 14 '17 at 19:24
  • If you want CNF or NNF, there are also tactics for that. – Nuno Lopes Jul 14 '17 at 19:24
  • Sorry my question may be confusing. What I want to do is to transform equality logic to propositional logic. So the lazy solvers such as Z3 do not expose such functionality, right? – cxcfan Jul 15 '17 at 06:44