mirror of
https://github.com/Z3Prover/z3
synced 2025-05-04 06:15:46 +00:00
Try to produce an op_constraint lemma before invoking the fallback solver
This commit is contained in:
parent
2bc1b3a6dd
commit
b4b94c954b
3 changed files with 37 additions and 18 deletions
|
@ -837,17 +837,17 @@ namespace polysat {
|
|||
m_constraints[v].pop_back();
|
||||
}
|
||||
|
||||
bool viable_fallback::check_constraints(pvar v) {
|
||||
for (auto const& c : m_constraints[v]) {
|
||||
signed_constraint viable_fallback::find_violated_constraint(pvar v) {
|
||||
for (signed_constraint const c : m_constraints[v]) {
|
||||
// for this check, all variables need to be assigned
|
||||
DEBUG_CODE(for (pvar w : c->vars()) { SASSERT(s.is_assigned(w)); });
|
||||
if (c.is_currently_false(s)) {
|
||||
LOG(assignment_pp(s, v, s.get_value(v)) << " violates constraint " << lit_pp(s, c));
|
||||
return false;
|
||||
return c;
|
||||
}
|
||||
SASSERT(c.is_currently_true(s));
|
||||
}
|
||||
return true;
|
||||
return {};
|
||||
}
|
||||
|
||||
dd::find_t viable_fallback::find_viable(pvar v, rational& out_val) {
|
||||
|
@ -869,6 +869,7 @@ namespace polysat {
|
|||
|
||||
auto const& cs = m_constraints[v];
|
||||
for (unsigned i = cs.size(); i-- > 0; ) {
|
||||
LOG("Univariate constraint: " << cs[i]);
|
||||
cs[i].add_to_univariate_solver(s, *us, i);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue