3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-25 18:15:32 +00:00

re-adding saturation for inequalities

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2021-09-07 23:20:17 +02:00
parent e6e5621366
commit d8f0926620
6 changed files with 343 additions and 238 deletions

View file

@ -867,6 +867,12 @@ namespace dd {
e->m_rest = rest.root;
}
bool pdd_manager::factor(pdd const& p, unsigned v, unsigned degree, pdd& lc) {
pdd rest = lc;
factor(p, v, degree, lc, rest);
return rest.is_zero();
}
/**
* Apply function f to all coefficients of the polynomial.
* The function should be of type

View file

@ -271,6 +271,7 @@ namespace dd {
template <class Fn> pdd map_coefficients(pdd const& p, Fn f);
void factor(pdd const& p, unsigned v, unsigned degree, pdd& lc, pdd& rest);
bool factor(pdd const& p, unsigned v, unsigned degree, pdd& lc);
bool var_is_leaf(PDD p, unsigned v);
@ -414,6 +415,7 @@ namespace dd {
pdd reduce(pdd const& other) const { return m.reduce(*this, other); }
bool different_leading_term(pdd const& other) const { return m.different_leading_term(*this, other); }
void factor(unsigned v, unsigned degree, pdd& lc, pdd& rest) const { m.factor(*this, v, degree, lc, rest); }
bool factor(unsigned v, unsigned degree, pdd& lc) const { return m.factor(*this, v, degree, lc); }
bool resolve(unsigned v, pdd const& other, pdd& result) { return m.resolve(v, *this, other, result); }
pdd subst_val(vector<std::pair<unsigned, rational>> const& s) const { return m.subst_val(*this, s); }
@ -437,6 +439,8 @@ namespace dd {
pdd_iterator begin() const;
pdd_iterator end() const;
pdd_manager& manager() const { return m; }
};
inline pdd operator*(rational const& r, pdd const& b) { return b * r; }