Rational addedC = c0 + c1;
Node newC = mkRationalNode(addedC);
- NodeBuilder<> nb(kind::PLUS);
+ NodeBuilder<> nb(kind::MULT);
nb << newC;
for(unsigned i=1; i <= M; ++i){
nb << p0[i];
return newPnf;
}
-void sortAndCombineCoefficients(std::vector<Node>& pnfs){
+void ArithRewriter::sortAndCombineCoefficients(std::vector<Node>& pnfs){
using namespace std;
/* combined contains exactly 1 representative per for each pnf.
pnfs.clear();
for(PnfSet::iterator i=combined.begin(); i != combined.end(); ++i){
Node pnf = *i;
- pnfs.push_back(pnf);
+ if(pnf[0].getConst<Rational>() != d_constants->d_ZERO){
+ //after combination the coefficient may be zero
+ pnfs.push_back(pnf);
+ }
}
}
}else{
n.setAttribute(NormalForm(), res);
}
+ Debug("arithrewriter") << "Trace rewrite:" << n << "|->"<< res << std::endl;
return res;
}