diff --git a/src/math/polysat/clause_builder.cpp b/src/math/polysat/clause_builder.cpp index 03a8a5cd5..f9a6407bd 100644 --- a/src/math/polysat/clause_builder.cpp +++ b/src/math/polysat/clause_builder.cpp @@ -57,9 +57,11 @@ namespace polysat { SASSERT(c); SASSERT(c->has_bvar()); SASSERT(!c.is_always_true()); // clause would be a tautology +#if 0 if (c->unit_clause()) { return; } +#endif m_literals.push_back(c.blit()); } diff --git a/src/math/polysat/conflict.cpp b/src/math/polysat/conflict.cpp index d6aadc09e..955b295a4 100644 --- a/src/math/polysat/conflict.cpp +++ b/src/math/polysat/conflict.cpp @@ -209,8 +209,6 @@ namespace polysat { c_lemma.push(c.blit()); clause_ref lemma = c_lemma.build(); cm().store(lemma.get(), s()); - if (lemma->size() == 1) - c->set_unit_clause(lemma.get()); if (s().m_bvars.value(c.blit()) == l_undef) s().assign_bool(s().level(*lemma), c.blit(), lemma.get(), nullptr); } diff --git a/src/math/polysat/constraint.cpp b/src/math/polysat/constraint.cpp index 1ee6c7410..04ef30172 100644 --- a/src/math/polysat/constraint.cpp +++ b/src/math/polysat/constraint.cpp @@ -263,11 +263,6 @@ namespace polysat { narrow(s, is_positive); } - void constraint::set_unit_clause(clause *cl) { - // can be seen as a cache... store the lowest-level unit clause for this constraint. - if (!cl || !m_unit_clause) - m_unit_clause = cl; - } unsigned constraint::level(solver& s) const { if (s.m_bvars.value(sat::literal(bvar())) != l_undef) diff --git a/src/math/polysat/constraint.h b/src/math/polysat/constraint.h index ee72dce1c..207d6741c 100644 --- a/src/math/polysat/constraint.h +++ b/src/math/polysat/constraint.h @@ -131,7 +131,6 @@ namespace polysat { friend class ule_constraint; // constraint_manager* m_manager; - clause* m_unit_clause = nullptr; ///< If this constraint was asserted by a unit clause, we store that clause here. ckind_t m_kind; unsigned_vector m_vars; lbool m_external_sign = l_undef; @@ -178,9 +177,6 @@ namespace polysat { std::string bvar2string() const; unsigned level(solver& s) const; - clause* unit_clause() const { return m_unit_clause; } - void set_unit_clause(clause* cl); - void set_external(bool sign) { m_external_sign = to_lbool(sign); } void unset_external() { m_external_sign = l_undef; } bool is_external() const { return m_external_sign != l_undef; } diff --git a/src/math/polysat/solver.cpp b/src/math/polysat/solver.cpp index 859a8fe7a..2188cc48a 100644 --- a/src/math/polysat/solver.cpp +++ b/src/math/polysat/solver.cpp @@ -121,18 +121,9 @@ namespace polysat { set_conflict(c /*, dep */); return; } -#if 0 - clause_ref unit = clause::from_unit(c); - m_constraints.store(unit.get(), *this); - c->set_unit_clause(unit.get()); - (void) dep; // dependencies go into justification - assign_bool(m_level, lit, c->unit_clause(), nullptr); -#else - // just add them as axioms, tracked by dependencies m_bvars.assign(lit, m_level, nullptr, nullptr, dep); m_trail.push_back(trail_instr_t::assign_bool_i); m_search.push_boolean(lit); -#endif #if ENABLE_LINEAR_SOLVER m_linear_solver.new_constraint(*c.get()); @@ -743,14 +734,8 @@ namespace polysat { LOG(" Literal " << lit << " is: " << lit2cnstr(lit)); SASSERT(m_bvars.value(lit) != l_true); } - if (lemma.empty()) - std::cout << lemma << "\n"; SASSERT(!lemma.empty()); m_constraints.store(&lemma, *this); - if (lemma.size() == 1) { - signed_constraint c = lit2cnstr(lemma[0]); - c->set_unit_clause(&lemma); - } propagate(); }