New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
strange performance for (= x y) vs. (= y x) #1822
Comments
The problem is SAT. If the solver is lucky it can find a solution immediately. There is generally quite some fluctuation of time taken for SAT problems (often more than the fluctuation observed on "common" examples that are unsat). You can obtain other fluctuations just by tinkering with the value of smt.random_seed. |
thanks for response . i have modelled with SAT before and arrived at SMT recently. Is Z3 SAT-solving competitive with plingeling ? I'll stick with mixed integer-boolean modelling until i run out of ideas. |
The 2009 paper is unrelated. That code is long gone. |
attached are 3 files which differ only in the order of some function arguments: one is the original, with 'unordered' arguments, one with lexically ascending and the other one with lexically descending arguments. The table show the runtimes of each version with Z3 4.7.1 and the nightly build of 26. august.
The first two parameters go into an
(=
expression in the functionisNeighbor
, which looks like this (at line 140):The order of the last two parameters is required as shown. In an attempt to tidy up the code i arranged the first two arguments - to find a dramatic, unexplainable difference in the runtime, shown in seconds.
What is going on here? Does it mean, problems (of the right kind) have a considerable 'silent performance reserve' which can be leveraged by just reordering variables?
Here is an original, unordered block (at line 4317 in v123a.smt):
Here is a code-block with first two arguments ordered descending (in file v124a.smt):
Here is a code-block with first two arguments ordered ascending (in file v124b.smt):
z310x10H7C3v123a.smt.txt
z310x10H7C3v124b.smt.txt
z310x10H7C3v124a.smt.txt
The text was updated successfully, but these errors were encountered: