3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-02 20:31:21 +00:00
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2021-03-21 12:32:01 -07:00
parent 2fef6dc502
commit 2ee971ef68
2 changed files with 3 additions and 5 deletions

View file

@ -201,7 +201,7 @@ namespace polysat {
bool solver::propagate_eq(unsigned v, constraint& c) { bool solver::propagate_eq(unsigned v, constraint& c) {
SASSERT(c.kind() == ckind_t::eq_t); SASSERT(c.kind() == ckind_t::eq_t);
SSSERT(!c.vars().empty()); SASSERT(!c.vars().empty());
auto var = m_vars[v].var(); auto var = m_vars[v].var();
auto& vars = c.vars(); auto& vars = c.vars();
unsigned idx = 0; unsigned idx = 0;
@ -209,7 +209,7 @@ namespace polysat {
idx = 1; idx = 1;
SASSERT(v == vars[idx]); SASSERT(v == vars[idx]);
// find other watch variable. // find other watch variable.
for (unsigned i = var.size(); i-- > 2; ) { for (unsigned i = vars.size(); i-- > 2; ) {
if (!is_assigned(vars[i])) { if (!is_assigned(vars[i])) {
std::swap(vars[idx], vars[i]); std::swap(vars[idx], vars[i]);
return true; return true;

View file

@ -34,13 +34,12 @@ namespace polysat {
class constraint { class constraint {
ckind_t m_kind; ckind_t m_kind;
unsigned m_v1, m_v2;
pdd m_poly; pdd m_poly;
pdd m_other; pdd m_other;
u_dependency* m_dep; u_dependency* m_dep;
unsigned_vector m_vars; unsigned_vector m_vars;
constraint(pdd const& p, pdd const& q, u_dependency* dep, ckind_t k): constraint(pdd const& p, pdd const& q, u_dependency* dep, ckind_t k):
m_kind(k), m_v1(UINT_MAX), m_v2(UINT_MAX), m_poly(p), m_other(q), m_dep(dep) { m_kind(k), m_poly(p), m_other(q), m_dep(dep) {
m_vars.append(p.free_vars()); m_vars.append(p.free_vars());
if (q != p) if (q != p)
for (auto v : q.free_vars()) for (auto v : q.free_vars())
@ -54,7 +53,6 @@ namespace polysat {
pdd const & lhs() const { return m_poly; } pdd const & lhs() const { return m_poly; }
pdd const & rhs() const { return m_other; } pdd const & rhs() const { return m_other; }
std::ostream& display(std::ostream& out) const; std::ostream& display(std::ostream& out) const;
void set_poly(pdd const& p) { m_poly = p; }
u_dependency* dep() const { return m_dep; } u_dependency* dep() const { return m_dep; }
unsigned_vector& vars() { return m_vars; } unsigned_vector& vars() { return m_vars; }
}; };