Currently this is only limited to lemmas generated via the d_out->lemma() interface, i.e. no propagations
and conflict lemmas.
Debug(tag) << std::endl << "[Simple lemma]" << std::endl << std::endl;
}
+ if (d_originalLemma != Node()) {
+ Debug(tag) << std::endl << "Original lemma: " << d_originalLemma << std::endl << std::endl;
+ }
+
unsigned count = 1;
Debug(tag) << "Base assertions:" << std::endl;
for (std::set<Node>::iterator baseIt = d_baseAssertions.begin();
return d_proofSteps.size();
}
+void LemmaProofRecipe::setOriginalLemma(Node lemma) {
+ d_originalLemma = lemma;
+}
+
+Node LemmaProofRecipe::getOriginalLemma() const {
+ return d_originalLemma;
+}
+
+
} /* namespace CVC4 */
bool wasRewritten(Node assertion) const;
Node getExplanation(Node assertion) const;
+ //* Original lemma */
+ void setOriginalLemma(Node lemma);
+ Node getOriginalLemma() const;
+
//* Proof Steps */
void addStep(ProofStep& proofStep);
const ProofStep* getStep(unsigned index) const;
//* A map from assertions to their rewritten explanations (toAssert --> toExplain) */
std::map<Node, Node> d_assertionToExplanation;
+
+ //* The original lemma, as asserted by the owner theory solver */
+ Node d_originalLemma;
};
} /* CVC4 namespace */
}
ProofManager* ProofManager::currentPM() {
+ Assert(PROOF_ON(), "Cannot call ProofManager when proofs are off");
return smt::currentProofManager();
}
}
}
+void ProofManager::getLemmasInUnsatCore(theory::TheoryId theory, std::vector<Node> &lemmas) {
+ d_satProof->constructProof();
+
+ IdToSatClause used_lemmas;
+ IdToSatClause used_inputs;
+ d_satProof->collectClausesUsed(used_inputs, used_lemmas);
+
+ IdToSatClause::const_iterator it;
+
+ for (it = used_lemmas.begin(); it != used_lemmas.end(); ++it) {
+ std::set<Node> lemma;
+ for(unsigned i = 0; i < it->second->size(); ++i) {
+ prop::SatLiteral lit = (*(it->second))[i];
+ Node node = getCnfProof()->getAtom(lit.getSatVariable());
+ Expr atom = node.toExpr();
+ if (atom.isConst()) {
+ Assert (atom == utils::mkTrue());
+ continue;
+ }
+ lemma.insert(lit.isNegated() ? node.notNode() : node);
+ }
+
+ LemmaProofRecipe recipe = getCnfProof()->getProofRecipe(lemma);
+
+ if (recipe.simpleLemma() && recipe.getTheory() == theory) {
+ lemmas.push_back(recipe.getOriginalLemma());
+ }
+ }
+}
+
void ProofManager::addAssertion(Expr formula) {
Debug("proof:pm") << "assert: " << formula << std::endl;
d_inputFormulas.insert(formula);
assertions_iterator end_unsat_core() const { return d_outputCoreFormulas.end(); }
size_t size_unsat_core() const { return d_outputCoreFormulas.size(); }
+ void getLemmasInUnsatCore(theory::TheoryId theory, std::vector<Node> &lemmas);
+
int nextId() { return d_nextId++; }
void setLogic(const LogicInfo& logic);
Node emptyNode;
LemmaProofRecipe::ProofStep proofStep(d_theory, emptyNode);
+ proofRecipe->setOriginalLemma(lemma);
+
Node rewritten;
if (lemma.getKind() == kind::OR) {
for (unsigned i = 0; i < lemma.getNumChildren(); ++i) {
void TheoryEngine::finishInit() {
// initialize the quantifiers engine
d_quantEngine = new QuantifiersEngine(d_context, d_userContext, this);
-
+
//initialize the model
if( d_logicInfo.isQuantified() ) {
d_curr_model = d_quantEngine->getModel();