mirror of
https://github.com/Z3Prover/z3
synced 2025-04-29 03:45:51 +00:00
fixes
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
23963f274d
commit
0426b23d0c
2 changed files with 15 additions and 9 deletions
|
@ -163,8 +163,6 @@ namespace polysat {
|
||||||
SASSERT(std::all_of(m_constraints.begin(), m_constraints.end(), [](auto c){ return !c->has_bvar(); }));
|
SASSERT(std::all_of(m_constraints.begin(), m_constraints.end(), [](auto c){ return !c->has_bvar(); }));
|
||||||
bool core_has_pos = contains_literal(sat::literal(var));
|
bool core_has_pos = contains_literal(sat::literal(var));
|
||||||
bool core_has_neg = contains_literal(~sat::literal(var));
|
bool core_has_neg = contains_literal(~sat::literal(var));
|
||||||
std::cout << cl << "\n";
|
|
||||||
std::cout << *this << "\n";
|
|
||||||
DEBUG_CODE({
|
DEBUG_CODE({
|
||||||
bool clause_has_pos = std::count(cl.begin(), cl.end(), sat::literal(var)) > 0;
|
bool clause_has_pos = std::count(cl.begin(), cl.end(), sat::literal(var)) > 0;
|
||||||
bool clause_has_neg = std::count(cl.begin(), cl.end(), ~sat::literal(var)) > 0;
|
bool clause_has_neg = std::count(cl.begin(), cl.end(), ~sat::literal(var)) > 0;
|
||||||
|
@ -173,11 +171,13 @@ namespace polysat {
|
||||||
SASSERT((core_has_pos && clause_has_pos) || (core_has_neg && clause_has_neg));
|
SASSERT((core_has_pos && clause_has_pos) || (core_has_neg && clause_has_neg));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
sat::literal var_lit(var);
|
||||||
if (core_has_pos)
|
if (core_has_pos)
|
||||||
remove_literal(sat::literal(var));
|
remove_literal(var_lit);
|
||||||
if (core_has_neg)
|
if (core_has_neg)
|
||||||
remove_literal(~sat::literal(var));
|
remove_literal(~var_lit);
|
||||||
unset_bmark(var);
|
|
||||||
|
unset_mark(m.lookup(var_lit));
|
||||||
|
|
||||||
for (sat::literal lit : cl)
|
for (sat::literal lit : cl)
|
||||||
if (lit.var() != var)
|
if (lit.var() != var)
|
||||||
|
|
|
@ -98,7 +98,7 @@ namespace polysat {
|
||||||
while (progress) {
|
while (progress) {
|
||||||
progress = false;
|
progress = false;
|
||||||
for (auto c : core) {
|
for (auto c : core) {
|
||||||
if (is_positive_equality_over(v, c) && reduce_by(v, c, core)) {
|
if (is_positive_equality_over(v, c) && c.is_currently_true(s()) && reduce_by(v, c, core)) {
|
||||||
progress = true;
|
progress = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -129,6 +129,12 @@ namespace polysat {
|
||||||
if (!c2->has_bvar() || l_undef == c2.bvalue(s()))
|
if (!c2->has_bvar() || l_undef == c2.bvalue(s()))
|
||||||
core.keep(c2); // adds propagation of c to the search stack
|
core.keep(c2); // adds propagation of c to the search stack
|
||||||
core.reset();
|
core.reset();
|
||||||
|
if (c2.bvalue(s()) == l_false) {
|
||||||
|
core.insert(eq);
|
||||||
|
core.insert(c);
|
||||||
|
core.insert(~c2);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
core.set(c2);
|
core.set(c2);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue