NodeManager* nm = NodeManager::currentNM();
if (getMonomialSum(lit[1], msum2))
{
- TypeNode tn = lit[0].getType();
for (std::map<Node, Node>::iterator it = msum2.begin();
it != msum2.end();
++it)
Rational r2 = it->second.isNull()
? Rational(1)
: it->second.getConst<Rational>();
- msum[it->first] = nm->mkConstRealOrInt(tn, r1 - r2);
+ msum[it->first] = nm->mkConstRealOrInt(r1 - r2);
}
else
{
msum[it->first] = it->second.isNull()
- ? nm->mkConstRealOrInt(tn, Rational(-1))
+ ? nm->mkConstInt(Rational(-1))
: nm->mkConstRealOrInt(
- tn, -it->second.getConst<Rational>());
+ -it->second.getConst<Rational>());
}
}
return true;
return false;
}
-Node ArithMSum::mkNode(TypeNode tn, const std::map<Node, Node>& msum)
+Node ArithMSum::mkNode(const std::map<Node, Node>& msum)
{
NodeManager* nm = NodeManager::currentNM();
std::vector<Node> children;
return children.size() > 1
? nm->mkNode(ADD, children)
: (children.size() == 1 ? children[0]
- : nm->mkConstRealOrInt(tn, Rational(0)));
+ : nm->mkConstInt(Rational(0)));
}
int ArithMSum::isolate(
{
coeff = it->second;
msum.erase(v);
- rem = mkNode(n.getType(), msum);
+ rem = mkNode(msum);
return true;
}
}
* Make the Node corresponding to the interpretation of msum, [msum], where:
* [msum] = sum_{( v, c ) \in msum } [c]*[v]
*
- * @param tn The type of the node to return, which is used only if msum is
- * empty
* @param msum The monomial sum
* @return The node corresponding to the monomial sum
+ *
+ * Note this utility is agnostic to types, it will return the integer 0 if
+ * msum is empty.
*/
- static Node mkNode(TypeNode tn, const std::map<Node, Node>& msum);
+ static Node mkNode(const std::map<Node, Node>& msum);
/** make coefficent term
*
* This function may return false if lit does not contain v,
* or if lit is an integer equality with a coefficent on v,
* e.g. 3*v = 7.
+ *
+ * Note this utility is agnostic to types, the returned term may be Int when
+ * v is Real.
*/
static Node solveEqualityFor(Node lit, Node v);
regress0/nl/issue8515-cov-iand.smt2
regress0/nl/issue8516-cov-sin.smt2
regress0/nl/issue8638-cov-resultants.smt2
+ regress0/nl/issue8691-msum-subtypes.smt2
+ regress0/nl/issue8691-3-msum-subtypes.smt2
regress0/nl/lazard-spurious-root.smt2
regress0/nl/magnitude-wrong-1020-m.smt2
regress0/nl/mult-po.smt2