mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 17:15:31 +00:00
clear regressions
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
e1224e116f
commit
fd8b2ba596
4 changed files with 26 additions and 8 deletions
|
@ -280,8 +280,8 @@ namespace polysat {
|
|||
}
|
||||
|
||||
if (conflict_var() == v) {
|
||||
forbidden_intervals fi;
|
||||
if (fi.perform(s, v, cjust_v, *this))
|
||||
forbidden_intervals fi(s);
|
||||
if (fi.perform(v, cjust_v, *this))
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -303,7 +303,7 @@ namespace polysat {
|
|||
break;
|
||||
}
|
||||
set_bailout();
|
||||
if (s.is_assigned(v))
|
||||
if (s.is_assigned(v) && s.m_justification[v].is_decision())
|
||||
m_vars.insert(v);
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -83,7 +83,7 @@ namespace polysat {
|
|||
core.set_bailout();
|
||||
}
|
||||
|
||||
bool forbidden_intervals::perform(solver& s, pvar v, vector<signed_constraint> const& just, conflict& core) {
|
||||
bool forbidden_intervals::perform(pvar v, vector<signed_constraint> const& just, conflict& core) {
|
||||
|
||||
// Extract forbidden intervals from conflicting constraints
|
||||
vector<fi_record> records;
|
||||
|
@ -93,7 +93,7 @@ namespace polysat {
|
|||
LOG_H3("Computing forbidden interval for: " << c);
|
||||
eval_interval interval = eval_interval::full();
|
||||
signed_constraint neg_cond;
|
||||
if (get_interval(s, c, v, interval, neg_cond)) {
|
||||
if (get_interval(c, v, interval, neg_cond)) {
|
||||
LOG("interval: " << interval);
|
||||
LOG("neg_cond: " << neg_cond);
|
||||
if (interval.is_currently_empty())
|
||||
|
@ -102,6 +102,7 @@ namespace polysat {
|
|||
// We have a single interval covering the whole domain
|
||||
// => the side conditions of that interval are enough to produce a conflict
|
||||
full_interval_conflict(c, neg_cond, core);
|
||||
revert_core(core);
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
|
@ -170,6 +171,7 @@ namespace polysat {
|
|||
core.insert(records[i].src);
|
||||
}
|
||||
core.set_bailout();
|
||||
revert_core(core);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -181,7 +183,7 @@ namespace polysat {
|
|||
* \returns True iff a forbidden interval exists and the output parameters were set.
|
||||
*/
|
||||
|
||||
bool forbidden_intervals::get_interval(solver& s, signed_constraint const& c, pvar v, eval_interval& out_interval, signed_constraint& out_neg_cond)
|
||||
bool forbidden_intervals::get_interval(signed_constraint const& c, pvar v, eval_interval& out_interval, signed_constraint& out_neg_cond)
|
||||
{
|
||||
if (!c->is_ule())
|
||||
return false;
|
||||
|
@ -364,4 +366,15 @@ namespace polysat {
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
void forbidden_intervals::revert_core(conflict& core) {
|
||||
for (auto c : core) {
|
||||
if (c.bvalue(s) == l_false) {
|
||||
core.reset();
|
||||
core.set(~c);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -20,9 +20,12 @@ Author:
|
|||
namespace polysat {
|
||||
|
||||
class forbidden_intervals {
|
||||
solver& s;
|
||||
void revert_core(conflict& core);
|
||||
void full_interval_conflict(signed_constraint c, signed_constraint neg_cond, conflict& core);
|
||||
bool get_interval(solver& s, signed_constraint const& c, pvar v, eval_interval& out_interval, signed_constraint& out_neg_cond);
|
||||
bool get_interval(signed_constraint const& c, pvar v, eval_interval& out_interval, signed_constraint& out_neg_cond);
|
||||
public:
|
||||
bool perform(solver& s, pvar v, vector<signed_constraint> const& just, conflict& core);
|
||||
forbidden_intervals(solver& s) :s(s) {}
|
||||
bool perform(pvar v, vector<signed_constraint> const& just, conflict& core);
|
||||
};
|
||||
}
|
||||
|
|
|
@ -523,6 +523,8 @@ namespace polysat {
|
|||
|
||||
// Guess a literal from the given clause; returns the guessed constraint
|
||||
void solver::decide_bool(clause& lemma) {
|
||||
if (is_conflict())
|
||||
return;
|
||||
LOG_H3("Guessing literal in lemma: " << lemma);
|
||||
IF_LOGGING(m_viable.log());
|
||||
LOG("Boolean assignment: " << m_bvars);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue