mirror of
https://github.com/Z3Prover/z3
synced 2025-04-27 10:55:50 +00:00
add new file for eq_constraint
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
c733789467
commit
2eadcd586a
6 changed files with 161 additions and 149 deletions
|
@ -376,12 +376,9 @@ namespace polysat {
|
|||
|
||||
scoped_ptr<constraint> lemma;
|
||||
reset_marks();
|
||||
for (constraint* c : m_conflict) {
|
||||
SASSERT(c);
|
||||
LOG("Conflicting: " << *c);
|
||||
for (constraint* c : m_conflict)
|
||||
for (auto v : c->vars())
|
||||
set_mark(v);
|
||||
}
|
||||
|
||||
for (unsigned i = m_search.size(); i-- > 0; ) {
|
||||
pvar v = m_search[i].first;
|
||||
|
@ -403,14 +400,14 @@ namespace polysat {
|
|||
backtrack(i, lemma);
|
||||
return;
|
||||
}
|
||||
if (is_always_false(*new_lemma)) {
|
||||
if (new_lemma->is_always_false()) {
|
||||
learn_lemma(v, new_lemma.get());
|
||||
m_conflict.reset();
|
||||
m_conflict.push_back(new_lemma.detach());
|
||||
report_unsat();
|
||||
return;
|
||||
}
|
||||
if (!eval_to_false(*new_lemma)) {
|
||||
if (!new_lemma->is_currently_false(*this)) {
|
||||
backtrack(i, lemma);
|
||||
return;
|
||||
}
|
||||
|
@ -531,21 +528,6 @@ namespace polysat {
|
|||
|
||||
}
|
||||
|
||||
|
||||
bool solver::is_always_false(constraint& c) {
|
||||
if (c.is_eq())
|
||||
return c.to_eq().p().is_never_zero();
|
||||
return false;
|
||||
}
|
||||
|
||||
bool solver::eval_to_false(constraint& c) {
|
||||
if (c.is_eq()) {
|
||||
pdd r = c.to_eq().p().subst_val(m_search);
|
||||
return r.is_never_zero();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void solver::add_lemma(constraint* c) {
|
||||
if (!c)
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue