Skip to content
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

Different Results from API and Binary #6501

Closed
avery-laird opened this issue Dec 19, 2022 · 4 comments
Closed

Different Results from API and Binary #6501

avery-laird opened this issue Dec 19, 2022 · 4 comments

Comments

@avery-laird
Copy link

avery-laird commented Dec 19, 2022

Hello,

I'm experiencing some cases where results from the C++ API and the binary seem to differ. One example of my issue is the following:

  • Issue commands from the C++ API, using a solver with set("smtlib2_log", "<log-file>.smt2")
    • get results like sat, sat
  • run z3 <log-file>.smt2
    • get results like sat, unsat

The binary and API are the same versions (built from the same repo). After every (check-sat) is a (reset) command. No incremental commands are used. I cannot publish example queries publicly but could provide logs privately if possible.

Are there any common reasons why this behaviour could occur? I assume I may be making some simple mistake, but I've tried everything I can think of. Any suggestions or help is greatly appreciated.

@NikolajBjorner
Copy link
Contributor

Not sure. smtlib2_log is only used on occasion so may have its own bugs that have been undetected.
you can try to send me material and I will look into it.

@avery-laird
Copy link
Author

Great, thank you. I will send more detail to nbjorner@microsoft.com

@avery-laird
Copy link
Author

After an email exchange: @NikolajBjorner identifies this as an unsoundness bug, so I will leave this issue open for now.

@NikolajBjorner
Copy link
Contributor

this got fixed, but it also establishes that the second query can't be solved (z3 loops).
The issue with the second query was a quantifier under the scope of a recursively defined function.
This wasn't even supported until recently, but the support came with a bug: it would jump to base level 0 when compiling a quantified function case into formulas. However, for recursive functions z3 relies on iterative deepening based on assumptions. The scope level of assumptions is 1. It should never have backtracked below level 1.

hgvk94 pushed a commit to hgvk94/z3 that referenced this issue Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants