Makes combination engine proof producing (for Boolean splits). Followup PRs will start to add proof production in TheoryEngine.
namespace theory {
CombinationCareGraph::CombinationCareGraph(
- TheoryEngine& te, const std::vector<Theory*>& paraTheories)
- : CombinationEngine(te, paraTheories)
+ TheoryEngine& te,
+ const std::vector<Theory*>& paraTheories,
+ ProofNodeManager* pnm)
+ : CombinationEngine(te, paraTheories, pnm)
{
}
<< "TheoryEngine::combineTheories(): requesting a split " << std::endl;
Node split = equality.orNode(equality.notNode());
- sendLemma(split, carePair.d_theory);
+ TrustNode tsplit;
+ if (isProofEnabled())
+ {
+ // make proof of splitting lemma
+ tsplit = d_cmbsPg->mkTrustNode(split, PfRule::SPLIT, {equality});
+ }
+ else
+ {
+ tsplit = TrustNode::mkTrustLemma(split, nullptr);
+ }
+ sendLemma(tsplit, carePair.d_theory);
// Could check the equality status here:
// EqualityStatus es = getEqualityStatus(carePair.d_a, carePair.d_b);
{
public:
CombinationCareGraph(TheoryEngine& te,
- const std::vector<Theory*>& paraTheories);
+ const std::vector<Theory*>& paraTheories,
+ ProofNodeManager* pnm);
~CombinationCareGraph();
bool buildModel() override;
namespace theory {
CombinationEngine::CombinationEngine(TheoryEngine& te,
- const std::vector<Theory*>& paraTheories)
+ const std::vector<Theory*>& paraTheories,
+ ProofNodeManager* pnm)
: d_te(te),
d_logicInfo(te.getLogicInfo()),
d_paraTheories(paraTheories),
d_eemanager(nullptr),
- d_mmanager(nullptr)
+ d_mmanager(nullptr),
+ d_cmbsPg(pnm ? new EagerProofGenerator(pnm, te.getUserContext())
+ : nullptr)
{
}
return d_mmanager->getModel();
}
+bool CombinationEngine::isProofEnabled() const { return d_cmbsPg != nullptr; }
+
eq::EqualityEngineNotify* CombinationEngine::getModelEqualityEngineNotify()
{
// by default, no notifications from model's equality engine
return nullptr;
}
-void CombinationEngine::sendLemma(TNode node, TheoryId atomsTo)
+void CombinationEngine::sendLemma(TrustNode trn, TheoryId atomsTo)
{
- d_te.lemma(node, RULE_INVALID, false, LemmaProperty::NONE, atomsTo);
+ d_te.lemma(trn.getNode(), RULE_INVALID, false, LemmaProperty::NONE, atomsTo);
}
void CombinationEngine::resetRound()
#include <vector>
#include <memory>
+#include "theory/eager_proof_generator.h"
#include "theory/ee_manager.h"
#include "theory/model_manager.h"
class CombinationEngine
{
public:
- CombinationEngine(TheoryEngine& te, const std::vector<Theory*>& paraTheories);
+ CombinationEngine(TheoryEngine& te,
+ const std::vector<Theory*>& paraTheories,
+ ProofNodeManager* pnm);
virtual ~CombinationEngine();
/** Finish initialization */
virtual void combineTheories() = 0;
protected:
+ /** Is proof enabled? */
+ bool isProofEnabled() const;
/**
* Get model equality engine notify. Return the notification object for
* 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(TNode node, TheoryId atomsTo);
+ void sendLemma(TrustNode trn, TheoryId atomsTo);
/** Reference to the theory engine */
TheoryEngine& d_te;
/** Logic info of theory engine (cached) */
* model.
*/
std::unique_ptr<ModelManager> d_mmanager;
+ /**
+ * An eager proof generator, if proofs are enabled. This proof generator is
+ * responsible for proofs of splitting lemmas generated in combineTheories.
+ */
+ std::unique_ptr<EagerProofGenerator> d_cmbsPg;
};
} // namespace theory
// Initialize the theory combination architecture
if (options::tcMode() == options::TcMode::CARE_GRAPH)
{
- d_tc.reset(new CombinationCareGraph(*this, paraTheories));
+ d_tc.reset(new CombinationCareGraph(*this, paraTheories, d_pnm));
}
else
{
d_context(context),
d_userContext(userContext),
d_logicInfo(logicInfo),
+ d_pnm(nullptr),
d_sharedTerms(this, context),
d_tc(nullptr),
d_quantEngine(nullptr),
*/
const LogicInfo& d_logicInfo;
+ //--------------------------------- new proofs
+ /** Proof node manager used by this theory engine, if proofs are enabled */
+ ProofNodeManager* d_pnm;
+ //--------------------------------- end new proofs
+
/**
* The database of shared terms.
*/