Assert(t.getNumChildren() > 1);
std::vector<TNode> children;
- expr::algorithm::flatten(t, children);
+ expr::algorithm::flatten(t, children, Kind::ADD, Kind::TO_REAL);
rewriter::Sum sum;
for (const auto& child : children)
{
- rewriter::addToSum(sum, removeToReal(child));
+ rewriter::addToSum(sum, child);
}
Node retSum = rewriter::collectSum(sum);
retSum = maybeEnsureReal(t.getType(), retSum);
Assert(t.getNumChildren() >= 2);
std::vector<TNode> children;
- expr::algorithm::flatten(t, children, Kind::MULT, Kind::NONLINEAR_MULT);
+ expr::algorithm::flatten(t, children, Kind::MULT, Kind::NONLINEAR_MULT, Kind::TO_REAL);
if (auto res = rewriter::getZeroChild(children); res)
{
return RewriteResponse(REWRITE_DONE, maybeEnsureReal(t.getType(), *res));
}
- // remove TO_REAL
- for (TNode& tc : children)
- {
- tc = removeToReal(tc);
- }
-
Node ret;
// Distribute over addition
if (std::any_of(children.begin(), children.end(), [](TNode child) {
regress0/nl/issue8638-cov-resultants.smt2
regress0/nl/issue8691-msum-subtypes.smt2
regress0/nl/issue8691-3-msum-subtypes.smt2
+ regress0/nl/issue8692-idem-flatten.smt2
regress0/nl/lazard-spurious-root.smt2
regress0/nl/magnitude-wrong-1020-m.smt2
regress0/nl/mult-po.smt2
regress2/lemmas/simple_startup_9nodes.abstract.base.smtv1.smt2
regress2/javafe.ast.StandardPrettyPrint.319_no_forall.smt2
regress2/javafe.ast.WhileStmt.447_no_forall.smt2
+ regress2/nl/issue8693-flatten-to-real.smt2
regress2/nl/ufnia-factor-open-proof.smt2
regress2/ooo.rf6.smt2
regress2/ooo.tag10.smt2