This is now possible since we always preprocess lemmas.
Note that the LemmaProperty on inferences may be redundant throughout the non-linear solver now.
// tn is of kind REWRITE, turn this into a LEMMA here
TrustNode tlem = TrustNode::mkTrustLemma(tn.getProven(), tn.getGenerator());
// must preprocess
- d_im.trustedLemma(tlem, LemmaProperty::PREPROCESS);
+ d_im.trustedLemma(tlem);
// mark the atom as reduced
d_reduced[atom] = true;
return true;
InferenceManager::InferenceManager(TheoryArith& ta,
ArithState& astate,
ProofNodeManager* pnm)
- : InferenceManagerBuffered(ta, astate, pnm), d_lemmasPp(ta.getUserContext())
+ : InferenceManagerBuffered(ta, astate, pnm)
{
}
bool InferenceManager::hasCachedLemma(TNode lem, LemmaProperty p)
{
Node rewritten = Rewriter::rewrite(lem);
- if (isLemmaPropertyPreprocess(p))
- {
- return d_lemmasPp.find(rewritten) != d_lemmasPp.end();
- }
return TheoryInferenceManager::hasCachedLemma(rewritten, p);
}
bool InferenceManager::cacheLemma(TNode lem, LemmaProperty p)
{
Node rewritten = Rewriter::rewrite(lem);
- if (isLemmaPropertyPreprocess(p))
- {
- if (d_lemmasPp.find(rewritten) != d_lemmasPp.end())
- {
- return false;
- }
- d_lemmasPp.insert(rewritten);
- return true;
- }
return TheoryInferenceManager::cacheLemma(rewritten, p);
}
/** The waiting lemmas. */
std::vector<std::unique_ptr<ArithLemma>> d_waitingLem;
-
- /** cache of all preprocessed lemmas sent on the output channel
- * (user-context-dependent) */
- NodeSet d_lemmasPp;
};
} // namespace arith
Node lem = sumBasedLemma(i); // add lemmas based on sum mode
Trace("iand-lemma")
<< "IAndSolver::Lemma: " << lem << " ; SUM_REFINE" << std::endl;
- // lemma can contain div/mod so need to tag it with the PREPROCESS lemma property
- d_im.addPendingArithLemma(lem,
- InferenceId::NL_IAND_SUM_REFINE,
- nullptr,
- true,
- LemmaProperty::PREPROCESS);
+ // note that lemma can contain div/mod, and will be preprocessed in the
+ // prop engine
+ d_im.addPendingArithLemma(
+ lem, InferenceId::NL_IAND_SUM_REFINE, nullptr, true);
}
else if (options::iandMode() == options::IandMode::BITWISE)
{
Node lem = bitwiseLemma(i); // check for violated bitwise axioms
Trace("iand-lemma")
<< "IAndSolver::Lemma: " << lem << " ; BITWISE_REFINE" << std::endl;
- // lemma can contain div/mod so need to tag it with the PREPROCESS lemma property
- d_im.addPendingArithLemma(lem,
- InferenceId::NL_IAND_BITWISE_REFINE,
- nullptr,
- true,
- LemmaProperty::PREPROCESS);
+ // note that lemma can contain div/mod, and will be preprocessed in the
+ // prop engine
+ d_im.addPendingArithLemma(
+ lem, InferenceId::NL_IAND_BITWISE_REFINE, nullptr, true);
}
else
{
// note we must do preprocess on this lemma
Trace("nl-ext-lemma") << "NonlinearExtension::Lemma : purify : " << lem
<< std::endl;
- NlLemma nlem(
- lem, LemmaProperty::PREPROCESS, nullptr, InferenceId::NL_T_PURIFY_ARG);
+ NlLemma nlem(lem, LemmaProperty::NONE, nullptr, InferenceId::NL_T_PURIFY_ARG);
d_data->d_im.addPendingArithLemma(nlem);
}
// note we must do preprocess on this lemma
Trace("nl-ext-lemma") << "NonlinearExtension::Lemma : purify : " << lem
<< std::endl;
- NlLemma nlem(
- lem, LemmaProperty::PREPROCESS, proof, InferenceId::NL_T_PURIFY_ARG);
+ NlLemma nlem(lem, LemmaProperty::NONE, proof, InferenceId::NL_T_PURIFY_ARG);
d_data->d_im.addPendingArithLemma(nlem);
}
if (d_pp_lemmas.find(lem) == d_pp_lemmas.end())
{
d_pp_lemmas.insert(lem);
- d_out.lemma(lem, LemmaProperty::PREPROCESS);
+ d_out.lemma(lem);
return true;
}
}
void TheoryFp::handleLemma(Node node) {
Trace("fp") << "TheoryFp::handleLemma(): asserting " << node << std::endl;
- // Preprocess has to be true because it contains embedded ITEs
- d_out->lemma(node, LemmaProperty::PREPROCESS);
+ // will be preprocessed when sent, which is important because it contains
+ // embedded ITEs
+ d_out->lemma(node);
}
bool TheoryFp::propagateLit(TNode node)
{
return (p & LemmaProperty::REMOVABLE) != LemmaProperty::NONE;
}
-bool isLemmaPropertyPreprocess(LemmaProperty p)
-{
- return (p & LemmaProperty::PREPROCESS) != LemmaProperty::NONE;
-}
bool isLemmaPropertySendAtoms(LemmaProperty p)
{
return (p & LemmaProperty::SEND_ATOMS) != LemmaProperty::NONE;
{
out << " REMOVABLE";
}
- if (isLemmaPropertyPreprocess(p))
- {
- out << " PREPROCESS";
- }
if (isLemmaPropertySendAtoms(p))
{
out << " SEND_ATOMS";
NONE = 0,
// whether the lemma is removable
REMOVABLE = 1,
- // whether the lemma needs preprocessing
- PREPROCESS = 2,
// whether the processing of the lemma should send atoms to the caller
- SEND_ATOMS = 4,
+ SEND_ATOMS = 2,
// whether the lemma is part of the justification for answering "sat"
- NEEDS_JUSTIFY = 8
+ NEEDS_JUSTIFY = 4
};
/** Define operator lhs | rhs */
LemmaProperty operator|(LemmaProperty lhs, LemmaProperty rhs);
LemmaProperty& operator&=(LemmaProperty& lhs, LemmaProperty rhs);
/** is the removable bit set on p? */
bool isLemmaPropertyRemovable(LemmaProperty p);
-/** is the preprocess bit set on p? */
-bool isLemmaPropertyPreprocess(LemmaProperty p);
/** is the send atoms bit set on p? */
bool isLemmaPropertySendAtoms(LemmaProperty p);
/** is the needs justify bit set on p? */
ce_vars.push_back(tutil->getInstantiationConstant(q, i));
}
// send the lemma
- d_quantEngine->getOutputChannel().lemma(lem, LemmaProperty::PREPROCESS);
+ d_quantEngine->getOutputChannel().lemma(lem);
// get the preprocessed form of the lemma we just sent
std::vector<Node> skolems;
std::vector<Node> skAsserts;
nn = nn.substitute( vars.begin(), vars.end(), subs.begin(), subs.end() );
Node lem = NodeManager::currentNM()->mkNode( LEQ, nn, d_range[q][v] );
Trace("bound-int-lemma") << "*** Add lemma to minimize instantiated non-ground term " << lem << std::endl;
- d_quantEngine->getOutputChannel().lemma(lem, LemmaProperty::PREPROCESS);
+ d_quantEngine->getOutputChannel().lemma(lem);
}
return false;
}else{
Trace("quantifiers-sk-debug")
<< "Skolemize lemma : " << slem << std::endl;
}
- getOutputChannel().trustedLemma(
- lem, LemmaProperty::PREPROCESS | LemmaProperty::NEEDS_JUSTIFY);
+ getOutputChannel().trustedLemma(lem, LemmaProperty::NEEDS_JUSTIFY);
}
return;
}
const Node& lemw = d_lemmas_waiting[i];
Trace("qe-lemma") << "Lemma : " << lemw << std::endl;
itp = d_lemmasWaitingPg.find(lemw);
- LemmaProperty p =
- LemmaProperty::PREPROCESS | LemmaProperty::NEEDS_JUSTIFY;
+ LemmaProperty p = LemmaProperty::NEEDS_JUSTIFY;
if (itp != d_lemmasWaitingPg.end())
{
TrustNode tlemw = TrustNode::mkTrustLemma(lemw, itp->second);