Node NodeManager::mkConstInt(const Rational& r)
{
// !!!! Note will update to CONST_INTEGER.
+ Assert(r.isIntegral());
return mkConst(kind::CONST_RATIONAL, r);
}
{
Assert(tn.isRealOrInt()) << "Expected real or int for mkConstRealOrInt, got "
<< tn;
- if (tn.isReal())
+ if (tn.isInteger())
{
- return mkConstReal(r);
+ return mkConstInt(r);
}
- return mkConstInt(r);
+ return mkConstReal(r);
}
Node NodeManager::mkRealAlgebraicNumber(const RealAlgebraicNumber& ran)
case PfRule::STRING_SEQ_UNIT_INJ: return "STRING_SEQ_UNIT_INJ";
case PfRule::STRING_INFERENCE: return "STRING_INFERENCE";
//================================================= Arith rules
- case PfRule::MACRO_ARITH_SCALE_SUM_UB:
- return "ARITH_SCALE_SUM_UPPER_BOUNDS";
+ case PfRule::MACRO_ARITH_SCALE_SUM_UB: return "MACRO_ARITH_SCALE_SUM_UB";
case PfRule::ARITH_SUM_UB: return "ARITH_SUM_UB";
case PfRule::ARITH_TRICHOTOMY: return "ARITH_TRICHOTOMY";
case PfRule::INT_TIGHT_LB: return "INT_TIGHT_LB";
Pf pfNotGeq = d_pnm->mkAssume(geq.getNode().negate());
Pf pfLt =
d_pnm->mkNode(PfRule::MACRO_SR_PRED_TRANSFORM, {pfNotGeq}, {lt});
- Pf pfSum = d_pnm->mkNode(
- PfRule::MACRO_ARITH_SCALE_SUM_UB,
- {pfGt, pfLt},
- {nm->mkConstRealOrInt(type, -1), nm->mkConstRealOrInt(type, 1)});
+ Pf pfSum = d_pnm->mkNode(PfRule::MACRO_ARITH_SCALE_SUM_UB,
+ {pfGt, pfLt},
+ {nm->mkConstReal(-1), nm->mkConstReal(1)});
Pf pfBot = d_pnm->mkNode(
PfRule::MACRO_SR_PRED_TRANSFORM, {pfSum}, {nm->mkConst<bool>(false)});
std::vector<Node> assumptions = {leq.getNode().negate(),
const DeltaRational& mod = d_partialModel.getAssignment(v);
Rational qmodel = mod.substituteDelta(delta);
- Node qNode = nm->mkConstRealOrInt(term.getType(), qmodel);
- Trace("arith::collectModelInfo") << "m->assertEquality(" << term << ", " << qmodel << ", true)" << endl;
+ Node qNode;
+ if (!qmodel.isIntegral())
+ {
+ // Note that the linear solver may generate non-integer values for
+ // integer variables in rare cases. We construct real in this case;
+ // this will be corrected in TheoryArith::sanityCheckIntegerModel.
+ qNode = nm->mkConstReal(qmodel);
+ }
+ else
+ {
+ qNode = nm->mkConstRealOrInt(term.getType(), qmodel);
+ }
+ Trace("arith::collectModelInfo") << "m->assertEquality(" << term << ", "
+ << qNode << ", true)" << endl;
// Add to the map
arithModel[term] = qNode;
}else{
std::transform(coeffs->begin(),
coeffs->end(),
std::back_inserter(farkasCoefficients),
- [nm, type](const Rational& r) {
- return nm->mkConstRealOrInt(type, r);
- });
+ [nm](const Rational& r) { return nm->mkConstReal(r); });
// Prove bottom.
auto sumPf = d_pnm->mkNode(