Eliminates a style where proof node manager was passed as an argument to indicate proofs enabled if non-null. All theory inference managers now check Env::isTheoryProofProducing instead.
Since BV did not pass a proof node manager to its inference manager, this PR also incidentally enables equality engine proofs for BV.
InferenceManager::InferenceManager(Env& env,
TheoryArith& ta,
- ArithState& astate,
- ProofNodeManager* pnm)
- : InferenceManagerBuffered(env, ta, astate, pnm, "theory::arith::"),
+ ArithState& astate)
+ : InferenceManagerBuffered(env, ta, astate, "theory::arith::"),
// currently must track propagated literals if using the equality solver
d_trackPropLits(options().arith.arithEqSolver),
d_propLits(context())
using NodeSet = context::CDHashSet<Node>;
public:
- InferenceManager(Env& env,
- TheoryArith& ta,
- ArithState& astate,
- ProofNodeManager* pnm);
+ InferenceManager(Env& env, TheoryArith& ta, ArithState& astate);
/**
* Add a lemma as pending lemma to this inference manager.
d_ppRewriteTimer(
statisticsRegistry().registerTimer("theory::arith::ppRewriteTimer")),
d_astate(env, valuation),
- d_im(env, *this, d_astate, d_pnm),
+ d_im(env, *this, d_astate),
d_ppre(d_env),
d_bab(env, d_astate, d_im, d_ppre, d_pnm),
d_eqSolver(nullptr),
namespace theory {
namespace arrays {
-InferenceManager::InferenceManager(Env& env,
- Theory& t,
- TheoryState& state,
- ProofNodeManager* pnm)
- : TheoryInferenceManager(env, t, state, pnm, "theory::arrays::", false),
- d_lemmaPg(pnm ? new EagerProofGenerator(
- pnm, userContext(), "ArrayLemmaProofGenerator")
+InferenceManager::InferenceManager(Env& env, Theory& t, TheoryState& state)
+ : TheoryInferenceManager(env, t, state, "theory::arrays::", false),
+ d_lemmaPg(isProofEnabled()
+ ? new EagerProofGenerator(env.getProofNodeManager(),
+ userContext(),
+ "ArrayLemmaProofGenerator")
: nullptr)
{
}
class InferenceManager : public TheoryInferenceManager
{
public:
- InferenceManager(Env& env,
- Theory& t,
- TheoryState& state,
- ProofNodeManager* pnm);
+ InferenceManager(Env& env, Theory& t, TheoryState& state);
~InferenceManager() {}
/**
d_ppFacts(userContext()),
d_rewriter(env.getRewriter(), d_pnm),
d_state(env, valuation),
- d_im(env, *this, d_state, d_pnm),
+ d_im(env, *this, d_state),
d_literalsToPropagate(context()),
d_literalsToPropagateIndex(context(), 0),
d_isPreRegistered(context()),
namespace theory {
namespace bags {
-InferenceManager::InferenceManager(Env& env,
- Theory& t,
- SolverState& s,
- ProofNodeManager* pnm)
- : InferenceManagerBuffered(env, t, s, pnm, "theory::bags::"), d_state(s)
+InferenceManager::InferenceManager(Env& env, Theory& t, SolverState& s)
+ : InferenceManagerBuffered(env, t, s, "theory::bags::"), d_state(s)
{
d_true = NodeManager::currentNM()->mkConst(true);
d_false = NodeManager::currentNM()->mkConst(false);
typedef context::CDHashSet<Node> NodeSet;
public:
- InferenceManager(Env& env, Theory& t, SolverState& s, ProofNodeManager* pnm);
+ InferenceManager(Env& env, Theory& t, SolverState& s);
/**
* Do pending method. This processes all pending facts, lemmas and pending
TheoryBags::TheoryBags(Env& env, OutputChannel& out, Valuation valuation)
: Theory(THEORY_BAGS, env, out, valuation),
d_state(env, valuation),
- d_im(env, *this, d_state, d_pnm),
+ d_im(env, *this, d_state),
d_ig(&d_state, &d_im),
d_notify(*this, d_im),
d_statistics(),
: Theory(THEORY_BUILTIN, env, out, valuation),
d_checker(env),
d_state(env, valuation),
- d_im(env, *this, d_state, d_pnm, "theory::builtin::")
+ d_im(env, *this, d_state, "theory::builtin::")
{
// indicate we are using the default theory state and inference managers
d_theoryState = &d_state;
d_internal(nullptr),
d_rewriter(),
d_state(env, valuation),
- d_im(env, *this, d_state, nullptr, "theory::bv::"),
+ d_im(env, *this, d_state, "theory::bv::"),
d_notify(d_im),
d_invalidateModelCache(context(), true),
d_stats(statisticsRegistry(), "theory::bv::")
namespace theory {
namespace datatypes {
-InferenceManager::InferenceManager(Env& env,
- Theory& t,
- TheoryState& state,
- ProofNodeManager* pnm)
- : InferenceManagerBuffered(env, t, state, pnm, "theory::datatypes::"),
- d_pnm(pnm),
- d_ipc(pnm == nullptr ? nullptr : new InferProofCons(context(), pnm)),
- d_lemPg(pnm == nullptr ? nullptr
- : new EagerProofGenerator(
- pnm, userContext(), "datatypes::lemPg"))
+InferenceManager::InferenceManager(Env& env, Theory& t, TheoryState& state)
+ : InferenceManagerBuffered(env, t, state, "theory::datatypes::"),
+ d_ipc(isProofEnabled()
+ ? new InferProofCons(context(), env.getProofNodeManager())
+ : nullptr),
+ d_lemPg(isProofEnabled()
+ ? new EagerProofGenerator(env.getProofNodeManager(),
+ userContext(),
+ "datatypes::lemPg")
+ : nullptr)
{
d_false = NodeManager::currentNM()->mkConst(false);
}
conflictExp(id, conf, d_ipc.get());
}
-bool InferenceManager::isProofEnabled() const { return d_ipc != nullptr; }
-
TrustNode InferenceManager::processDtLemma(Node conc, Node exp, InferenceId id)
{
// set up a proof constructor
std::shared_ptr<InferProofCons> ipcl;
if (isProofEnabled())
{
- ipcl = std::make_shared<InferProofCons>(nullptr, d_pnm);
+ ipcl =
+ std::make_shared<InferProofCons>(nullptr, d_env.getProofNodeManager());
}
conc = prepareDtInference(conc, exp, id, ipcl.get());
// send it as a lemma
{
std::vector<Node> expv;
expv.push_back(exp);
- pn = d_pnm->mkScope(pbody, expv);
+ pn = d_env.getProofNodeManager()->mkScope(pbody, expv);
}
d_lemPg->setProofFor(lem, pn);
}
friend class DatatypesInference;
public:
- InferenceManager(Env& env,
- Theory& t,
- TheoryState& state,
- ProofNodeManager* pnm);
+ InferenceManager(Env& env, Theory& t, TheoryState& state);
~InferenceManager();
/**
* Add pending inference, which may be processed as either a fact or
void sendDtConflict(const std::vector<Node>& conf, InferenceId id);
private:
- /** Are proofs enabled? */
- bool isProofEnabled() const;
/**
* Process datatype inference as a lemma
*/
Node prepareDtInference(Node conc, Node exp, InferenceId id, InferProofCons* ipc);
/** The false node */
Node d_false;
- /** Pointer to the proof node manager */
- ProofNodeManager* d_pnm;
/** The inference to proof converter */
std::unique_ptr<InferProofCons> d_ipc;
/** An eager proof generator for lemmas */
d_sygusExtension(nullptr),
d_rewriter(env.getEvaluator()),
d_state(env, valuation),
- d_im(env, *this, d_state, d_pnm),
+ d_im(env, *this, d_state),
d_notify(d_im, *this)
{
d_abstractionMap(userContext()),
d_rewriter(userContext()),
d_state(env, valuation),
- d_im(env, *this, d_state, d_pnm, "theory::fp::", true),
+ d_im(env, *this, d_state, "theory::fp::", true),
d_wbFactsCache(userContext()),
d_true(d_env.getNodeManager()->mkConst(true))
{
InferenceManagerBuffered::InferenceManagerBuffered(Env& env,
Theory& t,
TheoryState& state,
- ProofNodeManager* pnm,
const std::string& statsName,
bool cacheLemmas)
- : TheoryInferenceManager(env, t, state, pnm, statsName, cacheLemmas),
+ : TheoryInferenceManager(env, t, state, statsName, cacheLemmas),
d_processingPendingLemmas(false)
{
}
InferenceManagerBuffered(Env& env,
Theory& t,
TheoryState& state,
- ProofNodeManager* pnm,
const std::string& statsName,
bool cacheLemmas = true);
virtual ~InferenceManagerBuffered() {}
QuantifiersState& qs,
QuantifiersInferenceManager& qim,
QuantifiersRegistry& qr,
- TermRegistry& tr,
- ProofNodeManager* pnm)
+ TermRegistry& tr)
: QuantifiersUtil(env),
d_qstate(qs),
d_qim(qim),
d_qreg(qr),
d_treg(tr),
- d_pnm(pnm),
d_insts(userContext()),
d_c_inst_match_trie_dom(userContext()),
- d_pfInst(pnm ? new CDProof(pnm, userContext(), "Instantiate::pfInst")
- : nullptr)
+ d_pfInst(isProofEnabled() ? new CDProof(env.getProofNodeManager(),
+ userContext(),
+ "Instantiate::pfInst")
+ : nullptr)
{
}
std::shared_ptr<LazyCDProof> pfTmp;
if (isProofEnabled())
{
- pfTmp.reset(new LazyCDProof(
- d_pnm, nullptr, nullptr, "Instantiate::LazyCDProof::tmp"));
+ pfTmp.reset(new LazyCDProof(d_env.getProofNodeManager(),
+ nullptr,
+ nullptr,
+ "Instantiate::LazyCDProof::tmp"));
}
// construct the instantiation
// make the scope proof to get (=> q body)
std::vector<Node> assumps;
assumps.push_back(q);
- std::shared_ptr<ProofNode> pfns = d_pnm->mkScope({pfn}, assumps);
+ std::shared_ptr<ProofNode> pfns =
+ d_env.getProofNodeManager()->mkScope({pfn}, assumps);
Assert(assumps.size() == 1 && assumps[0] == q);
// store in the main proof
d_pfInst->addProof(pfns);
}
}
-bool Instantiate::isProofEnabled() const { return d_pfInst != nullptr; }
+bool Instantiate::isProofEnabled() const
+{
+ return d_env.isTheoryProofProducing();
+}
void Instantiate::notifyEndRound()
{
QuantifiersState& qs,
QuantifiersInferenceManager& qim,
QuantifiersRegistry& qr,
- TermRegistry& tr,
- ProofNodeManager* pnm = nullptr);
+ TermRegistry& tr);
~Instantiate();
/** reset */
bool reset(Theory::Effort e) override;
QuantifiersRegistry& d_qreg;
/** Reference to the term registry */
TermRegistry& d_treg;
- /** pointer to the proof node manager */
- ProofNodeManager* d_pnm;
/** instantiation rewriter classes */
std::vector<InstantiationRewriter*> d_instRewrite;
Theory& t,
QuantifiersState& state,
QuantifiersRegistry& qr,
- TermRegistry& tr,
- ProofNodeManager* pnm)
- : InferenceManagerBuffered(env, t, state, pnm, "theory::quantifiers::"),
- d_instantiate(new Instantiate(env, state, *this, qr, tr, pnm)),
- d_skolemize(new Skolemize(env, state, tr, pnm))
+ TermRegistry& tr)
+ : InferenceManagerBuffered(env, t, state, "theory::quantifiers::"),
+ d_instantiate(new Instantiate(env, state, *this, qr, tr)),
+ d_skolemize(new Skolemize(env, state, tr))
{
}
Theory& t,
QuantifiersState& state,
QuantifiersRegistry& qr,
- TermRegistry& tr,
- ProofNodeManager* pnm);
+ TermRegistry& tr);
~QuantifiersInferenceManager();
/** get instantiate utility */
Instantiate* getInstantiate();
namespace theory {
namespace quantifiers {
-Skolemize::Skolemize(Env& env,
- QuantifiersState& qs,
- TermRegistry& tr,
- ProofNodeManager* pnm)
+Skolemize::Skolemize(Env& env, QuantifiersState& qs, TermRegistry& tr)
: EnvObj(env),
d_qstate(qs),
d_treg(tr),
d_skolemized(userContext()),
- d_pnm(pnm),
- d_epg(pnm == nullptr
+ d_epg(!isProofEnabled()
? nullptr
- : new EagerProofGenerator(pnm, userContext(), "Skolemize::epg"))
+ : new EagerProofGenerator(env.getProofNodeManager(),
+ userContext(),
+ "Skolemize::epg"))
{
}
}
}
-bool Skolemize::isProofEnabled() const { return d_epg != nullptr; }
+bool Skolemize::isProofEnabled() const
+{
+ return d_env.isTheoryProofProducing();
+}
} // namespace quantifiers
} // namespace theory
typedef context::CDHashMap<Node, Node> NodeNodeMap;
public:
- Skolemize(Env& env,
- QuantifiersState& qs,
- TermRegistry& tr,
- ProofNodeManager* pnm);
+ Skolemize(Env& env, QuantifiersState& qs, TermRegistry& tr);
~Skolemize() {}
/** skolemize quantified formula q
* If the return value ret of this function is non-null, then ret is a trust
d_qstate(env, valuation, logicInfo()),
d_qreg(env),
d_treg(env, d_qstate, d_qreg),
- d_qim(env, *this, d_qstate, d_qreg, d_treg, d_pnm),
+ d_qim(env, *this, d_qstate, d_qreg, d_treg),
d_qengine(nullptr)
{
// construct the quantifiers engine
d_lemmas_produced_c(userContext()),
d_bounds_init(false),
d_state(env, valuation),
- d_im(env, *this, d_state, d_pnm, "theory::sep::"),
+ d_im(env, *this, d_state, "theory::sep::"),
d_notify(*this),
d_reduce(userContext()),
d_spatial_assertions(context())
namespace theory {
namespace sets {
-InferenceManager::InferenceManager(Env& env,
- Theory& t,
- SolverState& s,
- ProofNodeManager* pnm)
- : InferenceManagerBuffered(env, t, s, pnm, "theory::sets::"), d_state(s)
+InferenceManager::InferenceManager(Env& env, Theory& t, SolverState& s)
+ : InferenceManagerBuffered(env, t, s, "theory::sets::"), d_state(s)
{
d_true = NodeManager::currentNM()->mkConst(true);
d_false = NodeManager::currentNM()->mkConst(false);
typedef context::CDHashSet<Node> NodeSet;
public:
- InferenceManager(Env& env, Theory& t, SolverState& s, ProofNodeManager* pnm);
+ InferenceManager(Env& env, Theory& t, SolverState& s);
/**
* Add facts corresponding to ( exp => fact ) via calls to the assertFact
* method of TheorySetsPrivate.
: Theory(THEORY_SETS, env, out, valuation),
d_skCache(),
d_state(env, valuation, d_skCache),
- d_im(env, *this, d_state, d_pnm),
+ d_im(env, *this, d_state),
d_internal(
new TheorySetsPrivate(env, *this, d_state, d_im, d_skCache, d_pnm)),
d_notify(*d_internal.get(), d_im)
SolverState& s,
TermRegistry& tr,
ExtTheory& e,
- SequencesStatistics& statistics,
- ProofNodeManager* pnm)
- : InferenceManagerBuffered(env, t, s, pnm, "theory::strings::", false),
+ SequencesStatistics& statistics)
+ : InferenceManagerBuffered(env, t, s, "theory::strings::", false),
d_state(s),
d_termReg(tr),
d_extt(e),
d_statistics(statistics),
- d_ipc(pnm ? new InferProofCons(context(), pnm, d_statistics) : nullptr),
- d_ipcl(pnm ? new InferProofCons(context(), pnm, d_statistics) : nullptr)
+ d_ipc(isProofEnabled()
+ ? new InferProofCons(
+ context(), env.getProofNodeManager(), d_statistics)
+ : nullptr),
+ d_ipcl(isProofEnabled()
+ ? new InferProofCons(
+ context(), env.getProofNodeManager(), d_statistics)
+ : nullptr)
{
NodeManager* nm = NodeManager::currentNM();
d_zero = nm->mkConst(Rational(0));
SolverState& s,
TermRegistry& tr,
ExtTheory& e,
- SequencesStatistics& statistics,
- ProofNodeManager* pnm);
+ SequencesStatistics& statistics);
~InferenceManager() {}
/**
d_eagerSolver(d_state),
d_termReg(env, d_state, d_statistics, d_pnm),
d_extTheoryCb(),
- d_im(env, *this, d_state, d_termReg, d_extTheory, d_statistics, d_pnm),
+ d_im(env, *this, d_state, d_termReg, d_extTheory, d_statistics),
d_extTheory(env, d_extTheoryCb, d_im),
d_rewriter(env.getRewriter(),
&d_statistics.d_rewrites,
TheoryInferenceManager::TheoryInferenceManager(Env& env,
Theory& t,
TheoryState& state,
- ProofNodeManager* pnm,
const std::string& statsName,
bool cacheLemmas)
: EnvObj(env),
d_ee(nullptr),
d_decManager(nullptr),
d_pfee(nullptr),
- d_pnm(pnm),
d_cacheLemmas(cacheLemmas),
d_keep(context()),
d_lemmasSent(userContext()),
// if it is non-null. If its proof equality engine has already been assigned,
// use it. This is to ensure that all theories use the same proof equality
// engine when in ee-mode=central.
- if (d_pnm != nullptr && d_ee != nullptr)
+ if (isProofEnabled() && d_ee != nullptr)
{
d_pfee = d_ee->getProofEqualityEngine();
if (d_pfee == nullptr)
d_decManager = dm;
}
-bool TheoryInferenceManager::isProofEnabled() const { return d_pnm != nullptr; }
+bool TheoryInferenceManager::isProofEnabled() const
+{
+ return d_env.isTheoryProofProducing();
+}
void TheoryInferenceManager::reset()
{
TheoryInferenceManager(Env& env,
Theory& t,
TheoryState& state,
- ProofNodeManager* pnm,
const std::string& statsName,
bool cacheLemmas = true);
virtual ~TheoryInferenceManager();
eq::ProofEqEngine* d_pfee;
/** The proof equality engine we allocated */
std::unique_ptr<eq::ProofEqEngine> d_pfeeAlloc;
- /** The proof node manager of the theory */
- ProofNodeManager* d_pnm;
/** Whether this manager caches lemmas */
bool d_cacheLemmas;
/**
d_symb(userContext(), instanceName),
d_rewriter(logicInfo().isHigherOrder()),
d_state(env, valuation),
- d_im(env, *this, d_state, d_pnm, "theory::uf::" + instanceName, false),
+ d_im(env, *this, d_state, "theory::uf::" + instanceName, false),
d_notify(d_im, *this)
{
d_true = NodeManager::currentNM()->mkConst( true );