#include "options/options.h"
#include "preprocessing/assertion_pipeline.h"
#include "proof/proof_manager.h"
+#include "prop/proof_cnf_stream.h"
#include "util/resource_manager.h"
#include "util/result.h"
#include "util/unsafe_interrupt_exception.h"
*/
bool properExplanation(TNode node, TNode expl) const;
+ /** Retrieve this modules proof CNF stream. */
+ ProofCnfStream* getProofCnfStream();
+
/**
* Return the prop engine proof. This should be called only when proofs are
* enabled. Returns a proof of false whose free assumptions are the
/** The CNF converter in use */
CnfStream* d_cnfStream;
+ /** Proof-producing CNF converter */
+ std::unique_ptr<ProofCnfStream> d_pfCnfStream;
/** Whether we were just interrupted (or not) */
bool d_interrupted;
TNode lNode = d_cnfStream->getNode(l);
Debug("prop-explain") << "explainPropagation(" << lNode << ")" << std::endl;
- theory::TrustNode texp = d_theoryEngine->getExplanation(lNode);
- Node theoryExplanation = texp.getNode();
-
+ theory::TrustNode tte = d_theoryEngine->getExplanation(lNode);
+ Node theoryExplanation = tte.getNode();
+ if (CVC4::options::proofNew())
+ {
+ d_propEngine->getProofCnfStream()->convertPropagation(tte);
+ }
if (options::unsatCores())
{
ProofManager::getCnfProof()->pushCurrentAssertion(theoryExplanation);
}
-
Debug("prop-explain") << "explainPropagation() => " << theoryExplanation << std::endl;
- if (theoryExplanation.getKind() == kind::AND) {
- Node::const_iterator it = theoryExplanation.begin();
- Node::const_iterator it_end = theoryExplanation.end();
- explanation.push_back(l);
- for (; it != it_end; ++ it) {
- explanation.push_back(~d_cnfStream->getLiteral(*it));
+ explanation.push_back(l);
+ if (theoryExplanation.getKind() == kind::AND)
+ {
+ for (const Node& n : theoryExplanation)
+ {
+ explanation.push_back(~d_cnfStream->getLiteral(n));
}
- } else {
- explanation.push_back(l);
+ }
+ else
+ {
explanation.push_back(~d_cnfStream->getLiteral(theoryExplanation));
}
+ if (Trace.isOn("sat-proof"))
+ {
+ std::stringstream ss;
+ ss << "TheoryProxy::explainPropagation: clause for lit is ";
+ for (unsigned i = 0, size = explanation.size(); i < size; ++i)
+ {
+ ss << explanation[i] << " [" << d_cnfStream->getNode(explanation[i])
+ << "] ";
+ }
+ Trace("sat-proof") << ss.str() << "\n";
+ }
}
void TheoryProxy::enqueueTheoryLiteral(const SatLiteral& l) {