This further renames EnvObj::getLogicInfo to EnvObj::logicInfo.
Ackermann::Ackermann(PreprocessingPassContext* preprocContext)
: PreprocessingPass(preprocContext, "ackermann"),
- d_funcToSkolem(preprocContext->getUserContext()),
- d_usVarsToBVVars(preprocContext->getUserContext()),
- d_logic(preprocContext->getLogicInfo())
+ d_funcToSkolem(userContext()),
+ d_usVarsToBVVars(userContext()),
+ d_logic(logicInfo())
{
}
BVToInt::BVToInt(PreprocessingPassContext* preprocContext)
: PreprocessingPass(preprocContext, "bv-to-int"),
- d_binarizeCache(preprocContext->getUserContext()),
- d_eliminationCache(preprocContext->getUserContext()),
- d_rebuildCache(preprocContext->getUserContext()),
- d_bvToIntCache(preprocContext->getUserContext()),
- d_rangeAssertions(preprocContext->getUserContext())
+ d_binarizeCache(userContext()),
+ d_eliminationCache(userContext()),
+ d_rebuildCache(userContext()),
+ d_bvToIntCache(userContext()),
+ d_rangeAssertions(userContext())
{
d_nm = NodeManager::currentNM();
d_zero = d_nm->mkConst<Rational>(0);
namespace passes {
using namespace cvc5::theory;
-ForeignTheoryRewrite::ForeignTheoryRewrite(PreprocessingPassContext* preprocContext)
+ForeignTheoryRewrite::ForeignTheoryRewrite(
+ PreprocessingPassContext* preprocContext)
: PreprocessingPass(preprocContext, "foreign-theory-rewrite"),
- d_cache(preprocContext->getUserContext()){};
+ d_cache(userContext()){};
Node ForeignTheoryRewrite::simplify(Node n)
{
: PreprocessingPass(preprocContext, "fun-def-fmf"),
d_fmfRecFunctionsDefined(nullptr)
{
- d_fmfRecFunctionsDefined =
- new (true) NodeList(preprocContext->getUserContext());
+ d_fmfRecFunctionsDefined = new (true) NodeList(userContext());
}
FunDefFmf::~FunDefFmf() { d_fmfRecFunctionsDefined->deleteSelf(); }
}
// Do theory specific preprocessing passes
- if (d_env.getLogicInfo().isTheoryEnabled(theory::THEORY_ARITH)
+ if (logicInfo().isTheoryEnabled(theory::THEORY_ARITH)
&& !options::incrementalSolving())
{
if (!simpDidALotOfWork)
{
util::ContainsTermITEVisitor& contains =
*(d_iteUtilities.getContainsVisitor());
- arith::ArithIteUtils aiteu(contains,
- d_preprocContext->getUserContext(),
- d_preprocContext->getTopLevelSubstitutions().get());
+ arith::ArithIteUtils aiteu(
+ contains,
+ userContext(),
+ d_preprocContext->getTopLevelSubstitutions().get());
bool anyItes = false;
for (size_t i = 0, size = assertionsToPreprocess->size(); i < size; ++i)
{
: PreprocessingPass(preprocContext, "non-clausal-simp"),
d_pnm(preprocContext->getProofNodeManager()),
d_llpg(d_pnm ? new smt::PreprocessProofGenerator(
- d_pnm,
- preprocContext->getUserContext(),
- "NonClausalSimp::llpg")
+ d_pnm, userContext(), "NonClausalSimp::llpg")
: nullptr),
- d_llra(d_pnm ? new LazyCDProof(d_pnm,
- nullptr,
- preprocContext->getUserContext(),
- "NonClausalSimp::llra")
+ d_llra(d_pnm ? new LazyCDProof(
+ d_pnm, nullptr, userContext(), "NonClausalSimp::llra")
: nullptr),
- d_tsubsList(preprocContext->getUserContext())
+ d_tsubsList(userContext())
{
}
Trace("non-clausal-simplify") << "asserting to propagator" << std::endl;
for (size_t i = 0, size = assertionsToPreprocess->size(); i < size; ++i)
{
- Assert(Rewriter::rewrite((*assertionsToPreprocess)[i])
+ Assert(rewrite((*assertionsToPreprocess)[i])
== (*assertionsToPreprocess)[i]);
// Don't reprocess substitutions
if (assertionsToPreprocess->isSubstsIndex(i))
<< "Iterate through " << propagator->getLearnedLiterals().size()
<< " learned literals." << std::endl;
// No conflict, go through the literals and solve them
- context::Context* u = d_preprocContext->getUserContext();
+ context::Context* u = userContext();
TrustSubstitutionMap& ttls = d_preprocContext->getTopLevelSubstitutions();
CVC5_UNUSED SubstitutionMap& top_level_substs = ttls.get();
// constant propagations
{
// Simplify the literal we learned wrt previous substitutions
Node learnedLiteral = learned_literals[i].getNode();
- Assert(Rewriter::rewrite(learnedLiteral) == learnedLiteral);
+ Assert(rewrite(learnedLiteral) == learnedLiteral);
Assert(top_level_substs.apply(learnedLiteral) == learnedLiteral);
// process the learned literal with substitutions and const propagations
learnedLiteral = processLearnedLit(
// The literal should rewrite to true
Trace("non-clausal-simplify")
<< "solved " << learnedLiteral << std::endl;
- Assert(Rewriter::rewrite(nss.apply(learnedLiteral)).isConst());
+ Assert(rewrite(nss.apply(learnedLiteral)).isConst());
// else fall through
break;
}
for (SubstitutionMap::iterator pos = cps.begin(); pos != cps.end(); ++pos)
{
Assert((*pos).second.isConst());
- Assert(Rewriter::rewrite((*pos).first) == (*pos).first);
+ Assert(rewrite((*pos).first) == (*pos).first);
Assert(cps.apply((*pos).second) == (*pos).second);
}
#endif /* CVC5_ASSERTIONS */
<< "assertionNew = " << assertionNew.getNode() << std::endl;
assertionsToPreprocess->replaceTrusted(i, assertionNew);
assertion = assertionNew.getNode();
- Assert(Rewriter::rewrite(assertion) == assertion);
+ Assert(rewrite(assertion) == assertion);
}
for (;;)
{
PseudoBooleanProcessor::PseudoBooleanProcessor(
PreprocessingPassContext* preprocContext)
: PreprocessingPass(preprocContext, "pseudo-boolean-processor"),
- d_pbBounds(preprocContext->getUserContext()),
- d_subCache(preprocContext->getUserContext()),
- d_pbs(preprocContext->getUserContext(), 0)
+ d_pbBounds(userContext()),
+ d_subCache(userContext()),
+ d_pbs(userContext(), 0)
{
}
namespace passes {
RealToInt::RealToInt(PreprocessingPassContext* preprocContext)
- : PreprocessingPass(preprocContext, "real-to-int"),
- d_cache(preprocContext->getUserContext())
+ : PreprocessingPass(preprocContext, "real-to-int"), d_cache(userContext())
{
}
// make a separate smt call
std::unique_ptr<SmtEngine> rrSygus;
- theory::initializeSubsolver(rrSygus,
- d_preprocContext->getOptions(),
- d_preprocContext->getLogicInfo());
+ theory::initializeSubsolver(rrSygus, options(), logicInfo());
rrSygus->assertFormula(body);
Trace("sygus-infer") << "*** Check sat..." << std::endl;
Result r = rrSygus->checkSat();
: PreprocessingPass(preprocContext, "unconstrained-simplifier"),
d_numUnconstrainedElim(smtStatisticsRegistry().registerInt(
"preprocessor::number of unconstrained elims")),
- d_context(preprocContext->getDecisionContext()),
- d_substitutions(preprocContext->getDecisionContext())
+ d_context(context()),
+ d_substitutions(context())
{
}
// Uninterpreted function - if domain is infinite, no quantifiers are
// used, and any child is unconstrained, result is unconstrained
case kind::APPLY_UF:
- if (d_preprocContext->getLogicInfo().isQuantified()
+ if (logicInfo().isQuantified()
|| !current.getType().getCardinality().isInfinite())
{
break;
: EnvObj(env),
d_smt(smt),
d_circuitPropagator(circuitPropagator),
- d_llm(env.getTopLevelSubstitutions(),
- env.getUserContext(),
- env.getProofNodeManager()),
- d_symsInAssertions(env.getUserContext())
+ d_llm(
+ env.getTopLevelSubstitutions(), userContext(), getProofNodeManager()),
+ d_symsInAssertions(userContext())
{
}
-const Options& PreprocessingPassContext::getOptions() const
-{
- return d_env.getOptions();
-}
-const LogicInfo& PreprocessingPassContext::getLogicInfo() const
-{
- return d_env.getLogicInfo();
-}
theory::TrustSubstitutionMap&
PreprocessingPassContext::getTopLevelSubstitutions() const
{
return d_smt->getPropEngine();
}
-context::Context* PreprocessingPassContext::getUserContext() const
-{
- return d_env.getUserContext();
-}
-context::Context* PreprocessingPassContext::getDecisionContext() const
-{
- return d_env.getContext();
-}
+
void PreprocessingPassContext::spendResource(Resource r)
{
d_env.getResourceManager()->spendResource(r);
TheoryEngine* getTheoryEngine() const;
/** Get the associated Propengine. */
prop::PropEngine* getPropEngine() const;
- /** Get the current user context. */
- context::Context* getUserContext() const;
- /** Get the current decision context. */
- context::Context* getDecisionContext() const;
/** Get the associated circuit propagator. */
theory::booleans::CircuitPropagator* getCircuitPropagator() const
/** Spend resource in the resource manager of the associated Env. */
void spendResource(Resource r);
- /** Get the options of the environment */
- const Options& getOptions() const;
- /** Get the current logic info of the environment */
- const LogicInfo& getLogicInfo() const;
-
/** Get a reference to the top-level substitution map */
theory::TrustSubstitutionMap& getTopLevelSubstitutions() const;
Node EnvObj::rewrite(TNode node) { return d_env.getRewriter()->rewrite(node); }
-const LogicInfo& EnvObj::getLogicInfo() const { return d_env.getLogicInfo(); }
+const LogicInfo& EnvObj::logicInfo() const { return d_env.getLogicInfo(); }
+
+const Options& EnvObj::options() const { return d_env.getOptions(); }
+
+context::Context* EnvObj::context() const { return d_env.getContext(); }
+
+context::UserContext* EnvObj::userContext() const
+{
+ return d_env.getUserContext();
+}
} // namespace cvc5
class NodeManager;
class Options;
+namespace context {
+class Context;
+class UserContext;
+} // namespace context
+
class EnvObj
{
protected:
Node rewrite(TNode node);
/** Get the current logic information. */
- const LogicInfo& getLogicInfo() const;
+ const LogicInfo& logicInfo() const;
+
+ /** Get the options object (const version only) via Env. */
+ const Options& options() const;
+
+ /** Get a pointer to the Context via Env. */
+ context::Context* context() const;
+
+ /** Get a pointer to the UserContext via Env. */
+ context::UserContext* userContext() const;
/** The associated environment. */
Env& d_env;
d_eqSolver(nullptr),
d_internal(new TheoryArithPrivate(*this, env, d_bab)),
d_nonlinearExtension(nullptr),
- d_opElim(d_pnm, getLogicInfo()),
+ d_opElim(d_pnm, logicInfo()),
d_arithPreproc(d_astate, d_im, d_pnm, d_opElim),
d_rewriter(d_opElim)
{
}
void TheoryArith::finishInit()
{
- if (getLogicInfo().isTheoryEnabled(THEORY_ARITH)
- && getLogicInfo().areTranscendentalsUsed())
+ const LogicInfo& logic = logicInfo();
+ if (logic.isTheoryEnabled(THEORY_ARITH) && logic.areTranscendentalsUsed())
{
// witness is used to eliminate square root
d_valuation.setUnevaluatedKind(kind::WITNESS);
d_valuation.setUnevaluatedKind(kind::PI);
}
// only need to create nonlinear extension if non-linear logic
- const LogicInfo& logicInfo = getLogicInfo();
- if (logicInfo.isTheoryEnabled(THEORY_ARITH) && !logicInfo.isLinear())
+ if (logic.isTheoryEnabled(THEORY_ARITH) && !logic.isLinear())
{
d_nonlinearExtension.reset(new nl::NonlinearExtension(*this, d_astate));
}
d_pnm(d_env.isTheoryProofProducing() ? d_env.getProofNodeManager()
: nullptr),
d_checker(),
- d_pfGen(new EagerProofGenerator(d_pnm, d_env.getUserContext())),
- d_constraintDatabase(d_env.getContext(),
- d_env.getUserContext(),
+ d_pfGen(new EagerProofGenerator(d_pnm, userContext())),
+ d_constraintDatabase(context(),
+ userContext(),
d_partialModel,
d_congruenceManager,
RaiseConflict(*this),
d_qflraStatus(Result::SAT_UNKNOWN),
d_unknownsInARow(0),
d_hasDoneWorkSinceCut(false),
- d_learner(d_env.getUserContext()),
- d_assertionsThatDoNotMatchTheirLiterals(d_env.getContext()),
+ d_learner(userContext()),
+ d_assertionsThatDoNotMatchTheirLiterals(context()),
d_nextIntegerCheckVar(0),
- d_constantIntegerVariables(d_env.getContext()),
- d_diseqQueue(d_env.getContext(), false),
+ d_constantIntegerVariables(context()),
+ d_diseqQueue(context(), false),
d_currentPropagationList(),
- d_learnedBounds(d_env.getContext()),
- d_preregisteredNodes(d_env.getContext()),
- d_partialModel(d_env.getContext(), DeltaComputeCallback(*this)),
+ d_learnedBounds(context()),
+ d_preregisteredNodes(context()),
+ d_partialModel(context(), DeltaComputeCallback(*this)),
d_errorSet(
d_partialModel, TableauSizes(&d_tableau), BoundCountingLookup(*this)),
d_tableau(),
d_tableau,
d_rowTracking,
BasicVarModelUpdateCallBack(*this)),
- d_diosolver(d_env.getContext()),
+ d_diosolver(context()),
d_restartsCounter(0),
d_tableauSizeHasBeenModified(false),
d_tableauResetDensity(1.6),
d_tableauResetPeriod(10),
- d_conflicts(d_env.getContext()),
- d_blackBoxConflict(d_env.getContext(), Node::null()),
- d_blackBoxConflictPf(d_env.getContext(),
- std::shared_ptr<ProofNode>(nullptr)),
- d_congruenceManager(d_env.getContext(),
- d_env.getUserContext(),
+ d_conflicts(context()),
+ d_blackBoxConflict(context(), Node::null()),
+ d_blackBoxConflictPf(context(), std::shared_ptr<ProofNode>(nullptr)),
+ d_congruenceManager(context(),
+ userContext(),
d_constraintDatabase,
SetupLiteralCallBack(*this),
d_partialModel,
RaiseEqualityEngineConflict(*this),
d_pnm),
- d_cmEnabled(d_env.getContext(), options().arith.arithCongMan),
+ d_cmEnabled(context(), options().arith.arithCongMan),
d_dualSimplex(
d_linEq, d_errorSet, RaiseConflict(*this), TempVarMalloc(*this)),
d_linEq, d_errorSet, RaiseConflict(*this), TempVarMalloc(*this)),
d_pass1SDP(NULL),
d_otherSDP(NULL),
- d_lastContextIntegerAttempted(d_env.getContext(), -1),
+ d_lastContextIntegerAttempted(context(), -1),
d_DELTA_ZERO(0),
- d_approxCuts(d_env.getContext()),
+ d_approxCuts(context()),
d_fullCheckCounter(0),
- d_cutCount(d_env.getContext(), 0),
- d_cutInContext(d_env.getContext()),
- d_likelyIntegerInfeasible(d_env.getContext(), false),
- d_guessedCoeffSet(d_env.getContext(), false),
+ d_cutCount(context(), 0),
+ d_cutInContext(context()),
+ d_likelyIntegerInfeasible(context(), false),
+ d_guessedCoeffSet(context(), false),
d_guessedCoeffs(),
d_treeLog(NULL),
d_replayVariables(),
d_replayConstraints(),
d_lhsTmp(),
d_approxStats(NULL),
- d_attemptSolveIntTurnedOff(d_env.getUserContext(), 0),
+ d_attemptSolveIntTurnedOff(userContext(), 0),
d_dioSolveResources(0),
d_solveIntMaybeHelp(0u),
d_solveIntAttempts(0u),
if(!vl.singleton()){
// vl is the product of at least 2 variables
// vl : (* v1 v2 ...)
- if(getLogicInfo().isLinear()){
+ if (logicInfo().isLinear())
+ {
throw LogicException("A non-linear fact was asserted to arithmetic in a linear logic.");
}
d_foundNl = true;
ArithVar TheoryArithPrivate::requestArithVar(TNode x, bool aux, bool internal){
//TODO : The VarList trick is good enough?
Assert(isLeaf(x) || VarList::isMember(x) || x.getKind() == PLUS || internal);
- if(getLogicInfo().isLinear() && Variable::isDivMember(x)){
+ if (logicInfo().isLinear() && Variable::isDivMember(x))
+ {
stringstream ss;
ss << "A non-linear fact (involving div/mod/divisibility) was asserted to "
"arithmetic in a linear logic: "
void ModelManager::finishInit(eq::EqualityEngineNotify* notify)
{
// construct the model
- const LogicInfo& logicInfo = d_env.getLogicInfo();
// Initialize the model and model builder.
- if (logicInfo.isQuantified())
+ if (logicInfo().isQuantified())
{
QuantifiersEngine* qe = d_te.getQuantifiersEngine();
Assert(qe != nullptr);
// check whether it is not in the current logic, e.g. non-linear arithmetic.
// if so, undo replacements until it is in the current logic.
- const LogicInfo& logic = getLogicInfo();
+ const LogicInfo& logic = logicInfo();
if (logic.isTheoryEnabled(THEORY_ARITH) && logic.isLinear())
{
fo_body = fitToLogic(sygusBody,
OutputChannel& out,
Valuation valuation)
: Theory(THEORY_QUANTIFIERS, env, out, valuation),
- d_qstate(env, valuation, getLogicInfo()),
+ d_qstate(env, valuation, logicInfo()),
d_qreg(),
d_treg(d_qstate, d_qreg),
d_qim(*this, d_qstate, d_qreg, d_treg, d_pnm),
bool tn_is_monotonic = true;
if( tn.isSort() ){
//TODO: use monotonicity inference
- tn_is_monotonic = !getLogicInfo().isQuantified();
+ tn_is_monotonic = !logicInfo().isQuantified();
}else{
tn_is_monotonic = tn.getCardinality().isInfinite();
}
if (nk == COMPREHENSION)
{
// set comprehension is an implicit quantifier, require it in the logic
- if (!getLogicInfo().isQuantified())
+ if (!logicInfo().isQuantified())
{
std::stringstream ss;
ss << "Set comprehensions require quantifiers in the background logic.";
bool SortInference::isHandledApplyUf(Kind k) const
{
- return k == APPLY_UF && !d_env.getLogicInfo().isHigherOrder();
+ return k == APPLY_UF && !logicInfo().isHigherOrder();
}
} // namespace theory
{
return false;
}
- if (!options::produceModels() && !getLogicInfo().isQuantified())
+ if (!options::produceModels() && !logicInfo().isQuantified())
{
// Don't care about the model and logic is not quantified, we can eliminate.
return true;
if (options::relevanceFilter())
{
d_relManager.reset(
- new RelevanceManager(d_env.getUserContext(), theory::Valuation(this)));
+ new RelevanceManager(userContext(), theory::Valuation(this)));
}
// initialize the quantifiers engine
ProofNodeManager* TheoryEngine::getProofNodeManager() const { return d_pnm; }
-context::Context* TheoryEngine::getSatContext() const
-{
- return d_env.getContext();
-}
+context::Context* TheoryEngine::getSatContext() const { return context(); }
context::UserContext* TheoryEngine::getUserContext() const
{
- return d_env.getUserContext();
+ return userContext();
}
TheoryEngine::TheoryEngine(Env& env)
d_logicInfo(env.getLogicInfo()),
d_pnm(d_env.isTheoryProofProducing() ? d_env.getProofNodeManager()
: nullptr),
- d_lazyProof(d_pnm != nullptr
- ? new LazyCDProof(d_pnm,
- nullptr,
- d_env.getUserContext(),
- "TheoryEngine::LazyCDProof")
- : nullptr),
- d_tepg(new TheoryEngineProofGenerator(d_pnm, d_env.getUserContext())),
+ d_lazyProof(
+ d_pnm != nullptr ? new LazyCDProof(
+ d_pnm, nullptr, userContext(), "TheoryEngine::LazyCDProof")
+ : nullptr),
+ d_tepg(new TheoryEngineProofGenerator(d_pnm, userContext())),
d_tc(nullptr),
d_sharedSolver(nullptr),
d_quantEngine(nullptr),
- d_decManager(new DecisionManager(d_env.getUserContext())),
+ d_decManager(new DecisionManager(userContext())),
d_relManager(nullptr),
- d_inConflict(d_env.getContext(), false),
+ d_inConflict(context(), false),
d_inSatMode(false),
d_hasShutDown(false),
- d_incomplete(d_env.getContext(), false),
- d_incompleteTheory(d_env.getContext(), THEORY_BUILTIN),
- d_incompleteId(d_env.getContext(), IncompleteId::UNKNOWN),
- d_propagationMap(d_env.getContext()),
- d_propagationMapTimestamp(d_env.getContext(), 0),
- d_propagatedLiterals(d_env.getContext()),
- d_propagatedLiteralsIndex(d_env.getContext(), 0),
- d_atomRequests(d_env.getContext()),
+ d_incomplete(context(), false),
+ d_incompleteTheory(context(), THEORY_BUILTIN),
+ d_incompleteId(context(), IncompleteId::UNKNOWN),
+ d_propagationMap(context()),
+ d_propagationMapTimestamp(context(), 0),
+ d_propagatedLiterals(context()),
+ d_propagatedLiteralsIndex(context(), 0),
+ d_atomRequests(context()),
d_combineTheoriesTime(smtStatisticsRegistry().registerTimer(
"TheoryEngine::combineTheoriesTime")),
d_true(),
d_false(),
d_interrupted(false),
d_inPreregister(false),
- d_factsAsserted(d_env.getContext(), false)
+ d_factsAsserted(context(), false)
{
for(TheoryId theoryId = theory::THEORY_FIRST; theoryId != theory::THEORY_LAST;
++ theoryId)
Debug("theory::propagate")
<< "TheoryEngine::propagate(" << literal << ", " << theory << ")" << endl;
- Trace("dtview::prop") << std::string(d_env.getContext()->getLevel(), ' ')
+ Trace("dtview::prop") << std::string(context()->getLevel(), ' ')
<< ":THEORY-PROP: " << literal << endl;
// spendResource();
d_enableFuncModels(enableFuncModels)
{
// must use function models when ufHo is enabled
- Assert(d_enableFuncModels || !d_env.getLogicInfo().isHigherOrder());
+ Assert(d_enableFuncModels || !logicInfo().isHigherOrder());
d_true = NodeManager::currentNM()->mkConst( true );
d_false = NodeManager::currentNM()->mkConst( false );
}
d_equalityEngine = ee;
// The kinds we are treating as function application in congruence
d_equalityEngine->addFunctionKind(
- kind::APPLY_UF, false, d_env.getLogicInfo().isHigherOrder());
+ kind::APPLY_UF, false, logicInfo().isHigherOrder());
d_equalityEngine->addFunctionKind(kind::HO_APPLY);
d_equalityEngine->addFunctionKind(kind::SELECT);
// d_equalityEngine->addFunctionKind(kind::STORE);
// return the representative of the term in the equality engine, if it exists
TypeNode t = ret.getType();
bool eeHasTerm;
- if (!d_env.getLogicInfo().isHigherOrder()
- && (t.isFunction() || t.isPredicate()))
+ if (!logicInfo().isHigherOrder() && (t.isFunction() || t.isPredicate()))
{
// functions are in the equality engine, but *not* as first-class members
// when higher-order is disabled. In this case, we cannot query
Trace("model-builder") << " Assigning function (" << f << ") to (" << f_def << ")" << endl;
Assert(d_uf_models.find(f) == d_uf_models.end());
- if (d_env.getLogicInfo().isHigherOrder())
+ if (logicInfo().isHigherOrder())
{
//we must rewrite the function value since the definition needs to be a constant value
f_def = Rewriter::rewrite( f_def );
d_uf_models[f] = f_def;
}
- if (d_env.getLogicInfo().isHigherOrder() && d_equalityEngine->hasTerm(f))
+ if (logicInfo().isHigherOrder() && d_equalityEngine->hasTerm(f))
{
Trace("model-builder-debug") << " ...function is first-class member of equality engine" << std::endl;
// assign to representative if higher-order
Assert(d_env.getTopLevelSubstitutions().apply(n) == n);
if( !hasAssignedFunctionDefinition( n ) ){
Trace("model-builder-fun-debug") << "Look at function : " << n << std::endl;
- if (d_env.getLogicInfo().isHigherOrder())
+ if (logicInfo().isHigherOrder())
{
// if in higher-order mode, assign function definitions modulo equality
Node r = getRepresentative( n );
{
// selectors are always assignable (where we guarantee that they are not
// evaluatable here)
- if (!d_env.getLogicInfo().isHigherOrder())
+ if (!logicInfo().isHigherOrder())
{
Assert(!n.getType().isFunction());
return true;
else
{
// non-function variables, and fully applied functions
- if (!d_env.getLogicInfo().isHigherOrder())
+ if (!logicInfo().isHigherOrder())
{
// no functions exist, all functions are fully applied
Assert(n.getKind() != kind::HO_APPLY);
void TheoryEngineModelBuilder::assignFunction(TheoryModel* m, Node f)
{
- Assert(!d_env.getLogicInfo().isHigherOrder());
+ Assert(!logicInfo().isHigherOrder());
uf::UfModelTree ufmt(f);
Node default_v;
for (size_t i = 0; i < m->d_uf_terms[f].size(); i++)
void TheoryEngineModelBuilder::assignHoFunction(TheoryModel* m, Node f)
{
- Assert(d_env.getLogicInfo().isHigherOrder());
+ Assert(logicInfo().isHigherOrder());
TypeNode type = f.getType();
std::vector<TypeNode> argTypes = type.getArgTypes();
std::vector<Node> args;
Trace("model-builder") << "Assigning function values..." << std::endl;
std::vector<Node> funcs_to_assign = m->getFunctionsToAssign();
- if (d_env.getLogicInfo().isHigherOrder())
+ if (logicInfo().isHigherOrder())
{
// sort based on type size if higher-order
Trace("model-builder") << "Sort functions by type..." << std::endl;
Trace("model-builder") << " Function #" << k << " is " << f << std::endl;
// std::map< Node, std::vector< Node > >::iterator itht =
// m->d_ho_uf_terms.find( f );
- if (!d_env.getLogicInfo().isHigherOrder())
+ if (!logicInfo().isHigherOrder())
{
Trace("model-builder") << " Assign function value for " << f
<< " based on APPLY_UF" << std::endl;
namespace theory {
TheoryState::TheoryState(Env& env, Valuation val)
- : EnvObj(env),
- d_valuation(val),
- d_ee(nullptr),
- d_conflict(d_env.getContext(), false)
+ : EnvObj(env), d_valuation(val), d_ee(nullptr), d_conflict(context(), false)
{
}
void TheoryState::setEqualityEngine(eq::EqualityEngine* ee) { d_ee = ee; }
-context::Context* TheoryState::getSatContext() const
-{
- return d_env.getContext();
-}
+context::Context* TheoryState::getSatContext() const { return context(); }
context::UserContext* TheoryState::getUserContext() const
{
- return d_env.getUserContext();
+ return userContext();
}
bool TheoryState::hasTerm(TNode a) const
d_thss(nullptr),
d_ho(nullptr),
d_functionsTerms(getSatContext()),
- d_symb(getUserContext(), instanceName),
- d_rewriter(env.getLogicInfo().isHigherOrder()),
+ d_symb(userContext(), instanceName),
+ d_rewriter(logicInfo().isHigherOrder()),
d_state(env, valuation),
d_im(*this, d_state, d_pnm, "theory::uf::" + instanceName, false),
d_notify(d_im, *this)
d_thss.reset(new CardinalityExtension(d_state, d_im, this));
}
// The kinds we are treating as function application in congruence
- d_equalityEngine->addFunctionKind(
- kind::APPLY_UF, false, getLogicInfo().isHigherOrder());
- if (getLogicInfo().isHigherOrder())
+ bool isHo = logicInfo().isHigherOrder();
+ d_equalityEngine->addFunctionKind(kind::APPLY_UF, false, isHo);
+ if (isHo)
{
d_equalityEngine->addFunctionKind(kind::HO_APPLY);
d_ho.reset(new HoExtension(d_state, d_im));
// check with the higher-order extension at full effort
if (!d_state.isInConflict() && fullEffort(level))
{
- if (getLogicInfo().isHigherOrder())
+ if (logicInfo().isHigherOrder())
{
d_ho->check();
}
{
case kind::EQUAL:
{
- if (getLogicInfo().isHigherOrder() && options::ufHoExt())
+ if (logicInfo().isHigherOrder() && options::ufHoExt())
{
if (!pol && !d_state.isInConflict() && atom[0].getType().isFunction())
{
{
if (d_thss == nullptr)
{
- if (!getLogicInfo().hasCardinalityConstraints())
+ if (!logicInfo().hasCardinalityConstraints())
{
std::stringstream ss;
ss << "Cardinality constraint " << atom
Kind k = node.getKind();
if (k == kind::HO_APPLY)
{
- if (!getLogicInfo().isHigherOrder())
+ if (!logicInfo().isHigherOrder())
{
std::stringstream ss;
ss << "Partial function applications are only supported with "
// check for higher-order
// logic exception if higher-order is not enabled
if (isHigherOrderType(node.getOperator().getType())
- && !getLogicInfo().isHigherOrder())
+ && !logicInfo().isHigherOrder())
{
std::stringstream ss;
ss << "UF received an application whose operator has higher-order type "
}
// we always use APPLY_UF if not higher-order, HO_APPLY if higher-order
- Assert(node.getKind() != kind::HO_APPLY
- || getLogicInfo().isHigherOrder());
+ Assert(node.getKind() != kind::HO_APPLY || logicInfo().isHigherOrder());
Kind k = node.getKind();
switch (k)
bool TheoryUF::collectModelValues(TheoryModel* m, const std::set<Node>& termSet)
{
- if (getLogicInfo().isHigherOrder())
+ if (logicInfo().isHigherOrder())
{
// must add extensionality disequalities for all pairs of (non-disequal)
// function equivalence classes.