Minor reorganization to make calls to theory engine from combination engine / shared solver more organized.
#include "prop/prop_engine.h"
#include "theory/care_graph.h"
#include "theory/model_manager.h"
+#include "theory/shared_solver.h"
#include "theory/theory_engine.h"
namespace cvc5 {
Node split = equality.orNode(equality.notNode());
tsplit = TrustNode::mkTrustLemma(split, nullptr);
}
- sendLemma(tsplit, carePair.d_theory);
+ d_sharedSolver->sendLemma(tsplit, carePair.d_theory);
// Could check the equality status here:
// EqualityStatus es = getEqualityStatus(carePair.d_a, carePair.d_b);
return nullptr;
}
-void CombinationEngine::sendLemma(TrustNode trn, TheoryId atomsTo)
-{
- d_te.lemma(trn, LemmaProperty::NONE, atomsTo);
-}
-
void CombinationEngine::resetRound()
{
// compute the relevant terms?
* who listens to the model's equality engine (if any).
*/
virtual eq::EqualityEngineNotify* getModelEqualityEngineNotify();
- /** Send lemma to the theory engine, atomsTo is the theory to send atoms to */
- void sendLemma(TrustNode trn, TheoryId atomsTo);
/** Reference to the theory engine */
TheoryEngine& d_te;
/** Reference to the environment */
d_logicInfo(te.getLogicInfo()),
d_sharedTerms(&d_te, d_te.getSatContext(), d_te.getUserContext(), pnm),
d_preRegistrationVisitor(&te, d_te.getSatContext()),
- d_sharedTermsVisitor(&te, d_sharedTerms, d_te.getSatContext())
+ d_sharedTermsVisitor(&te, d_sharedTerms, d_te.getSatContext()),
+ d_out(te.theoryOf(THEORY_BUILTIN)->getOutputChannel())
{
}
return EQUALITY_UNKNOWN;
}
-void SharedSolver::sendLemma(TrustNode trn, TheoryId atomsTo)
+bool SharedSolver::propagateLit(TNode predicate, bool value)
{
- d_te.lemma(trn, LemmaProperty::NONE, atomsTo);
+ if (value)
+ {
+ return d_out.propagate(predicate);
+ }
+ return d_out.propagate(predicate.notNode());
}
bool SharedSolver::propagateSharedEquality(theory::TheoryId theory,
bool SharedSolver::isShared(TNode t) const { return d_sharedTerms.isShared(t); }
+void SharedSolver::sendLemma(TrustNode trn, TheoryId atomsTo)
+{
+ d_te.lemma(trn, LemmaProperty::NONE, atomsTo);
+}
+
+void SharedSolver::sendConflict(TrustNode trn) { d_out.trustedConflict(trn); }
+
} // namespace theory
} // namespace cvc5
namespace theory {
struct EeSetupInfo;
+class OutputChannel;
/**
* A base class for shared solver. The shared solver is the component of theory
/** Is term t a shared term? */
virtual bool isShared(TNode t) const;
+ /**
+ * Propagate the predicate with polarity value on the output channel of this
+ * solver.
+ */
+ bool propagateLit(TNode predicate, bool value);
/**
* Method called by equalityEngine when a becomes (dis-)equal to b and a and b
* are shared with the theory. Returns false if there is a direct conflict
bool value);
/** Send lemma to the theory engine, atomsTo is the theory to send atoms to */
void sendLemma(TrustNode trn, TheoryId atomsTo);
+ /** Send conflict to the theory engine */
+ void sendConflict(TrustNode trn);
protected:
/** Solver-specific pre-register shared */
PreRegisterVisitor d_preRegistrationVisitor;
/** Visitor for collecting shared terms */
SharedTermsVisitor d_sharedTermsVisitor;
+ /** Output channel of theory builtin */
+ OutputChannel& d_out;
};
} // namespace theory