mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 09:05:31 +00:00
One more case for ule_constraint::is_always_false
This commit is contained in:
parent
6218931dde
commit
8242069ba6
3 changed files with 6 additions and 2 deletions
|
@ -253,6 +253,7 @@ namespace dd {
|
|||
inline bool is_val(PDD p) const { return m_nodes[p].is_val(); }
|
||||
inline bool is_internal(PDD p) const { return m_nodes[p].is_internal(); }
|
||||
inline bool is_var(PDD p) const { return !is_val(p) && is_zero(lo(p)) && is_one(hi(p)); }
|
||||
inline bool is_max(PDD p) const { SASSERT(m_semantics == mod2_e || m_semantics == mod2N_e); return is_val(p) && val(p) == max_value(); }
|
||||
bool is_never_zero(PDD p);
|
||||
inline unsigned level(PDD p) const { return m_nodes[p].m_level; }
|
||||
inline unsigned var(PDD p) const { return m_level2var[level(p)]; }
|
||||
|
@ -413,6 +414,7 @@ namespace dd {
|
|||
bool is_zero() const { return m.is_zero(root); }
|
||||
bool is_linear() const { return m.is_linear(root); }
|
||||
bool is_var() const { return m.is_var(root); }
|
||||
bool is_max() const { return m.is_max(root); }
|
||||
/** Polynomial is of the form a * x + b for numerals a, b. */
|
||||
bool is_unilinear() const { return !is_val() && lo().is_val() && hi().is_val(); }
|
||||
bool is_unary() const { return !is_val() && lo().is_zero() && hi().is_val(); }
|
||||
|
|
|
@ -70,7 +70,7 @@ namespace {
|
|||
return;
|
||||
}
|
||||
// p <= -1 --> 0 <= 0
|
||||
if (rhs.is_val() && rhs.val() == rhs.manager().max_value()) {
|
||||
if (rhs.is_max()) {
|
||||
lhs = 0, rhs = 0;
|
||||
return;
|
||||
}
|
||||
|
@ -202,6 +202,8 @@ namespace polysat {
|
|||
return true; // 0 > ... is always false
|
||||
if (lhs == rhs)
|
||||
return true; // p > p
|
||||
if (rhs.is_max())
|
||||
return true; // p > -1
|
||||
if (lhs.is_one() && rhs.is_never_zero())
|
||||
return true; // 1 > p implies p == 0
|
||||
return lhs.is_val() && rhs.is_val() && lhs.val() <= rhs.val();
|
||||
|
|
|
@ -27,6 +27,7 @@ namespace polysat {
|
|||
|
||||
ule_constraint(constraint_manager& m, pdd const& l, pdd const& r);
|
||||
static void simplify(bool& is_positive, pdd& lhs, pdd& rhs);
|
||||
static bool is_always_false(bool is_positive, pdd const& lhs, pdd const& rhs);
|
||||
|
||||
public:
|
||||
~ule_constraint() override {}
|
||||
|
@ -35,7 +36,6 @@ namespace polysat {
|
|||
static std::ostream& display(std::ostream& out, lbool status, pdd const& lhs, pdd const& rhs);
|
||||
std::ostream& display(std::ostream& out, lbool status) const override;
|
||||
std::ostream& display(std::ostream& out) const override;
|
||||
static bool is_always_false(bool is_positive, pdd const& lhs, pdd const& rhs);
|
||||
bool is_always_false(bool is_positive) const override;
|
||||
bool is_currently_false(solver& s, bool is_positive) const override;
|
||||
bool is_currently_false(solver& s, assignment_t const& sub, bool is_positive) const override;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue