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

prevent loops with anc caused by AVATAR models flip-flopping #521

Merged
merged 1 commit into from
Feb 16, 2024

Conversation

MichaelRawson
Copy link
Contributor

As discussed with @quickbeam123, we can get into a situation with Minisat (Z3 may have the same problem, I'm not sure) where the solver flip-flops between one of two feasible models. This is not a problem per se - although annoying from a performance point of view - but it does lead to a looping scenario where we:

  1. Be in model M1
  2. Derive a SAT clause via "AVATAR known components" (-anc, partially-on by default)
  3. Recompute model, get model M2
  4. Derive another SAT clause
  5. Recompute model, get model M1
  6. Go to 1, loop indefinitely.

This quick fix prevents exactly this scenario by not adding duplicate clauses to the SAT solver. A longer-term solution would try to fix the underlying flip-flopping.

size -= sizeof(SATLiteral);

DEALLOC_KNOWN(ptr, size, "SATClause");
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logic is weird but inherited from the existing operator new.

@quickbeam123
Copy link
Collaborator

@MichaelRawson , is this intentionally only applied on the path of handleNonSplittable, maybe other split's and contradiction clauses could benefit too?

@MichaelRawson
Copy link
Contributor Author

Conflicts should always be unique, so I'm reasonably certain that there is no point de-duplicating those. Split clauses I'm not sure about - I can't imagine a looping scenario there, and I have to think hard to produce an example where we get a duplicate split clause, but I'm happy to add the logic there too. Lmk if so.

@quickbeam123 quickbeam123 merged commit c537ac3 into master Feb 16, 2024
1 check passed
@quickbeam123 quickbeam123 deleted the michael-fix-anc-loops branch February 16, 2024 11:16
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

Successfully merging this pull request may close these issues.

None yet

2 participants