Work towards virtual clause deletion, where lemmas will be SAT-context dependent.
This adds an argument to the decision engine so it can distinguish lemmas from input assertions.
DecisionEngineEmpty::DecisionEngineEmpty(Env& env) : DecisionEngine(env) {}
bool DecisionEngineEmpty::isDone() { return false; }
-void DecisionEngineEmpty::addAssertion(TNode assertion) {}
-void DecisionEngineEmpty::addSkolemDefinition(TNode lem, TNode skolem) {}
+void DecisionEngineEmpty::addAssertion(TNode assertion, bool isLemma) {}
+void DecisionEngineEmpty::addSkolemDefinition(TNode lem,
+ TNode skolem,
+ bool isLemma)
+{
+}
prop::SatLiteral DecisionEngineEmpty::getNextInternal(bool& stopSearch)
{
return undefSatLiteral;
* Notify this class that assertion is an (input) assertion, not corresponding
* to a skolem definition.
*/
- virtual void addAssertion(TNode assertion) = 0;
+ virtual void addAssertion(TNode assertion, bool isLemma) = 0;
/**
* Notify this class that lem is the skolem definition for skolem, which is
* a part of the current assertions.
*/
- virtual void addSkolemDefinition(TNode lem, TNode skolem) = 0;
+ virtual void addSkolemDefinition(TNode lem, TNode skolem, bool isLemma) = 0;
/**
* Notify this class that the list of lemmas defs are now active in the
* current SAT context.
public:
DecisionEngineEmpty(Env& env);
bool isDone() override;
- void addAssertion(TNode assertion) override;
- void addSkolemDefinition(TNode lem, TNode skolem) override;
+ void addAssertion(TNode assertion, bool isLemma) override;
+ void addSkolemDefinition(TNode lem, TNode skolem, bool isLemma) override;
protected:
prop::SatLiteral getNextInternal(bool& stopSearch) override;
return d_decisionStopOnly ? undefSatLiteral : ret;
}
-void DecisionEngineOld::addAssertion(TNode assertion)
+void DecisionEngineOld::addAssertion(TNode assertion, bool isLemma)
{
// new assertions, reset whatever result we knew
d_result = SAT_VALUE_UNKNOWN;
}
}
-void DecisionEngineOld::addSkolemDefinition(TNode lem, TNode skolem)
+void DecisionEngineOld::addSkolemDefinition(TNode lem,
+ TNode skolem,
+ bool isLemma)
{
// new assertions, reset whatever result we knew
d_result = SAT_VALUE_UNKNOWN;
* Notify this class that assertion is an (input) assertion, not corresponding
* to a skolem definition.
*/
- void addAssertion(TNode assertion) override;
+ void addAssertion(TNode assertion, bool isLemma) override;
/**
* Notify this class that lem is the skolem definition for skolem, which is
* a part of the current assertions.
*/
- void addSkolemDefinition(TNode lem, TNode skolem) override;
+ void addSkolemDefinition(TNode lem, TNode skolem, bool isLemma) override;
// Interface for Strategies to use stuff stored in Decision Engine
// (which was possibly requested by them on initialization)
bool JustificationStrategy::isDone() { return !refreshCurrentAssertion(); }
-void JustificationStrategy::addAssertion(TNode assertion)
+void JustificationStrategy::addAssertion(TNode assertion, bool isLemma)
{
Trace("jh-assert") << "addAssertion " << assertion << std::endl;
std::vector<TNode> toProcess;
insertToAssertionList(toProcess, false);
}
-void JustificationStrategy::addSkolemDefinition(TNode lem, TNode skolem)
+void JustificationStrategy::addSkolemDefinition(TNode lem,
+ TNode skolem,
+ bool isLemma)
{
Trace("jh-assert") << "addSkolemDefinition " << lem << " / " << skolem
<< std::endl;
* Notify this class that assertion is an (input) assertion, not corresponding
* to a skolem definition.
*/
- void addAssertion(TNode assertion) override;
+ void addAssertion(TNode assertion, bool isLemma) override;
/**
* Notify this class that lem is the skolem definition for skolem, which is
* a part of the current assertions.
*/
- void addSkolemDefinition(TNode lem, TNode skolem) override;
+ void addSkolemDefinition(TNode lem, TNode skolem, bool isLemma) override;
/**
* Notify this class that the list of lemmas defs are now active in the
* current SAT context. This is triggered when a literal lit is sent to
{
skolem = it->second;
}
- d_theoryProxy->notifyAssertion(assertions[i], skolem);
+ d_theoryProxy->notifyAssertion(assertions[i], skolem, false);
}
for (const Node& node : assertions)
{
if (!trn.isNull())
{
// notify the theory proxy of the lemma
- d_theoryProxy->notifyAssertion(trn.getProven());
+ d_theoryProxy->notifyAssertion(trn.getProven(), TNode::null(), true);
}
for (const theory::SkolemLemma& lem : ppLemmas)
{
- d_theoryProxy->notifyAssertion(lem.getProven(), lem.d_skolem);
+ d_theoryProxy->notifyAssertion(lem.getProven(), lem.d_skolem, true);
}
}
}
d_theoryEngine->presolve();
}
-void TheoryProxy::notifyAssertion(Node a, TNode skolem)
+void TheoryProxy::notifyAssertion(Node a, TNode skolem, bool isLemma)
{
if (skolem.isNull())
{
- d_decisionEngine->addAssertion(a);
+ d_decisionEngine->addAssertion(a, isLemma);
}
else
{
d_skdm->notifySkolemDefinition(skolem, a);
- d_decisionEngine->addSkolemDefinition(a, skolem);
+ d_decisionEngine->addSkolemDefinition(a, skolem, isLemma);
}
}
/** Presolve, which calls presolve for the modules managed by this class */
void presolve();
- /** Notify a lemma, possibly corresponding to a skolem definition */
- void notifyAssertion(Node lem, TNode skolem = TNode::null());
+ /**
+ * Notify a lemma or input assertion, possibly corresponding to a skolem
+ * definition.
+ */
+ void notifyAssertion(Node lem,
+ TNode skolem = TNode::null(),
+ bool isLemma = false);
void theoryCheck(theory::Theory::Effort effort);