void TheoryEngine::finishInit()
{
+ Trace("theory") << "Begin TheoryEngine::finishInit" << std::endl;
// NOTE: This seems to be required since
// theory::TheoryTraits<THEORY>::isParametric cannot be accessed without
// using the CVC5_FOR_EACH_THEORY_STATEMENT macro. -AJR
// finish initializing the theory
t->finishInit();
}
+ Trace("theory") << "End TheoryEngine::finishInit" << std::endl;
}
ProofNodeManager* TheoryEngine::getProofNodeManager() const { return d_pnm; }
}
bool TheoryEngine::markPropagation(TNode assertion, TNode originalAssertion, theory::TheoryId toTheoryId, theory::TheoryId fromTheoryId) {
-
// What and where we are asserting
NodeTheoryPair toAssert(assertion, toTheoryId, d_propagationMapTimestamp);
// What and where it came from
void TheoryEngine::assertToTheory(TNode assertion, TNode originalAssertion, theory::TheoryId toTheoryId, theory::TheoryId fromTheoryId) {
-
Trace("theory::assertToTheory") << "TheoryEngine::assertToTheory(" << assertion << ", " << originalAssertion << "," << toTheoryId << ", " << fromTheoryId << ")" << endl;
Assert(toTheoryId != fromTheoryId);
const AtomRequests::Request& request = it.get();
Node toAssert =
polarity ? (Node)request.d_atom : request.d_atom.notNode();
- Debug("theory::atoms") << "TheoryEngine::assertFact(" << literal << "): sending requested " << toAssert << endl;
+ Debug("theory::atoms") << "TheoryEngine::assertFact(" << literal
+ << "): sending requested " << toAssert << endl;
assertToTheory(
toAssert, literal, request.d_toTheory, THEORY_SAT_SOLVER);
it.next();
}
bool TheoryEngine::propagate(TNode literal, theory::TheoryId theory) {
- Debug("theory::propagate") << "TheoryEngine::propagate(" << literal << ", " << theory << ")" << endl;
+ Debug("theory::propagate")
+ << "TheoryEngine::propagate(" << literal << ", " << theory << ")" << endl;
Trace("dtview::prop") << std::string(d_env.getContext()->getLevel(), ' ')
<< ":THEORY-PROP: " << literal << endl;
// Rewrite the equality
Node eqNormalized = Rewriter::rewrite(atoms[i]);
- Debug("theory::atoms") << "TheoryEngine::ensureLemmaAtoms(): " << eq << " with nf " << eqNormalized << endl;
+ Debug("theory::atoms") << "TheoryEngine::ensureLemmaAtoms(): " << eq
+ << " with nf " << eqNormalized << endl;
// If the equality is a boolean constant, we send immediately
if (eqNormalized.isConst()) {
// Do we need to check atoms
if (atomsTo != theory::THEORY_LAST) {
- Debug("theory::atoms") << "TheoryEngine::lemma(" << node << ", " << atomsTo << ")" << endl;
+ Debug("theory::atoms") << "TheoryEngine::lemma(" << node << ", " << atomsTo
+ << ")" << endl;
AtomsCollect collectAtoms;
NodeVisitor<AtomsCollect>::run(collectAtoms, node);
ensureLemmaAtoms(collectAtoms.getAtoms(), atomsTo);
d_lemmasAdded = true;
}
+void TheoryEngine::markInConflict()
+{
+#ifdef CVC5_FOR_EACH_THEORY_STATEMENT
+#undef CVC5_FOR_EACH_THEORY_STATEMENT
+#endif
+#define CVC5_FOR_EACH_THEORY_STATEMENT(THEORY) \
+ theoryOf(THEORY)->notifyInConflict();
+ CVC5_FOR_EACH_THEORY;
+ d_inConflict = true;
+}
+
void TheoryEngine::conflict(TrustNode tconflict, TheoryId theoryId)
{
Assert(tconflict.getKind() == TrustNodeKind::CONFLICT);
+
TNode conflict = tconflict.getNode();
- Trace("theory::conflict") << "TheoryEngine::conflict(" << conflict << ", "
+ Debug("theory::conflict") << "TheoryEngine::conflict(" << conflict << ", "
<< theoryId << ")" << endl;
Trace("te-proof-debug") << "Check closed conflict" << std::endl;
// doesn't require proof generator, yet, since THEORY_LEMMA is added below
Trace("dtview::conflict") << ":THEORY-CONFLICT: " << conflict << std::endl;
// Mark that we are in conflict
- d_inConflict = true;
+ markInConflict();
if(Dump.isOn("t-conflicts")) {
const Printer& printer = d_outMgr.getPrinter();
// pass the processed trust node
TrustNode tconf =
TrustNode::mkTrustConflict(fullConflict, d_lazyProof.get());
- Debug("theory::conflict") << "TheoryEngine::conflict(" << conflict << ", " << theoryId << "): full = " << fullConflict << endl;
+ Debug("theory::conflict")
+ << "TheoryEngine::conflict(" << conflict << ", " << theoryId
+ << "): full = " << fullConflict << endl;
Assert(properConflict(fullConflict));
Trace("te-proof-debug")
<< "Check closed conflict with sharing" << std::endl;
// If from the SAT solver, keep it
if (toExplain.d_theory == THEORY_SAT_SOLVER)
{
- Debug("theory::explain") << "\tLiteral came from THEORY_SAT_SOLVER. Kepping it." << endl;
+ Debug("theory::explain")
+ << "\tLiteral came from THEORY_SAT_SOLVER. Keeping it." << endl;
exp.insert(explanationVector[i++].d_node);
// it will be a free assumption in the proof
Trace("te-proof-exp") << "- keep " << toExplain.d_node << std::endl;
smt::currentResourceManager()->spendResource(id);
Trace("im") << "(conflict " << id << " " << tconf.getProven() << ")"
<< std::endl;
- d_theoryState.notifyInConflict();
d_out.trustedConflict(tconf);
++d_numConflicts;
}
{
d_factIdStats << iid;
smt::currentResourceManager()->spendResource(iid);
- Trace("im") << "(fact " << iid << " " << (pol ? Node(atom) : atom.notNode())
- << ")" << std::endl;
// make the node corresponding to the explanation
Node expn = NodeManager::currentNM()->mkAnd(exp);
+ Trace("im") << "(fact " << iid << " " << (pol ? Node(atom) : atom.notNode())
+ << " " << expn << ")" << std::endl;
// call the pre-notify fact method with preReg = false, isInternal = true
if (d_theory.preNotifyFact(atom, pol, expn, false, true))
{
}
Assert(d_ee != nullptr);
Trace("infer-manager") << "TheoryInferenceManager::assertInternalFact: "
+ << (pol ? Node(atom) : atom.notNode()) << " from "
<< expn << std::endl;
d_numCurrentFacts++;
// Now, assert the fact. How to do so depends on whether proofs are enabled.
d_out.setIncomplete(id);
}
+void TheoryInferenceManager::notifyInConflict()
+{
+ d_theoryState.notifyInConflict();
+}
+
} // namespace theory
} // namespace cvc5