3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-11-06 14:26:03 +00:00

Fix missing boolean propagation after boolean conflict

Usually in SAT solving, the conflict clause has at least two false literals at the max level (otherwise, the last literal would have been propagated at an earlier level).
But here we are adding clauses on demand; so after backtracking we may have the case that the conflict clause has exactly one undefined literal that must be propagated explicitly.
This commit is contained in:
Jakob Rath 2023-02-01 14:21:02 +01:00
parent 783bd60598
commit 0d56edb65c
7 changed files with 66 additions and 20 deletions

View file

@ -35,6 +35,7 @@ namespace polysat {
unsigned m_ref_count = 0; // TODO: remove refcount once we confirm it's not needed anymore
bool m_redundant = redundant_default;
bool m_active = false; // clause is active iff it has been added to the solver and boolean watchlists
sat::literal_vector m_literals;
char const* m_name = "";
@ -53,6 +54,8 @@ namespace polysat {
SASSERT(count(m_literals, sat::null_literal) == 0);
}
void set_active() { m_active = true; }
public:
void inc_ref() { m_ref_count++; }
void dec_ref() { SASSERT(m_ref_count > 0); m_ref_count--; if (!m_ref_count) dealloc(this); }
@ -77,6 +80,8 @@ namespace polysat {
void set_redundant(bool r) { m_redundant = r; }
bool is_redundant() const { return m_redundant; }
bool is_active() const { return m_active; }
void set_name(char const* name) { m_name = name; }
char const* name() const { return m_name; }
};