This PR refactors the ExtTheory class to use a given inference manager instead of a given output channel.
d_extTheory(d_extTheoryCb,
containing.getSatContext(),
containing.getUserContext(),
- containing.getOutputChannel()),
+ d_im),
d_model(containing.getSatContext()),
d_trSlv(d_im, d_model, pnm, containing.getUserContext()),
d_extState(d_im, d_model, pnm, containing.getUserContext()),
ExtTheory::ExtTheory(ExtTheoryCallback& p,
context::Context* c,
context::UserContext* u,
- OutputChannel& out)
+ TheoryInferenceManager& im)
: d_parent(p),
- d_out(out),
+ d_im(im),
d_ext_func_terms(c),
d_extfExtReducedIdMap(c),
d_ci_inactive(u),
if (!nr.isNull() && n != nr)
{
Node lem = NodeManager::currentNM()->mkNode(kind::EQUAL, n, nr);
- if (sendLemma(lem, true))
+ if (sendLemma(lem, InferenceId::EXTT_SIMPLIFY, true))
{
Trace("extt-lemma")
<< "ExtTheory : reduction lemma : " << lem << std::endl;
Trace("extt-debug") << "ExtTheory::doInferences : infer : " << eq
<< " by " << exp[i] << std::endl;
Trace("extt-debug") << "...send lemma " << lem << std::endl;
- if (sendLemma(lem))
+ if (sendLemma(lem, InferenceId::EXTT_SIMPLIFY))
{
Trace("extt-lemma")
<< "ExtTheory : substitution + rewrite lemma : " << lem
return false;
}
-bool ExtTheory::sendLemma(Node lem, bool preprocess)
+bool ExtTheory::sendLemma(Node lem, InferenceId id, bool preprocess)
{
if (preprocess)
{
if (d_pp_lemmas.find(lem) == d_pp_lemmas.end())
{
d_pp_lemmas.insert(lem);
- d_out.lemma(lem);
+ d_im.lemma(lem, id);
return true;
}
}
if (d_lemmas.find(lem) == d_lemmas.end())
{
d_lemmas.insert(lem);
- d_out.lemma(lem);
+ d_im.lemma(lem, id);
return true;
}
}
#include "context/cdo.h"
#include "context/context.h"
#include "expr/node.h"
+#include "theory/theory_inference_manager.h"
namespace cvc5 {
namespace theory {
ExtTheory(ExtTheoryCallback& p,
context::Context* c,
context::UserContext* u,
- OutputChannel& out);
+ TheoryInferenceManager& im);
virtual ~ExtTheory() {}
/** Tells this class to treat terms with Kind k as extended functions */
void addFunctionKind(Kind k) { d_extf_kind[k] = true; }
bool batch,
bool isRed);
/** send lemma on the output channel */
- bool sendLemma(Node lem, bool preprocess = false);
+ bool sendLemma(Node lem, InferenceId id, bool preprocess = false);
/** reference to the callback */
ExtTheoryCallback& d_parent;
- /** Reference to the output channel we are using */
- OutputChannel& d_out;
+ /** inference manager used to send lemmas */
+ TheoryInferenceManager& d_im;
/** the true node */
Node d_true;
/** extended function terms, map to whether they are active */
{
case InferenceId::EQ_CONSTANT_MERGE: return "EQ_CONSTANT_MERGE";
case InferenceId::COMBINATION_SPLIT: return "COMBINATION_SPLIT";
+ case InferenceId::EXTT_SIMPLIFY: return "EXTT_SIMPLIFY";
case InferenceId::ARITH_BLACK_BOX: return "ARITH_BLACK_BOX";
case InferenceId::ARITH_CONF_EQ: return "ARITH_CONF_EQ";
case InferenceId::ARITH_CONF_LOWER: return "ARITH_CONF_LOWER";
EQ_CONSTANT_MERGE,
// a split from theory combination
COMBINATION_SPLIT,
+ // ---------------------------------- ext theory
+ // a simplification from the extended theory utility
+ EXTT_SIMPLIFY,
// ---------------------------------- arith theory
//-------------------- linear core
// black box conflicts. It's magic.
d_eagerSolver(d_state),
d_termReg(d_state, d_statistics, d_pnm),
d_extTheoryCb(),
- d_extTheory(d_extTheoryCb, getSatContext(), getUserContext(), out),
d_im(*this, d_state, d_termReg, d_extTheory, d_statistics, d_pnm),
+ d_extTheory(d_extTheoryCb, getSatContext(), getUserContext(), d_im),
d_rewriter(&d_statistics.d_rewrites),
d_bsolver(d_state, d_im),
d_csolver(d_state, d_im, d_termReg, d_bsolver),
TermRegistry d_termReg;
/** The extended theory callback */
StringsExtfCallback d_extTheoryCb;
- /** Extended theory, responsible for context-dependent simplification. */
- ExtTheory d_extTheory;
/** The (custom) output channel of the theory of strings */
InferenceManager d_im;
+ /** Extended theory, responsible for context-dependent simplification. */
+ ExtTheory d_extTheory;
/** The theory rewriter for this theory. */
StringsRewriter d_rewriter;
/** The proof rule checker */