mirror of
https://github.com/Z3Prover/z3
synced 2025-05-12 02:04:43 +00:00
Polysat: refactor constraints (#5372)
* Refactor: remove sign and dep from constraint * fix some bugs * improve log messages * Add missing premises to lemma * Rename getter in an attempt to fix linux build
This commit is contained in:
parent
a0b0c1f428
commit
3436b52c4a
16 changed files with 435 additions and 325 deletions
|
@ -19,14 +19,10 @@ Author:
|
|||
namespace polysat {
|
||||
|
||||
std::ostream& ule_constraint::display(std::ostream& out) const {
|
||||
out << m_lhs << (sign() == pos_t ? " <= " : " > ") << m_rhs;
|
||||
out << m_lhs << " <= " << m_rhs;
|
||||
return display_extra(out);
|
||||
}
|
||||
|
||||
constraint_ref ule_constraint::resolve(solver& s, pvar v) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void ule_constraint::narrow(solver& s) {
|
||||
LOG_H3("Narrowing " << *this);
|
||||
LOG("Assignment: " << assignments_pp(s));
|
||||
|
@ -117,7 +113,7 @@ namespace polysat {
|
|||
return p.is_val() && q.is_val() && p.val() > q.val();
|
||||
}
|
||||
|
||||
bool ule_constraint::forbidden_interval(solver& s, pvar v, eval_interval& out_interval, constraint_ref& out_neg_cond)
|
||||
bool ule_constraint::forbidden_interval(solver& s, pvar v, eval_interval& out_interval, constraint_literal& out_neg_cond)
|
||||
{
|
||||
SASSERT(!is_undef());
|
||||
|
||||
|
@ -247,8 +243,10 @@ namespace polysat {
|
|||
SASSERT(is_trivial == condition_body.is_zero());
|
||||
out_neg_cond = nullptr;
|
||||
}
|
||||
else if (is_trivial)
|
||||
out_neg_cond = ~s.m_constraints.eq(level(), condition_body);
|
||||
else
|
||||
out_neg_cond = s.m_constraints.eq(level(), is_trivial ? neg_t : pos_t, condition_body, s.mk_dep_ref(null_dependency));
|
||||
out_neg_cond = s.m_constraints.eq(level(), condition_body);
|
||||
|
||||
if (is_trivial) {
|
||||
if (is_positive())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue