3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-29 11:55:51 +00:00

optimize horner scheme

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
Lev Nachmanson 2019-08-20 17:34:47 -07:00
parent 2584e777f9
commit eb5b9557ed
2 changed files with 18 additions and 7 deletions

View file

@ -290,6 +290,17 @@ public:
ptr_vector<nex>* children_ptr() { return &m_children;}
unsigned size() const { return m_children.size(); }
bool is_linear() const {
TRACE("nex_details", tout << *this << "\n";);
for (auto e : children()) {
if (e->get_degree() > 1)
return false;
}
TRACE("nex_details", tout << "linear\n";);
return true;
}
// we need a linear combination of at least two variables
bool is_a_linear_term() const {
TRACE("nex_details", tout << *this << "\n";);