I’ve two SMT problem instances. The first is here:
http://gist.github.com/1232766
Z3 returns a model for this problem in about 2 minutes on my not-so-great machine, which is great.. I also have this one:
http://gist.github.com/1232769
I’ve ran z3 overnight on this problem, without Z3 completing. If you check the contents of these files, you’ll see that the second one is identical to the first, except it has an extra assertion to “reject” the model returned by the first instance. (You can do a “diff” between them to see what I mean.) I happen to know that this problem has multiple satisfying models, and I’m trying to use z3 to find all satisfying models.
I understand that this might be completely expected, but I was curious to know why the second one is a much tougher problem for Z3 compared to the first. Is there a better way to formulate the second problem so Z3 will have an easier time?
Thanks..
It is hard to give you a precise answer without knowing more about your application.
As you suggested, modeling plays a big role in the logic you are using:
AUFBV.The strategy used by Z3 also has a big impact on the overall performance.
Z3 comes equipped with several builtin strategies. It has many parameters that can be used to influence the search.
Z3 also has a strategy specification language. This is a new feature. I’m not advertising it because it is working in progress, and the language will most likely change in the next versions.
You can access more information about the strategy language by executing the commands:
That being said, there is a builtin strategy in Z3 that seems to be effective on your problem.
It is the strategy used for the logic
UFBV. Your problem uses arrays, but they can be avoided by transforming table0 into a function with two arguments:And replacing every term of the form
(select (table0 s65) t)with(table0 s65 t)wheretis an arbitrary term.Finally, you must also add the command
(set-logic UFBV)in the beginning of the file. With this setting, I managed to generate 4 different models for your query.I didn’t try to generate more than that. Each call consumed approx 75 secs.