Node mkMultTerm(const RealAlgebraicNumber& multiplicity, TNode monomial)
{
- if (multiplicity.isRational())
+ Node mterm = mkConst(multiplicity);
+ if (mterm.isConst())
{
- return mkMultTerm(multiplicity.toRational(), monomial);
+ return mkMultTerm(mterm.getConst<Rational>(), monomial);
}
if (monomial.isConst())
{
return mkConst(multiplicity * monomial.getConst<Rational>());
}
std::vector<Node> prod;
- prod.emplace_back(mkConst(multiplicity));
+ prod.emplace_back(mterm);
if (monomial.getKind() == Kind::MULT || monomial.getKind() == Kind::NONLINEAR_MULT)
{
prod.insert(prod.end(), monomial.begin(), monomial.end());
{
return mkConst(multiplicity);
}
- if (multiplicity.isRational())
+ Node mterm = mkConst(multiplicity);
+ if (mterm.isConst())
{
std::sort(monomial.begin(), monomial.end(), rewriter::LeafNodeComparator());
- return mkMultTerm(multiplicity.toRational(), mkNonlinearMult(monomial));
+ return mkMultTerm(mterm.getConst<Rational>(), mkNonlinearMult(monomial));
}
- monomial.emplace_back(mkConst(multiplicity));
+ monomial.emplace_back(mterm);
std::sort(monomial.begin(), monomial.end(), rewriter::LeafNodeComparator());
Assert(monomial.size() >= 2);
return NodeManager::currentNM()->mkNode(Kind::NONLINEAR_MULT, monomial);
regress0/arith/arith.01.cvc.smt2
regress0/arith/arith.02.cvc.smt2
regress0/arith/arith.03.cvc.smt2
+ regress0/arith/arith-rewrite-with-ran.smt2
regress0/arith/bug443.delta01.smtv1.smt2
regress0/arith/bug547.2.smt2
regress0/arith/bug549.cvc.smt2