0

I am working with z3 python api. When I solve constraints using z3 python api then the solver runs infinitely and no errors are thrown. But, when same constraints are dumped in the form of smtlib2 format and then are solved via z3 executable, it almost instantaneously gives sat or unsat. The smtlib2 dump is very large (around 1000 lines). Although for small number of constraints, z3 api works fine. Is there a bug in z3 python api for handling large number of constraints?

1 Answers1

0

This can happen, e.g., when the configuration between the two methods differs (even slightly), or when when the problems aren't exactly identical (e.g. different order of constraints). Some tactics are also non-deterministic (e.g. they use timers in the preprocessing) and the executable happens to be a bit faster/slower. To diagnose what exactly causes the difference we would need to see some of your problems, or at the very least some diagnostic output, for instance, add -v:10 on the command line and set the global "verbosity" option to 10.

Christoph Wintersteiger
  • 8,234
  • 1
  • 16
  • 30
  • Diagnostic output from command line - http://pastebin.com/qCaBahqE Diagnostic output from python api - http://pastebin.com/YpAf90vb – user2408329 Mar 13 '16 at 19:27
  • As you can see from the output, the two runs do very different things. For example, the first has MBQI enabled while the other doesn't seem to (or the output settings were different). Check that you set the right logic definition and/or you are using the right tactics or solvers. – Christoph Wintersteiger Mar 14 '16 at 16:03