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

Result changes from sat to unsat after duplication and-subexpression #5714

Closed
AnzhelaSukhanova opened this issue Dec 16, 2021 · 3 comments
Closed
Assignees

Comments

@AnzhelaSukhanova
Copy link

Hello,

I have found a clause where a result changes from sat to unsat after duplication and-subexpression (line 50 of attached files). I have checked both examples with Eldarica and it has returned sat.
image
sat.smt2.txt
bug.smt2.txt

@NikolajBjorner
Copy link
Contributor

@agurfinkel
Copy link
Collaborator

@AnzhelaSukhanova is it possible to minimize this example somewhat?

@NikolajBjorner
Copy link
Contributor

More information is in the commit message:

It is not unlike other fuzz bugs: it exercises some behavior that applications are unlikely to expose. In this case, a rule body expanded into a conjunction with more than 1M formulas (with a lot of repetition). The original rule representation assumed silently that the number of constraints in a body would fit within 20 bits, but reality allowed bodies with as many as 2^{32} - 1 constraints.
So "minimizing" the bug as @agurfinkel asks for seems not to make too much sense.

Just running the samples in debug mode points to the root cause.

Since fuzz bugs are not from applications and fuzz tools have the potential for creating a large number of issues, I find it reasonable to push some basic pro-active asks on filers:

  • reproduce bug in debug builds to assess whether a debug assert triggers.
  • minimize or keep it simpler when possible (in this case it does not apply)
  • perform basic diagnostics/triage. I am basically asking to push this part of the work on to the fuzzer. Otherwise, addressing random bugs doesn't scale. Triaging should have pointed to the root cause.

Now, there tends to be something to learn from bugs. In this case, the question was: "can we avoid constraints with duplications"? In particular, it points to a basic inefficiency of extracting conjunctions (and disjunctions). The function didn't deduplicate. So I added deduplication into this function. It is used throughout z3 code base so could expose latent issues. We will see.

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

3 participants