Randomness in Z3 Results

后端 未结 1 1388
滥情空心
滥情空心 2021-01-23 04:23

I am using the Z3 Python interface as part of a research tool that I am writing, and I noticed some pretty odd behavior when I run the Z3 solver repeatedly on the same query: In

相关标签:
1条回答
  • 2021-01-23 04:56

    I'm assuming by different you meant a different model. If the result changes from sat to unsat, then it is a bug.

    That being said, if we solve the same problem twice in the same execution path, then Z3 can produce different models. Z3 assigns internal unique IDs to expressions. The internal IDs are used to break ties in some heuristics used by Z3. Note that the loop in your program is creating/deleting expressions. So, in each iteration, the expressions representing your constraints may have different internal IDs, and consequently the solver may produce different solutions.

    See the following related question:

    • Z3 timing variation
    0 讨论(0)
提交回复
热议问题