This PR collects the InferenceId in the InferenceManagerBuffered class.
d_term_sk[n] = k;
Node eq = k.eqNode( n );
Trace("datatypes-infer") << "DtInfer : ref : " << eq << std::endl;
- d_im.addPendingLemma(eq);
+ d_im.addPendingLemma(eq, InferenceId::UNKNOWN);
return k;
}else{
return (*it).second;
Node lem = nm->mkNode(LEQ, d_zero, n);
Trace("datatypes-infer")
<< "DtInfer : size geq zero : " << lem << std::endl;
- d_im.addPendingLemma(lem);
+ d_im.addPendingLemma(lem, InferenceId::UNKNOWN);
}
else if (nk == DT_HEIGHT_BOUND && n[1].getConst<Rational>().isZero())
{
: nm->mkNode(OR, children));
}
Trace("datatypes-infer") << "DtInfer : zero height : " << lem << std::endl;
- d_im.addPendingLemma(lem);
+ d_im.addPendingLemma(lem, InferenceId::UNKNOWN);
}
}
}
bool InferenceManagerBuffered::addPendingLemma(Node lem,
+ InferenceId id,
LemmaProperty p,
ProofGenerator* pg,
bool checkCache)
}
}
// make the simple theory lemma
- d_pendingLem.emplace_back(new SimpleTheoryLemma(InferenceId::UNKNOWN, lem, p, pg));
+ d_pendingLem.emplace_back(new SimpleTheoryLemma(id, lem, p, pg));
return true;
}
}
void InferenceManagerBuffered::addPendingFact(Node conc,
+ InferenceId id,
Node exp,
ProofGenerator* pg)
{
// make a simple theory internal fact
Assert(conc.getKind() != AND && conc.getKind() != OR);
- d_pendingFact.emplace_back(new SimpleTheoryInternalFact(InferenceId::UNKNOWN, conc, exp, pg));
+ d_pendingFact.emplace_back(new SimpleTheoryInternalFact(id, conc, exp, pg));
}
void InferenceManagerBuffered::addPendingFact(
* doPendingLemmas.
*
* @param lem The lemma to send
+ * @param id The identifier of the inference
* @param p The property of the lemma
* @param pg The proof generator which can provide a proof for lem
* @param checkCache Whether we want to check that the lemma is already in
* false if the lemma is already cached.
*/
bool addPendingLemma(Node lem,
+ InferenceId id,
LemmaProperty p = LemmaProperty::NONE,
ProofGenerator* pg = nullptr,
bool checkCache = true);
*
* Pending facts are sent to the equality engine of this class using
* doPendingFacts.
+ * @param conc The conclustion
+ * @param id The identifier of the inference
+ * @param exp The explanation in the equality engine of the theory
+ * @param pg The proof generator which can provide a proof for conc
*/
- void addPendingFact(Node conc, Node exp, ProofGenerator* pg = nullptr);
+ void addPendingFact(Node conc, InferenceId id, Node exp, ProofGenerator* pg = nullptr);
/**
* Add pending fact, where fact can be a (derived) class of the
* theory inference base class.
{
Trace("cegqi-debug") << "Auxiliary CE lemma " << i << " : " << auxLems[i]
<< std::endl;
- d_qim.addPendingLemma(auxLems[i]);
+ d_qim.addPendingLemma(auxLems[i], InferenceId::UNKNOWN);
}
}
bool InstStrategyCegqi::addPendingLemma(Node lem) const
{
- return d_qim.addPendingLemma(lem);
+ return d_qim.addPendingLemma(lem, InferenceId::UNKNOWN);
}
CegInstantiator * InstStrategyCegqi::getInstantiator( Node q ) {
// add lemmas to process
for (const Node& lem : lems)
{
- d_qim.addPendingLemma(lem);
+ d_qim.addPendingLemma(lem, InferenceId::UNKNOWN);
}
// don't need to process this, since it has been reduced
return true;
if( !lem.empty() ){
for (const Node& l : lem)
{
- d_qim.addPendingLemma(l);
+ d_qim.addPendingLemma(l, InferenceId::UNKNOWN);
}
d_hasAddedLemma = true;
return false;
d_eq_conjectures[rhs].push_back( lhs );
Node lem = NodeManager::currentNM()->mkNode( OR, rsg.negate(), rsg );
- d_qim.addPendingLemma(lem);
+ d_qim.addPendingLemma(lem, InferenceId::UNKNOWN);
d_qim.addPendingPhaseRequirement(rsg, false);
addedLemmas++;
if( (int)addedLemmas>=options::conjectureGenPerRound() ){
{
Node u = tdb->getHoTypeMatchPredicate(tn);
Node au = nm->mkNode(kind::APPLY_UF, u, f);
- if (d_qim.addPendingLemma(au))
+ if (d_qim.addPendingLemma(au, InferenceId::UNKNOWN))
{
// this forces f to be a first-class member of the quantifier-free
// equality engine, which in turn forces the quantifier-free
<< "Make partially specified user pattern: " << std::endl;
Trace("auto-gen-trigger-partial") << " " << qq << std::endl;
Node lem = nm->mkNode(OR, q.negate(), qq);
- d_qim.addPendingLemma(lem);
+ d_qim.addPendingLemma(lem, InferenceId::UNKNOWN);
return;
}
unsigned tindex;
Node eq = k.eqNode(gt);
Trace("trigger-gt-lemma")
<< "Trigger: ground term purify lemma: " << eq << std::endl;
- d_qim.addPendingLemma(eq);
+ d_qim.addPendingLemma(eq, InferenceId::UNKNOWN);
gtAddedLemmas++;
}
}
{
Trace("bound-int-lemma")
<< "*** bound int : proxy lemma : " << prangeLem << std::endl;
- d_qim.addPendingLemma(prangeLem);
+ d_qim.addPendingLemma(prangeLem, InferenceId::UNKNOWN);
addedLemma = true;
}
}
if (hasProof)
{
// use proof generator
- addedLem = d_qim.addPendingLemma(lem, LemmaProperty::NONE, d_pfInst.get());
+ addedLem = d_qim.addPendingLemma(lem, InferenceId::UNKNOWN, LemmaProperty::NONE, d_pfInst.get());
}
else
{
- addedLem = d_qim.addPendingLemma(lem);
+ addedLem = d_qim.addPendingLemma(lem, InferenceId::UNKNOWN);
}
if (!addedLem)
for (const Node& lem : lemmas)
{
Trace("quant-dsplit") << "QuantDSplit lemma : " << lem << std::endl;
- d_qim.addPendingLemma(lem);
+ d_qim.addPendingLemma(lem, InferenceId::UNKNOWN);
}
Trace("quant-dsplit") << "QuantDSplit::check finished" << std::endl;
}
{
Trace("cegqi-lemma") << "Cegqi::Lemma : candidate refinement : " << lem
<< std::endl;
- bool res = d_qim.addPendingLemma(lem);
+ bool res = d_qim.addPendingLemma(lem, InferenceId::UNKNOWN);
if (res)
{
++(d_stats.d_cegqi_lemmas_refine);
bool addedLemma = false;
for (const Node& lem : cclems)
{
- if (d_qim.addPendingLemma(lem))
+ if (d_qim.addPendingLemma(lem, InferenceId::UNKNOWN))
{
++(d_statistics.d_cegqi_lemmas_ce);
addedLemma = true;
for (const Node& lem : lemmas)
{
Trace("sygus-inst") << "Evaluation unfolding: " << lem << std::endl;
- added_lemma |= d_qim.addPendingLemma(lem);
+ added_lemma |= d_qim.addPendingLemma(lem, InferenceId::UNKNOWN);
}
return added_lemma;
}
if (d_ce_lemma_added.find(q) != d_ce_lemma_added.end()) return;
Node lem = d_ce_lemmas[q];
- d_qim.addPendingLemma(lem);
+ d_qim.addPendingLemma(lem, InferenceId::UNKNOWN);
d_ce_lemma_added.insert(q);
Trace("sygus-inst") << "Add CE Lemma: " << lem << std::endl;
}
}
Trace("term-db-lemma") << " add lemma : " << lem << std::endl;
}
- d_qim.addPendingLemma(lem);
+ d_qim.addPendingLemma(lem, InferenceId::UNKNOWN);
d_qstate.notifyInConflict();
d_consistent_ee = false;
return;
// equality is sent out as a lemma here.
Trace("term-db-lemma")
<< "Purify equality lemma: " << eq << std::endl;
- d_qim.addPendingLemma(eq);
+ d_qim.addPendingLemma(eq, InferenceId::UNKNOWN);
d_qstate.notifyInConflict();
d_consistent_ee = false;
return false;
if( infer && conc!=d_false ){
Node ant_n = NodeManager::currentNM()->mkAnd(ant);
Trace("sep-lemma") << "Sep::Infer: " << conc << " from " << ant_n << " by " << c << std::endl;
- d_im.addPendingFact(conc, ant_n);
+ d_im.addPendingFact(conc, InferenceId::UNKNOWN, ant_n);
}else{
if( conc==d_false ){
Trace("sep-lemma") << "Sep::Conflict: " << ant << " by " << c
<< " by " << c << std::endl;
TrustNode trn = d_im.mkLemmaExp(conc, ant, {});
d_im.addPendingLemma(
- trn.getNode(), LemmaProperty::NONE, trn.getGenerator());
+ trn.getNode(), InferenceId::UNKNOWN, LemmaProperty::NONE, trn.getGenerator());
}
}
}
{
lem = NodeManager::currentNM()->mkNode(IMPLIES, exp, fact);
}
- addPendingLemma(lem);
+ addPendingLemma(lem, InferenceId::UNKNOWN);
return true;
}
Trace("sets-fact") << "Assert fact rec : " << fact << ", exp = " << exp
{
lem = NodeManager::currentNM()->mkNode(IMPLIES, exp, fact);
}
- addPendingLemma(lem);
+ addPendingLemma(lem, InferenceId::UNKNOWN);
return true;
}
return false;