mirror of
https://github.com/Z3Prover/z3
synced 2025-04-15 21:38:44 +00:00
fix in simplify sum
Signed-off-by: Lev Nachmanson <levnach@nachmanson.com>
This commit is contained in:
parent
64b189d932
commit
7acc679144
|
@ -500,9 +500,17 @@ nex * nex_creator::simplify_mul(nex_mul *e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
nex* nex_creator::simplify_sum(nex_sum *e) {
|
nex* nex_creator::simplify_sum(nex_sum *e) {
|
||||||
|
TRACE("nla_cn", tout << lp::lp_settings::ddd << "\n";);
|
||||||
TRACE("nla_cn_details", tout << "was e = " << *e << "\n";);
|
TRACE("nla_cn_details", tout << "was e = " << *e << "\n";);
|
||||||
simplify_children_of_sum(e->children());
|
simplify_children_of_sum(e->children());
|
||||||
nex *r = e->size() == 1? (*e)[0]: e;
|
nex *r;
|
||||||
|
if (e->size() == 1) {
|
||||||
|
r = (*e)[0];
|
||||||
|
} else if (e->size() == 0) {
|
||||||
|
r = mk_scalar(rational(0));
|
||||||
|
} else {
|
||||||
|
r = e;
|
||||||
|
}
|
||||||
TRACE("nla_cn_details", tout << "became r = " << *r << "\n";);
|
TRACE("nla_cn_details", tout << "became r = " << *r << "\n";);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue