{
if (d_solver != nullptr)
{
- // Ensure that the correct node manager is in scope when the node is
- // destroyed.
- NodeManagerScope scope(d_solver->getNodeManager());
d_type.reset();
}
}
Datatype Sort::getDatatype() const
{
- NodeManagerScope scope(d_solver->getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_CHECK_NOT_NULL;
CVC5_API_CHECK(isDatatype()) << "Expected datatype sort.";
Sort Sort::instantiate(const std::vector<Sort>& params) const
{
- NodeManagerScope scope(d_solver->getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_CHECK_NOT_NULL;
CVC5_API_CHECK_SORTS(params);
Sort Sort::substitute(const Sort& sort, const Sort& replacement) const
{
- NodeManagerScope scope(d_solver->getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_CHECK_NOT_NULL;
CVC5_API_CHECK_SORT(sort);
Sort Sort::substitute(const std::vector<Sort>& sorts,
const std::vector<Sort>& replacements) const
{
- NodeManagerScope scope(d_solver->getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_CHECK_NOT_NULL;
CVC5_API_CHECK_SORTS(sorts);
//////// all checks before this line
if (d_solver != nullptr)
{
- NodeManagerScope scope(d_solver->getNodeManager());
return d_type->toString();
}
return d_type->toString();
{
// Ensure that the correct node manager is in scope when the type node is
// destroyed.
- NodeManagerScope scope(d_solver->getNodeManager());
d_node.reset();
}
}
<< "Expecting a non-null internal expression";
if (d_solver != nullptr)
{
- NodeManagerScope scope(d_solver->getNodeManager());
return d_node->toString();
}
return d_node->toString();
Term::Term(const Solver* slv, const cvc5::Node& n) : d_solver(slv)
{
- // Ensure that we create the node in the correct node manager.
- NodeManagerScope scope(d_solver->getNodeManager());
d_node.reset(new cvc5::Node(n));
}
{
if (d_solver != nullptr)
{
- // Ensure that the correct node manager is in scope when the node is
- // destroyed.
- NodeManagerScope scope(d_solver->getNodeManager());
d_node.reset();
}
}
{
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_CHECK_NOT_NULL;
- NodeManagerScope scope(d_solver->getNodeManager());
//////// all checks before this line
return Sort(d_solver, d_node->getType());
////////
//////// all checks before this line
if (d_solver != nullptr)
{
- NodeManagerScope scope(d_solver->getNodeManager());
return d_node->toString();
}
return d_node->toString();
{
if (d_ctor != nullptr)
{
- // ensure proper node manager is in scope
- NodeManagerScope scope(d_solver->getNodeManager());
d_ctor.reset();
}
}
void DatatypeConstructorDecl::addSelector(const std::string& name,
const Sort& sort)
{
- NodeManagerScope scope(d_solver->getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_CHECK_NOT_NULL;
CVC5_API_CHECK_SORT(sort);
void DatatypeConstructorDecl::addSelectorSelf(const std::string& name)
{
- NodeManagerScope scope(d_solver->getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_CHECK_NOT_NULL;
//////// all checks before this line
{
if (d_dtype != nullptr)
{
- // ensure proper node manager is in scope
- NodeManagerScope scope(d_solver->getNodeManager());
d_dtype.reset();
}
}
void DatatypeDecl::addConstructor(const DatatypeConstructorDecl& ctor)
{
- NodeManagerScope scope(d_solver->getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_CHECK_NOT_NULL;
CVC5_API_ARG_CHECK_NOT_NULL(ctor);
{
if (d_stor != nullptr)
{
- // ensure proper node manager is in scope
- NodeManagerScope scope(d_solver->getNodeManager());
d_stor.reset();
}
}
{
if (d_ctor != nullptr)
{
- // ensure proper node manager is in scope
- NodeManagerScope scope(d_solver->getNodeManager());
d_ctor.reset();
}
}
Term DatatypeConstructor::getSpecializedConstructorTerm(
const Sort& retSort) const
{
- NodeManagerScope scope(d_solver->getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_CHECK_NOT_NULL;
CVC5_API_CHECK(d_ctor->isResolved())
{
if (d_dtype != nullptr)
{
- // ensure proper node manager is in scope
- NodeManagerScope scope(d_solver->getNodeManager());
d_dtype.reset();
}
}
Solver::Solver(std::unique_ptr<Options>&& original)
{
- d_nodeMgr.reset(new NodeManager());
+ d_nodeMgr = NodeManager::currentNM();
+ d_nodeMgr->init();
d_originalOptions = std::move(original);
- d_smtEngine.reset(new SmtEngine(d_nodeMgr.get(), d_originalOptions.get()));
+ d_smtEngine.reset(new SmtEngine(d_nodeMgr, d_originalOptions.get()));
d_smtEngine->setSolver(this);
d_rng.reset(new Random(d_smtEngine->getOptions().driver.seed));
resetStatistics();
/* Helpers and private functions */
/* -------------------------------------------------------------------------- */
-NodeManager* Solver::getNodeManager(void) const { return d_nodeMgr.get(); }
+NodeManager* Solver::getNodeManager(void) const { return d_nodeMgr; }
void Solver::increment_term_stats(Kind kind) const
{
Sort Solver::getNullSort(void) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
//////// all checks before this line
return Sort(this, TypeNode());
Sort Solver::getBooleanSort(void) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
//////// all checks before this line
return Sort(this, getNodeManager()->booleanType());
Sort Solver::getIntegerSort(void) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
//////// all checks before this line
return Sort(this, getNodeManager()->integerType());
Sort Solver::getRealSort(void) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
//////// all checks before this line
return Sort(this, getNodeManager()->realType());
Sort Solver::getRegExpSort(void) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
//////// all checks before this line
return Sort(this, getNodeManager()->regExpType());
Sort Solver::getStringSort(void) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
//////// all checks before this line
return Sort(this, getNodeManager()->stringType());
Sort Solver::getRoundingModeSort(void) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
//////// all checks before this line
return Sort(this, getNodeManager()->roundingModeType());
Sort Solver::mkArraySort(const Sort& indexSort, const Sort& elemSort) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_SOLVER_CHECK_SORT(indexSort);
CVC5_API_SOLVER_CHECK_SORT(elemSort);
Sort Solver::mkBitVectorSort(uint32_t size) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_ARG_CHECK_EXPECTED(size > 0, size) << "size > 0";
//////// all checks before this line
Sort Solver::mkFloatingPointSort(uint32_t exp, uint32_t sig) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_ARG_CHECK_EXPECTED(exp > 0, exp) << "exponent size > 0";
CVC5_API_ARG_CHECK_EXPECTED(sig > 0, sig) << "significand size > 0";
Sort Solver::mkDatatypeSort(const DatatypeDecl& dtypedecl) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_SOLVER_CHECK_DTDECL(dtypedecl);
//////// all checks before this line
std::vector<Sort> Solver::mkDatatypeSorts(
const std::vector<DatatypeDecl>& dtypedecls) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_SOLVER_CHECK_DTDECLS(dtypedecls);
CVC5_API_TRY_CATCH_BEGIN;
//////// all checks before this line
const std::vector<DatatypeDecl>& dtypedecls,
const std::set<Sort>& unresolvedSorts) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_SOLVER_CHECK_DTDECLS(dtypedecls);
CVC5_API_SOLVER_CHECK_SORTS(unresolvedSorts);
Sort Solver::mkFunctionSort(const Sort& domain, const Sort& codomain) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_SOLVER_CHECK_DOMAIN_SORT(domain);
CVC5_API_SOLVER_CHECK_CODOMAIN_SORT(codomain);
Sort Solver::mkFunctionSort(const std::vector<Sort>& sorts,
const Sort& codomain) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_ARG_SIZE_CHECK_EXPECTED(sorts.size() >= 1, sorts)
<< "at least one parameter sort for function sort";
Sort Solver::mkParamSort(const std::string& symbol) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
//////// all checks before this line
return Sort(
Sort Solver::mkPredicateSort(const std::vector<Sort>& sorts) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_ARG_SIZE_CHECK_EXPECTED(sorts.size() >= 1, sorts)
<< "at least one parameter sort for predicate sort";
Sort Solver::mkRecordSort(
const std::vector<std::pair<std::string, Sort>>& fields) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
std::vector<std::pair<std::string, TypeNode>> f;
for (size_t i = 0, size = fields.size(); i < size; ++i)
Sort Solver::mkSetSort(const Sort& elemSort) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_SOLVER_CHECK_SORT(elemSort);
//////// all checks before this line
Sort Solver::mkBagSort(const Sort& elemSort) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_SOLVER_CHECK_SORT(elemSort);
//////// all checks before this line
Sort Solver::mkSequenceSort(const Sort& elemSort) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_SOLVER_CHECK_SORT(elemSort);
//////// all checks before this line
Sort Solver::mkUninterpretedSort(const std::string& symbol) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
//////// all checks before this line
return Sort(this, getNodeManager()->mkSort(symbol));
Sort Solver::mkSortConstructorSort(const std::string& symbol,
size_t arity) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_ARG_CHECK_EXPECTED(arity > 0, arity) << "an arity > 0";
//////// all checks before this line
Sort Solver::mkTupleSort(const std::vector<Sort>& sorts) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_SOLVER_CHECK_SORTS_NOT_FUNCTION_LIKE(sorts);
//////// all checks before this line
Term Solver::mkTrue(void) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
//////// all checks before this line
return Term(this, d_nodeMgr->mkConst<bool>(true));
Term Solver::mkFalse(void) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
//////// all checks before this line
return Term(this, d_nodeMgr->mkConst<bool>(false));
Term Solver::mkBoolean(bool val) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
//////// all checks before this line
return Term(this, d_nodeMgr->mkConst<bool>(val));
Term Solver::mkPi() const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
//////// all checks before this line
Node res =
Term Solver::mkInteger(const std::string& s) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_ARG_CHECK_EXPECTED(isValidInteger(s), s) << " an integer ";
Term integer = mkRealFromStrHelper(s);
Term Solver::mkInteger(int64_t val) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
//////// all checks before this line
Term integer = mkValHelper<cvc5::Rational>(cvc5::Rational(val));
Term Solver::mkReal(const std::string& s) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
/* CLN and GMP handle this case differently, CLN interprets it as 0, GMP
* throws an std::invalid_argument exception. For consistency, we treat it
Term Solver::mkReal(int64_t val) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
//////// all checks before this line
Term rational = mkValHelper<cvc5::Rational>(cvc5::Rational(val));
Term Solver::mkReal(int64_t num, int64_t den) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
//////// all checks before this line
Term rational = mkValHelper<cvc5::Rational>(cvc5::Rational(num, den));
Term Solver::mkRegexpEmpty() const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
//////// all checks before this line
Node res =
Term Solver::mkRegexpSigma() const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
//////// all checks before this line
Node res =
Term Solver::mkEmptySet(const Sort& sort) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_ARG_CHECK_EXPECTED(sort.isNull() || sort.isSet(), sort)
<< "null sort or set sort";
Term Solver::mkEmptyBag(const Sort& sort) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_ARG_CHECK_EXPECTED(sort.isNull() || sort.isBag(), sort)
<< "null sort or bag sort";
Term Solver::mkSepNil(const Sort& sort) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_SOLVER_CHECK_SORT(sort);
//////// all checks before this line
Term Solver::mkString(const std::string& s, bool useEscSequences) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
//////// all checks before this line
return mkValHelper<cvc5::String>(cvc5::String(s, useEscSequences));
Term Solver::mkString(const std::wstring& s) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
//////// all checks before this line
return mkValHelper<cvc5::String>(cvc5::String(s));
Term Solver::mkEmptySequence(const Sort& sort) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_SOLVER_CHECK_SORT(sort);
//////// all checks before this line
Term Solver::mkUniverseSet(const Sort& sort) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_SOLVER_CHECK_SORT(sort);
//////// all checks before this line
Term Solver::mkBitVector(uint32_t size, uint64_t val) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
//////// all checks before this line
return mkBVFromIntHelper(size, val);
const std::string& s,
uint32_t base) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
//////// all checks before this line
return mkBVFromStrHelper(size, s, base);
Term Solver::mkConstArray(const Sort& sort, const Term& val) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_SOLVER_CHECK_SORT(sort);
CVC5_API_SOLVER_CHECK_TERM(val);
Term Solver::mkPosInf(uint32_t exp, uint32_t sig) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
//////// all checks before this line
return mkValHelper<cvc5::FloatingPoint>(
Term Solver::mkNegInf(uint32_t exp, uint32_t sig) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
//////// all checks before this line
return mkValHelper<cvc5::FloatingPoint>(
Term Solver::mkNaN(uint32_t exp, uint32_t sig) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
//////// all checks before this line
return mkValHelper<cvc5::FloatingPoint>(
Term Solver::mkPosZero(uint32_t exp, uint32_t sig) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
//////// all checks before this line
return mkValHelper<cvc5::FloatingPoint>(
Term Solver::mkNegZero(uint32_t exp, uint32_t sig) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
//////// all checks before this line
return mkValHelper<cvc5::FloatingPoint>(
Term Solver::mkRoundingMode(RoundingMode rm) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
//////// all checks before this line
return mkValHelper<cvc5::RoundingMode>(s_rmodes.at(rm));
Term Solver::mkUninterpretedConst(const Sort& sort, int32_t index) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_SOLVER_CHECK_SORT(sort);
//////// all checks before this line
Term Solver::mkAbstractValue(const std::string& index) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_ARG_CHECK_EXPECTED(!index.empty(), index) << "a non-empty string";
Term Solver::mkAbstractValue(uint64_t index) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_ARG_CHECK_EXPECTED(index > 0, index) << "an integer > 0";
//////// all checks before this line
Term Solver::mkFloatingPoint(uint32_t exp, uint32_t sig, Term val) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_SOLVER_CHECK_TERM(val);
CVC5_API_ARG_CHECK_EXPECTED(exp > 0, exp) << "a value > 0";
Term Solver::mkConst(const Sort& sort, const std::string& symbol) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_SOLVER_CHECK_SORT(sort);
//////// all checks before this line
Term Solver::mkConst(const Sort& sort) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_SOLVER_CHECK_SORT(sort);
//////// all checks before this line
Term Solver::mkVar(const Sort& sort, const std::string& symbol) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_SOLVER_CHECK_SORT(sort);
//////// all checks before this line
DatatypeConstructorDecl Solver::mkDatatypeConstructorDecl(
const std::string& name)
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
//////// all checks before this line
return DatatypeConstructorDecl(this, name);
DatatypeDecl Solver::mkDatatypeDecl(const std::string& name, bool isCoDatatype)
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
//////// all checks before this line
return DatatypeDecl(this, name, isCoDatatype);
Sort param,
bool isCoDatatype)
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_SOLVER_CHECK_SORT(param);
//////// all checks before this line
const std::vector<Sort>& params,
bool isCoDatatype)
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_SOLVER_CHECK_SORTS(params);
//////// all checks before this line
Term Solver::mkTerm(Kind kind) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_KIND_CHECK(kind);
//////// all checks before this line
Term Solver::mkTerm(Kind kind, const Term& child) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_KIND_CHECK(kind);
CVC5_API_SOLVER_CHECK_TERM(child);
Term Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_KIND_CHECK(kind);
CVC5_API_SOLVER_CHECK_TERM(child1);
const Term& child2,
const Term& child3) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_KIND_CHECK(kind);
CVC5_API_SOLVER_CHECK_TERM(child1);
Term Solver::mkTerm(Kind kind, const std::vector<Term>& children) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_KIND_CHECK(kind);
CVC5_API_SOLVER_CHECK_TERMS(children);
Term Solver::mkTerm(const Op& op) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_SOLVER_CHECK_OP(op);
checkMkTerm(op.d_kind, 0);
Term Solver::mkTerm(const Op& op, const Term& child) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_SOLVER_CHECK_OP(op);
CVC5_API_SOLVER_CHECK_TERM(child);
Term Solver::mkTerm(const Op& op, const Term& child1, const Term& child2) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_SOLVER_CHECK_OP(op);
CVC5_API_SOLVER_CHECK_TERM(child1);
const Term& child2,
const Term& child3) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_SOLVER_CHECK_OP(op);
CVC5_API_SOLVER_CHECK_TERM(child1);
Term Solver::mkTerm(const Op& op, const std::vector<Term>& children) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_SOLVER_CHECK_OP(op);
CVC5_API_SOLVER_CHECK_TERMS(children);
Term Solver::mkTuple(const std::vector<Sort>& sorts,
const std::vector<Term>& terms) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_CHECK(sorts.size() == terms.size())
<< "Expected the same number of sorts and elements";
Term Solver::simplify(const Term& term)
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_SOLVER_CHECK_TERM(term);
//////// all checks before this line
Result Solver::checkEntailed(const Term& term) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_CHECK(!d_smtEngine->isQueryMade()
|| d_smtEngine->getOptions().base.incrementalSolving)
Result Solver::checkEntailed(const std::vector<Term>& terms) const
{
CVC5_API_TRY_CATCH_BEGIN;
- NodeManagerScope scope(getNodeManager());
CVC5_API_CHECK(!d_smtEngine->isQueryMade()
|| d_smtEngine->getOptions().base.incrementalSolving)
<< "Cannot make multiple queries unless incremental solving is enabled "
Result Solver::checkSat(void) const
{
CVC5_API_TRY_CATCH_BEGIN;
- NodeManagerScope scope(getNodeManager());
CVC5_API_CHECK(!d_smtEngine->isQueryMade()
|| d_smtEngine->getOptions().base.incrementalSolving)
<< "Cannot make multiple queries unless incremental solving is enabled "
Result Solver::checkSatAssuming(const Term& assumption) const
{
CVC5_API_TRY_CATCH_BEGIN;
- NodeManagerScope scope(getNodeManager());
CVC5_API_CHECK(!d_smtEngine->isQueryMade()
|| d_smtEngine->getOptions().base.incrementalSolving)
<< "Cannot make multiple queries unless incremental solving is enabled "
Result Solver::checkSatAssuming(const std::vector<Term>& assumptions) const
{
CVC5_API_TRY_CATCH_BEGIN;
- NodeManagerScope scope(getNodeManager());
CVC5_API_CHECK(!d_smtEngine->isQueryMade() || assumptions.size() == 0
|| d_smtEngine->getOptions().base.incrementalSolving)
<< "Cannot make multiple queries unless incremental solving is enabled "
const Term& term,
bool global) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_CHECK(d_smtEngine->getUserLogicInfo().isQuantified())
const Term& term,
bool global) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_CHECK(d_smtEngine->getUserLogicInfo().isQuantified())
const std::vector<Term>& terms,
bool global) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_CHECK(d_smtEngine->getUserLogicInfo().isQuantified())
std::vector<Term> Solver::getUnsatAssumptions(void) const
{
CVC5_API_TRY_CATCH_BEGIN;
- NodeManagerScope scope(getNodeManager());
CVC5_API_CHECK(d_smtEngine->getOptions().base.incrementalSolving)
<< "Cannot get unsat assumptions unless incremental solving is enabled "
"(try --incremental)";
std::vector<Term> Solver::getUnsatCore(void) const
{
CVC5_API_TRY_CATCH_BEGIN;
- NodeManagerScope scope(getNodeManager());
CVC5_API_CHECK(d_smtEngine->getOptions().smt.unsatCores)
<< "Cannot get unsat core unless explicitly enabled "
"(try --produce-unsat-cores)";
std::map<Term, Term> Solver::getDifficulty() const
{
CVC5_API_TRY_CATCH_BEGIN;
- NodeManagerScope scope(getNodeManager());
CVC5_API_RECOVERABLE_CHECK(d_smtEngine->getSmtMode() == SmtMode::UNSAT
|| d_smtEngine->getSmtMode() == SmtMode::SAT
|| d_smtEngine->getSmtMode()
std::string Solver::getProof(void) const
{
CVC5_API_TRY_CATCH_BEGIN;
- NodeManagerScope scope(getNodeManager());
CVC5_API_CHECK(d_smtEngine->getOptions().smt.produceProofs)
<< "Cannot get proof explicitly enabled (try --produce-proofs)";
CVC5_API_RECOVERABLE_CHECK(d_smtEngine->getSmtMode() == SmtMode::UNSAT)
std::vector<Term> Solver::getValue(const std::vector<Term>& terms) const
{
CVC5_API_TRY_CATCH_BEGIN;
- NodeManagerScope scope(getNodeManager());
CVC5_API_RECOVERABLE_CHECK(d_smtEngine->getOptions().smt.produceModels)
<< "Cannot get value unless model generation is enabled "
"(try --produce-models)";
std::vector<Term> Solver::getModelDomainElements(const Sort& s) const
{
CVC5_API_TRY_CATCH_BEGIN;
- NodeManagerScope scope(getNodeManager());
CVC5_API_RECOVERABLE_CHECK(d_smtEngine->getOptions().smt.produceModels)
<< "Cannot get domain elements unless model generation is enabled "
"(try --produce-models)";
bool Solver::isModelCoreSymbol(const Term& v) const
{
CVC5_API_TRY_CATCH_BEGIN;
- NodeManagerScope scope(getNodeManager());
CVC5_API_RECOVERABLE_CHECK(d_smtEngine->getOptions().smt.produceModels)
<< "Cannot check if model core symbol unless model generation is enabled "
"(try --produce-models)";
const std::vector<Term>& vars) const
{
CVC5_API_TRY_CATCH_BEGIN;
- NodeManagerScope scope(getNodeManager());
CVC5_API_RECOVERABLE_CHECK(d_smtEngine->getOptions().smt.produceModels)
<< "Cannot get model unless model generation is enabled "
"(try --produce-models)";
Term Solver::getQuantifierElimination(const Term& q) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_SOLVER_CHECK_TERM(q);
//////// all checks before this line
Term Solver::getQuantifierEliminationDisjunct(const Term& q) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_SOLVER_CHECK_TERM(q);
//////// all checks before this line
Term Solver::getSeparationHeap() const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_CHECK(
d_smtEngine->getLogicInfo().isTheoryEnabled(theory::THEORY_SEP))
Term Solver::getSeparationNilTerm() const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_CHECK(
d_smtEngine->getLogicInfo().isTheoryEnabled(theory::THEORY_SEP))
const Sort& sort,
const std::vector<Term>& initValue) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_SOLVER_CHECK_SORT(sort);
CVC5_API_SOLVER_CHECK_TERMS(initValue);
void Solver::pop(uint32_t nscopes) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_CHECK(d_smtEngine->getOptions().base.incrementalSolving)
<< "Cannot pop when not solving incrementally (use --incremental)";
bool Solver::getInterpolant(const Term& conj, Term& output) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_SOLVER_CHECK_TERM(conj);
//////// all checks before this line
Grammar& grammar,
Term& output) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_SOLVER_CHECK_TERM(conj);
//////// all checks before this line
bool Solver::getAbduct(const Term& conj, Term& output) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_SOLVER_CHECK_TERM(conj);
//////// all checks before this line
bool Solver::getAbduct(const Term& conj, Grammar& grammar, Term& output) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_SOLVER_CHECK_TERM(conj);
//////// all checks before this line
void Solver::blockModel() const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_CHECK(d_smtEngine->getOptions().smt.produceModels)
<< "Cannot get value unless model generation is enabled "
void Solver::blockModelValues(const std::vector<Term>& terms) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_CHECK(d_smtEngine->getOptions().smt.produceModels)
<< "Cannot get value unless model generation is enabled "
void Solver::printInstantiations(std::ostream& out) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
//////// all checks before this line
d_smtEngine->printInstantiations(out);
void Solver::push(uint32_t nscopes) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_CHECK(d_smtEngine->getOptions().base.incrementalSolving)
<< "Cannot push when not solving incrementally (use --incremental)";
void Solver::addSygusConstraint(const Term& term) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_SOLVER_CHECK_TERM(term);
CVC5_API_ARG_CHECK_EXPECTED(
void Solver::addSygusAssume(const Term& term) const
{
- NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_SOLVER_CHECK_TERM(term);
CVC5_API_ARG_CHECK_EXPECTED(