This PR uses the IntegralHistogramStat to obtain statistics about the sent inferences within the TheoryInferenceManager. All theories are adapted to provide a proper name (prefix) for the name of the statistic.
InferenceManager::InferenceManager(TheoryArith& ta,
ArithState& astate,
ProofNodeManager* pnm)
- : InferenceManagerBuffered(ta, astate, pnm)
+ : InferenceManagerBuffered(ta, astate, pnm, "theory::arith")
{
}
InferenceManager::InferenceManager(Theory& t,
TheoryState& state,
ProofNodeManager* pnm)
- : TheoryInferenceManager(t, state, pnm),
- d_lemmaPg(pnm ? new EagerProofGenerator(pnm,
- state.getUserContext(),
- "ArrayLemmaProofGenerator")
+ : TheoryInferenceManager(t, state, pnm, "theory::arrays"),
+ d_lemmaPg(pnm ? new EagerProofGenerator(
+ pnm, state.getUserContext(), "ArrayLemmaProofGenerator")
: nullptr)
{
}
InferenceManager::InferenceManager(Theory& t,
SolverState& s,
ProofNodeManager* pnm)
- : InferenceManagerBuffered(t, s, pnm), d_state(s)
+ : InferenceManagerBuffered(t, s, pnm, "theory::bags"), d_state(s)
{
d_true = NodeManager::currentNM()->mkConst(true);
d_false = NodeManager::currentNM()->mkConst(false);
d_ufRemByZero(),
d_rewriter(),
d_state(c, u, valuation),
- d_im(*this, d_state, nullptr),
+ d_im(*this, d_state, nullptr, "theory::bv"),
d_notify(d_im)
{
switch (options::bvSolver())
InferenceManager::InferenceManager(Theory& t,
TheoryState& state,
ProofNodeManager* pnm)
- : InferenceManagerBuffered(t, state, pnm),
+ : InferenceManagerBuffered(t, state, pnm, "theory::datatypes"),
d_inferenceLemmas("theory::datatypes::inferenceLemmas"),
d_inferenceFacts("theory::datatypes::inferenceFacts"),
d_inferenceConflicts("theory::datatypes::inferenceConflicts"),
d_lemPg(pnm == nullptr
? nullptr
: new EagerProofGenerator(
- pnm, state.getUserContext(), "datatypes::lemPg"))
+ pnm, state.getUserContext(), "datatypes::lemPg"))
{
d_false = NodeManager::currentNM()->mkConst(false);
smtStatisticsRegistry()->registerStat(&d_inferenceLemmas);
InferenceManagerBuffered::InferenceManagerBuffered(Theory& t,
TheoryState& state,
- ProofNodeManager* pnm)
- : TheoryInferenceManager(t, state, pnm), d_processingPendingLemmas(false)
+ ProofNodeManager* pnm,
+ const std::string& name)
+ : TheoryInferenceManager(t, state, pnm, name),
+ d_processingPendingLemmas(false)
{
}
public:
InferenceManagerBuffered(Theory& t,
TheoryState& state,
- ProofNodeManager* pnm);
+ ProofNodeManager* pnm,
+ const std::string& name);
virtual ~InferenceManagerBuffered() {}
/**
* Do we have a pending fact or lemma?
QuantifiersInferenceManager::QuantifiersInferenceManager(
Theory& t, QuantifiersState& state, ProofNodeManager* pnm)
- : InferenceManagerBuffered(t, state, pnm)
+ : InferenceManagerBuffered(t, state, pnm, "theory::quantifiers")
{
}
d_lemmas_produced_c(u),
d_bounds_init(false),
d_state(c, u, valuation),
- d_im(*this, d_state, nullptr),
+ d_im(*this, d_state, nullptr, "theory::sep"),
d_notify(*this),
d_reduce(u),
d_spatial_assertions(c)
InferenceManager::InferenceManager(Theory& t,
SolverState& s,
ProofNodeManager* pnm)
- : InferenceManagerBuffered(t, s, pnm), d_state(s)
+ : InferenceManagerBuffered(t, s, pnm, "theory::sets"), d_state(s)
{
d_true = NodeManager::currentNM()->mkConst(true);
d_false = NodeManager::currentNM()->mkConst(false);
ExtTheory& e,
SequencesStatistics& statistics,
ProofNodeManager* pnm)
- : InferenceManagerBuffered(t, s, pnm),
+ : InferenceManagerBuffered(t, s, pnm, "theory::strings"),
d_state(s),
d_termReg(tr),
d_extt(e),
#include "theory/theory_inference_manager.h"
+#include "smt/smt_statistics_registry.h"
#include "theory/theory.h"
#include "theory/uf/equality_engine.h"
TheoryInferenceManager::TheoryInferenceManager(Theory& t,
TheoryState& state,
- ProofNodeManager* pnm)
+ ProofNodeManager* pnm,
+ const std::string& name)
: d_theory(t),
d_theoryState(state),
d_out(t.getOutputChannel()),
d_lemmasSent(t.getUserContext()),
d_numConflicts(0),
d_numCurrentLemmas(0),
- d_numCurrentFacts(0)
+ d_numCurrentFacts(0),
+ d_conflictIdStats(name + "::inferencesConflict"),
+ d_factIdStats(name + "::inferencesFact"),
+ d_lemmaIdStats(name + "::inferencesLemma")
{
// don't add true lemma
Node truen = NodeManager::currentNM()->mkConst(true);
d_lemmasSent.insert(truen);
+ smtStatisticsRegistry()->registerStat(&d_conflictIdStats);
+ smtStatisticsRegistry()->registerStat(&d_factIdStats);
+ smtStatisticsRegistry()->registerStat(&d_lemmaIdStats);
+}
+
+TheoryInferenceManager::~TheoryInferenceManager()
+{
+ smtStatisticsRegistry()->unregisterStat(&d_conflictIdStats);
+ smtStatisticsRegistry()->unregisterStat(&d_factIdStats);
+ smtStatisticsRegistry()->unregisterStat(&d_lemmaIdStats);
}
void TheoryInferenceManager::setEqualityEngine(eq::EqualityEngine* ee)
{
if (!d_theoryState.isInConflict())
{
+ d_conflictIdStats << id;
d_theoryState.notifyInConflict();
d_out.conflict(conf);
++d_numConflicts;
{
if (!d_theoryState.isInConflict())
{
+ d_conflictIdStats << id;
d_theoryState.notifyInConflict();
d_out.trustedConflict(tconf);
}
return false;
}
}
+ d_lemmaIdStats << id;
d_numCurrentLemmas++;
d_out.trustedLemma(tlem, p);
return true;
InferenceId id,
TNode exp)
{
+ d_factIdStats << id;
return processInternalFact(atom, pol, PfRule::UNKNOWN, {exp}, {}, nullptr);
}
const std::vector<Node>& args)
{
Assert(pfr != PfRule::UNKNOWN);
+ d_factIdStats << id;
return processInternalFact(atom, pol, pfr, exp, args, nullptr);
}
ProofGenerator* pg)
{
Assert(pg != nullptr);
+ d_factIdStats << id;
return processInternalFact(atom, pol, PfRule::ASSUME, exp, {}, pg);
}
/**
* Constructor, note that state should be the official state of theory t.
*/
- TheoryInferenceManager(Theory& t, TheoryState& state, ProofNodeManager* pnm);
- virtual ~TheoryInferenceManager() {}
+ TheoryInferenceManager(Theory& t,
+ TheoryState& state,
+ ProofNodeManager* pnm,
+ const std::string& name);
+ virtual ~TheoryInferenceManager();
/**
* Set equality engine, ee is a pointer to the official equality engine
* of theory.
uint32_t d_numCurrentLemmas;
/** The number of internal facts added since the last call to reset. */
uint32_t d_numCurrentFacts;
+ /** Statistics for conflicts sent via this inference manager. */
+ IntegralHistogramStat<InferenceId> d_conflictIdStats;
+ /** Statistics for facts sent via this inference manager. */
+ IntegralHistogramStat<InferenceId> d_factIdStats;
+ /** Statistics for lemmas sent via this inference manager. */
+ IntegralHistogramStat<InferenceId> d_lemmaIdStats;
};
} // namespace theory
d_functionsTerms(c),
d_symb(u, instanceName),
d_state(c, u, valuation),
- d_im(*this, d_state, pnm),
+ d_im(*this, d_state, pnm, "theory::uf"),
d_notify(d_im, *this)
{
d_true = NodeManager::currentNM()->mkConst( true );