nm->mkNode(kind::FLOATINGPOINT_ISNAN, node[0]),
nm->mkNode(kind::FLOATINGPOINT_ISINF, node[0])),
nm->mkNode(kind::EQUAL, res, node[1]));
- handleLemma(pd);
+ handleLemma(pd, InferenceId::FP_PREPROCESS);
Node z =
nm->mkNode(kind::IMPLIES,
nm->mkNode(kind::FLOATINGPOINT_ISZ, node[0]),
nm->mkNode(kind::EQUAL, res, nm->mkConst(Rational(0U))));
- handleLemma(z);
+ handleLemma(z, InferenceId::FP_PREPROCESS);
// TODO : bounds on the output from largest floats, #1914
}
Node nnan =
nm->mkNode(kind::NOT, nm->mkNode(kind::FLOATINGPOINT_ISNAN, res));
- handleLemma(nnan);
+ handleLemma(nnan, InferenceId::FP_PREPROCESS);
Node z = nm->mkNode(
kind::IMPLIES,
res,
nm->mkConst(FloatingPoint::makeZero(
res.getType().getConst<FloatingPointSize>(), false))));
- handleLemma(z);
+ handleLemma(z, InferenceId::FP_PREPROCESS);
// TODO : rounding-mode specific bounds on floats that don't give infinity
// BEWARE of directed rounding! #1914
kind::EQUAL,
nm->mkNode(kind::FLOATINGPOINT_GEQ, concrete[0], floatValue),
nm->mkNode(kind::GEQ, abstract, concreteValue)));
- handleLemma(fg);
+ handleLemma(fg, InferenceId::FP_PREPROCESS);
Node fl = nm->mkNode(
kind::IMPLIES,
kind::EQUAL,
nm->mkNode(kind::FLOATINGPOINT_LEQ, concrete[0], floatValue),
nm->mkNode(kind::LEQ, abstract, concreteValue)));
- handleLemma(fl);
+ handleLemma(fl, InferenceId::FP_PREPROCESS);
// Then the backwards constraints
Node floatAboveAbstract = Rewriter::rewrite(
nm->mkNode(
kind::FLOATINGPOINT_GEQ, concrete[0], floatAboveAbstract),
nm->mkNode(kind::GEQ, abstract, abstractValue)));
- handleLemma(bg);
+ handleLemma(bg, InferenceId::FP_PREPROCESS);
Node floatBelowAbstract = Rewriter::rewrite(
nm->mkNode(kind::FLOATINGPOINT_TO_FP_REAL,
nm->mkNode(
kind::FLOATINGPOINT_LEQ, concrete[0], floatBelowAbstract),
nm->mkNode(kind::LEQ, abstract, abstractValue)));
- handleLemma(bl);
+ handleLemma(bl, InferenceId::FP_PREPROCESS);
// TODO : see if the overflow conditions could be improved #1914
return true;
kind::EQUAL,
nm->mkNode(kind::GEQ, concrete[1], realValue),
nm->mkNode(kind::FLOATINGPOINT_GEQ, abstract, concreteValue)));
- handleLemma(fg);
+ handleLemma(fg, InferenceId::FP_PREPROCESS);
Node fl = nm->mkNode(
kind::IMPLIES,
kind::EQUAL,
nm->mkNode(kind::LEQ, concrete[1], realValue),
nm->mkNode(kind::FLOATINGPOINT_LEQ, abstract, concreteValue)));
- handleLemma(fl);
+ handleLemma(fl, InferenceId::FP_PREPROCESS);
// Then the backwards constraints
if (!abstractValue.getConst<FloatingPoint>().isInfinite())
kind::EQUAL,
nm->mkNode(kind::GEQ, concrete[1], realValueOfAbstract),
nm->mkNode(kind::FLOATINGPOINT_GEQ, abstract, abstractValue)));
- handleLemma(bg);
+ handleLemma(bg, InferenceId::FP_PREPROCESS);
Node bl = nm->mkNode(
kind::IMPLIES,
kind::EQUAL,
nm->mkNode(kind::LEQ, concrete[1], realValueOfAbstract),
nm->mkNode(kind::FLOATINGPOINT_LEQ, abstract, abstractValue)));
- handleLemma(bl);
+ handleLemma(bl, InferenceId::FP_PREPROCESS);
}
return true;
NodeManager *nm = NodeManager::currentNM();
handleLemma(
- nm->mkNode(kind::EQUAL, addA, nm->mkConst(::cvc5::BitVector(1U, 1U))));
+ nm->mkNode(kind::EQUAL, addA, nm->mkConst(::cvc5::BitVector(1U, 1U))),
+ InferenceId::FP_EQUATE_TERM);
#endif
++oldAdditionalAssertions;
#ifdef SYMFPUPROPISBOOL
handleLemma(nm->mkNode(kind::EQUAL, node, converted));
#else
- handleLemma(nm->mkNode(
- kind::EQUAL,
- node,
- nm->mkNode(
- kind::EQUAL, converted, nm->mkConst(::cvc5::BitVector(1U, 1U)))));
+ handleLemma(
+ nm->mkNode(kind::EQUAL,
+ node,
+ nm->mkNode(kind::EQUAL,
+ converted,
+ nm->mkConst(::cvc5::BitVector(1U, 1U)))),
+ InferenceId::FP_EQUATE_TERM);
#endif
} else {
Assert(converted.getType().isBitVector());
handleLemma(
- NodeManager::currentNM()->mkNode(kind::EQUAL, node, converted));
+ NodeManager::currentNM()->mkNode(kind::EQUAL, node, converted),
+ InferenceId::FP_EQUATE_TERM);
}
}
Unreachable() << "Only isNaN, isInf and isZero have aliases";
}
- handleLemma(nm->mkNode(kind::EQUAL, node, equalityAlias));
+ handleLemma(nm->mkNode(kind::EQUAL, node, equalityAlias),
+ InferenceId::FP_REGISTER_TERM);
}
// Use symfpu to produce an equivalent bit-vector statement
case InferenceId::ARITH_BB_LEMMA: return "ARITH_BB_LEMMA";
case InferenceId::ARITH_DIO_CUT: return "ARITH_DIO_CUT";
case InferenceId::ARITH_DIO_DECOMPOSITION: return "ARITH_DIO_DECOMPOSITION";
+ case InferenceId::ARITH_UNATE: return "ARITH_UNATE";
+ case InferenceId::ARITH_ROW_IMPL: return "ARITH_ROW_IMPL";
case InferenceId::ARITH_SPLIT_FOR_NL_MODEL:
return "ARITH_SPLIT_FOR_NL_MODEL";
case InferenceId::ARITH_PP_ELIM_OPERATORS: return "ARITH_PP_ELIM_OPERATORS";
return "DATATYPES_SYGUS_MT_BOUND";
case InferenceId::DATATYPES_SYGUS_MT_POS: return "DATATYPES_SYGUS_MT_POS";
+ case InferenceId::FP_PREPROCESS: return "FP_PREPROCESS";
+ case InferenceId::FP_EQUATE_TERM: return "FP_EQUATE_TERM";
+ case InferenceId::FP_REGISTER_TERM: return "FP_REGISTER_TERM";
+
case InferenceId::QUANTIFIERS_INST_E_MATCHING:
return "QUANTIFIERS_INST_E_MATCHING";
case InferenceId::QUANTIFIERS_INST_E_MATCHING_SIMPLE:
return "SETS_RELS_PRODUCE_COMPOSE";
case InferenceId::SETS_RELS_PRODUCT_SPLIT: return "SETS_RELS_PRODUCT_SPLIT";
case InferenceId::SETS_RELS_TCLOSURE_FWD: return "SETS_RELS_TCLOSURE_FWD";
+ case InferenceId::SETS_RELS_TCLOSURE_UP: return "SETS_RELS_TCLOSURE_UP";
case InferenceId::SETS_RELS_TRANSPOSE_EQ: return "SETS_RELS_TRANSPOSE_EQ";
case InferenceId::SETS_RELS_TRANSPOSE_REV: return "SETS_RELS_TRANSPOSE_REV";
case InferenceId::SETS_RELS_TUPLE_REDUCTION:
{
collectRelsInfo();
check();
- doPendingInfers();
+ d_im.doPendingLemmas();
}
- Assert(d_pending.empty());
+ Assert(!d_im.hasPendingLemma());
Trace("rels") << "\n[sets-rels] ******************************* Done with "
"the relational solver *******************************\n"
<< std::endl;
RelsUtils::constructPair(tc_rel, sk_1, sk_2),
tc_rel))));
- Node tc_lemma = nm->mkNode(IMPLIES, reason, conc);
- d_pending.push_back(tc_lemma);
+ sendInfer(conc, InferenceId::SETS_RELS_TCLOSURE_UP, reason);
}
bool TheorySetsRels::isTCReachable( Node mem_rep, Node tc_rel ) {
}
- void TheorySetsRels::doPendingInfers()
- {
- // process the inferences in d_pending
- if (!d_state.isInConflict())
- {
- for (const Node& p : d_pending)
- {
- if (p.getKind() == IMPLIES)
- {
- processInference(p[1], InferenceId::UNKNOWN, p[0]);
- }
- else
- {
- processInference(p, InferenceId::UNKNOWN, d_trueNode);
- }
- if (d_state.isInConflict())
- {
- break;
- }
- }
- // if we are still not in conflict, send lemmas
- if (!d_state.isInConflict())
- {
- d_im.doPendingLemmas();
- }
- }
- d_pending.clear();
- }
-
void TheorySetsRels::processInference(Node conc, InferenceId id, Node exp)
{
Trace("sets-pinfer") << "Process inference: " << exp << " => " << conc
Trace("rels-lemma") << "Rels::lemma " << fact << " from " << reason
<< " by " << id << std::endl;
Node lemma = NodeManager::currentNM()->mkNode(IMPLIES, reason, fact);
- d_pending.push_back(lemma);
+ d_im.addPendingLemma(lemma, id);
}
}
}