mirror of
https://github.com/Z3Prover/z3
synced 2025-04-29 11:55:51 +00:00
fixes in horner's heuristic
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
parent
c95f66e02a
commit
207c1c509f
6 changed files with 64 additions and 17 deletions
|
@ -376,17 +376,20 @@ public:
|
|||
return *this;
|
||||
}
|
||||
|
||||
bool sum_is_linear() const {
|
||||
bool sum_is_a_linear_term() const {
|
||||
SASSERT(is_sum());
|
||||
int degree = 0;
|
||||
unsigned number_of_non_scalars = 0;
|
||||
for (auto & e : children()) {
|
||||
int d = e.get_degree();
|
||||
if (d > 1)
|
||||
return false;
|
||||
if (d > degree)
|
||||
degree = d;
|
||||
if (!e.is_scalar())
|
||||
number_of_non_scalars++;
|
||||
}
|
||||
return degree == 1;
|
||||
return degree == 1 && number_of_non_scalars > 1;
|
||||
}
|
||||
|
||||
int get_degree() const {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue