==========
The CVC5 API communicates certain errors using exceptions. We broadly
-distinguish two types of exceptions: :cpp:class:`CVC4ApiException
-<cvc5::api::CVC4ApiException>` and :cpp:class:`CVC4ApiRecoverableException
-<cvc5::api::CVC4ApiRecoverableException>` (which is derived from
-:cpp:class:`CVC4ApiException <cvc5::api::CVC4ApiException>`).
+distinguish two types of exceptions: :cpp:class:`CVC5ApiException
+<cvc5::api::CVC5ApiException>` and :cpp:class:`CVC5ApiRecoverableException
+<cvc5::api::CVC5ApiRecoverableException>` (which is derived from
+:cpp:class:`CVC5ApiException <cvc5::api::CVC5ApiException>`).
-If any method fails with a :cpp:class:`CVC4ApiRecoverableException
-<cvc5::api::CVC4ApiRecoverableException>`, the solver behaves as if the failing
+If any method fails with a :cpp:class:`CVC5ApiRecoverableException
+<cvc5::api::CVC5ApiRecoverableException>`, the solver behaves as if the failing
method was not called. The solver can still be used safely.
-If, however, a method fails with a :cpp:class:`CVC4ApiException
-<cvc5::api::CVC4ApiException>`, the associated object may be in an unsafe state
+If, however, a method fails with a :cpp:class:`CVC5ApiException
+<cvc5::api::CVC5ApiException>`, the associated object may be in an unsafe state
and it should no longer be used.
-.. doxygenclass:: cvc5::api::CVC4ApiException
+.. doxygenclass:: cvc5::api::CVC5ApiException
:project: cvc5
:members:
:undoc-members:
-.. doxygenclass:: cvc5::api::CVC4ApiRecoverableException
+.. doxygenclass:: cvc5::api::CVC5ApiRecoverableException
:project: cvc5
:members:
:undoc-members:
* The only special case is when we use 3rd party back-ends we have no control
* over, and which throw (invalid_argument) exceptions anyways. In this case,
* we do not replicate argument checks but delegate them to the back-end,
- * catch thrown exceptions, and raise a CVC4ApiException.
+ * catch thrown exceptions, and raise a CVC5ApiException.
*
* Our Integer implementation, e.g., is such a special case since we support
* two different back end implementations (GMP, CLN). Be aware that they do
namespace {
-class CVC4ApiExceptionStream
+class CVC5ApiExceptionStream
{
public:
- CVC4ApiExceptionStream() {}
+ CVC5ApiExceptionStream() {}
/* Note: This needs to be explicitly set to 'noexcept(false)' since it is
* a destructor that throws an exception and in C++11 all destructors
* default to noexcept(true) (else this triggers a call to std::terminate). */
- ~CVC4ApiExceptionStream() noexcept(false)
+ ~CVC5ApiExceptionStream() noexcept(false)
{
if (std::uncaught_exceptions() == 0)
{
- throw CVC4ApiException(d_stream.str());
+ throw CVC5ApiException(d_stream.str());
}
}
std::stringstream d_stream;
};
-class CVC4ApiRecoverableExceptionStream
+class CVC5ApiRecoverableExceptionStream
{
public:
- CVC4ApiRecoverableExceptionStream() {}
+ CVC5ApiRecoverableExceptionStream() {}
/* Note: This needs to be explicitly set to 'noexcept(false)' since it is
* a destructor that throws an exception and in C++11 all destructors
* default to noexcept(true) (else this triggers a call to std::terminate). */
- ~CVC4ApiRecoverableExceptionStream() noexcept(false)
+ ~CVC5ApiRecoverableExceptionStream() noexcept(false)
{
if (std::uncaught_exceptions() == 0)
{
- throw CVC4ApiRecoverableException(d_stream.str());
+ throw CVC5ApiRecoverableException(d_stream.str());
}
}
} \
catch (const UnrecognizedOptionException& e) \
{ \
- throw CVC4ApiRecoverableException(e.getMessage()); \
+ throw CVC5ApiRecoverableException(e.getMessage()); \
} \
catch (const cvc5::RecoverableModalException& e) \
{ \
- throw CVC4ApiRecoverableException(e.getMessage()); \
+ throw CVC5ApiRecoverableException(e.getMessage()); \
} \
- catch (const cvc5::Exception& e) { throw CVC4ApiException(e.getMessage()); } \
- catch (const std::invalid_argument& e) { throw CVC4ApiException(e.what()); }
+ catch (const cvc5::Exception& e) { throw CVC5ApiException(e.getMessage()); } \
+ catch (const std::invalid_argument& e) { throw CVC5ApiException(e.what()); }
} // namespace
catch (const std::invalid_argument& e)
{
/* Catch to throw with a more meaningful error message. To be caught in
- * enclosing CVC5_API_TRY_CATCH_* block to throw CVC4ApiException. */
+ * enclosing CVC5_API_TRY_CATCH_* block to throw CVC5ApiException. */
std::stringstream message;
message << "Cannot construct Real or Int from string argument '" << s << "'"
<< std::endl;
if (kind == INTS_DIVISION || kind == XOR || kind == MINUS
|| kind == DIVISION || kind == HO_APPLY || kind == REGEXP_DIFF)
{
- // left-associative, but CVC4 internally only supports 2 args
+ // left-associative, but cvc5 internally only supports 2 args
res = d_nodeMgr->mkLeftAssociative(k, echildren);
}
else if (kind == IMPLIES)
{
- // right-associative, but CVC4 internally only supports 2 args
+ // right-associative, but cvc5 internally only supports 2 args
res = d_nodeMgr->mkRightAssociative(k, echildren);
}
else if (kind == EQUAL || kind == LT || kind == GT || kind == LEQ
|| kind == GEQ)
{
- // "chainable", but CVC4 internally only supports 2 args
+ // "chainable", but cvc5 internally only supports 2 args
res = d_nodeMgr->mkChain(k, echildren);
}
else if (kind::isAssociative(k))
NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_CHECK(Configuration::isBuiltWithSymFPU())
- << "Expected CVC4 to be compiled with SymFPU support";
+ << "Expected cvc5 to be compiled with SymFPU support";
//////// all checks before this line
return Sort(this, getNodeManager()->roundingModeType());
////////
NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_CHECK(Configuration::isBuiltWithSymFPU())
- << "Expected CVC4 to be compiled with SymFPU support";
+ << "Expected cvc5 to be compiled with SymFPU support";
CVC5_API_ARG_CHECK_EXPECTED(exp > 0, exp) << "exponent size > 0";
CVC5_API_ARG_CHECK_EXPECTED(sig > 0, sig) << "significand size > 0";
//////// all checks before this line
NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_CHECK(Configuration::isBuiltWithSymFPU())
- << "Expected CVC4 to be compiled with SymFPU support";
+ << "Expected cvc5 to be compiled with SymFPU support";
//////// all checks before this line
return mkValHelper<cvc5::FloatingPoint>(
FloatingPoint::makeInf(FloatingPointSize(exp, sig), false));
NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_CHECK(Configuration::isBuiltWithSymFPU())
- << "Expected CVC4 to be compiled with SymFPU support";
+ << "Expected cvc5 to be compiled with SymFPU support";
//////// all checks before this line
return mkValHelper<cvc5::FloatingPoint>(
FloatingPoint::makeInf(FloatingPointSize(exp, sig), true));
NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_CHECK(Configuration::isBuiltWithSymFPU())
- << "Expected CVC4 to be compiled with SymFPU support";
+ << "Expected cvc5 to be compiled with SymFPU support";
//////// all checks before this line
return mkValHelper<cvc5::FloatingPoint>(
FloatingPoint::makeNaN(FloatingPointSize(exp, sig)));
NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_CHECK(Configuration::isBuiltWithSymFPU())
- << "Expected CVC4 to be compiled with SymFPU support";
+ << "Expected cvc5 to be compiled with SymFPU support";
//////// all checks before this line
return mkValHelper<cvc5::FloatingPoint>(
FloatingPoint::makeZero(FloatingPointSize(exp, sig), false));
NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_CHECK(Configuration::isBuiltWithSymFPU())
- << "Expected CVC4 to be compiled with SymFPU support";
+ << "Expected cvc5 to be compiled with SymFPU support";
//////// all checks before this line
return mkValHelper<cvc5::FloatingPoint>(
FloatingPoint::makeZero(FloatingPointSize(exp, sig), true));
NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_CHECK(Configuration::isBuiltWithSymFPU())
- << "Expected CVC4 to be compiled with SymFPU support";
+ << "Expected cvc5 to be compiled with SymFPU support";
//////// all checks before this line
return mkValHelper<cvc5::RoundingMode>(s_rmodes.at(rm));
////////
NodeManagerScope scope(getNodeManager());
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_CHECK(Configuration::isBuiltWithSymFPU())
- << "Expected CVC4 to be compiled with SymFPU support";
+ << "Expected cvc5 to be compiled with SymFPU support";
CVC5_API_SOLVER_CHECK_TERM(val);
CVC5_API_ARG_CHECK_EXPECTED(exp > 0, exp) << "a value > 0";
CVC5_API_ARG_CHECK_EXPECTED(sig > 0, sig) << "a value > 0";
* Base class for all API exceptions.
* If thrown, all API objects may be in an unsafe state.
*/
-class CVC4_EXPORT CVC4ApiException : public std::exception
+class CVC4_EXPORT CVC5ApiException : public std::exception
{
public:
/**
* Construct with message from a string.
* @param str The error message.
*/
- CVC4ApiException(const std::string& str) : d_msg(str) {}
+ CVC5ApiException(const std::string& str) : d_msg(str) {}
/**
* Construct with message from a string stream.
* @param stream The error message.
*/
- CVC4ApiException(const std::stringstream& stream) : d_msg(stream.str()) {}
+ CVC5ApiException(const std::stringstream& stream) : d_msg(stream.str()) {}
/**
* Retrieve the message from this exception.
* @return The error message.
* A recoverable API exception.
* If thrown, API objects can still be used.
*/
-class CVC4_EXPORT CVC4ApiRecoverableException : public CVC4ApiException
+class CVC4_EXPORT CVC5ApiRecoverableException : public CVC5ApiException
{
public:
/**
* Construct with message from a string.
* @param str The error message.
*/
- CVC4ApiRecoverableException(const std::string& str) : CVC4ApiException(str) {}
+ CVC5ApiRecoverableException(const std::string& str) : CVC5ApiException(str) {}
/**
* Construct with message from a string stream.
* @param stream The error message.
*/
- CVC4ApiRecoverableException(const std::stringstream& stream)
- : CVC4ApiException(stream.str())
+ CVC5ApiRecoverableException(const std::stringstream& stream)
+ : CVC5ApiException(stream.str())
{
}
};
/**
* Return true if query was a checkSat() or checkSatAssuming() query and
- * CVC4 was not able to determine (un)satisfiability.
+ * cvc5 was not able to determine (un)satisfiability.
*/
bool isSatUnknown() const;
bool isNotEntailed() const;
/**
- * Return true if query was a checkEntailed() () query and CVC4 was not able
+ * Return true if query was a checkEntailed() () query and cvc5 was not able
* to determine if it is entailed.
*/
bool isEntailmentUnknown() const;
class Datatype;
/**
- * The sort of a CVC4 term.
+ * The sort of a cvc5 term.
*/
class CVC4_EXPORT Sort
{
/* -------------------------------------------------------------------------- */
/**
- * A CVC4 operator.
+ * A cvc5 operator.
* An operator is a term that represents certain operators, instantiated
* with its required parameters, e.g., a term of kind BITVECTOR_EXTRACT.
*/
/* -------------------------------------------------------------------------- */
/**
- * A CVC4 Term.
+ * A cvc5 Term.
*/
class CVC4_EXPORT Term
{
class DatatypeIterator;
/**
- * A CVC4 datatype constructor declaration.
+ * A cvc5 datatype constructor declaration.
*/
class CVC4_EXPORT DatatypeConstructorDecl
{
class Solver;
/**
- * A CVC4 datatype declaration.
+ * A cvc5 datatype declaration.
*/
class CVC4_EXPORT DatatypeDecl
{
};
/**
- * A CVC4 datatype selector.
+ * A cvc5 datatype selector.
*/
class CVC4_EXPORT DatatypeSelector
{
};
/**
- * A CVC4 datatype constructor.
+ * A cvc5 datatype constructor.
*/
class CVC4_EXPORT DatatypeConstructor
{
};
/**
- * A CVC4 datatype.
+ * A cvc5 datatype.
*/
class CVC4_EXPORT Datatype
{
* Rounding modes for floating-point numbers.
*
* For many floating-point operations, infinitely precise results may not be
- * representable with the number of available bits. Thus, the results are rounded in
- * a certain way to one of the representable floating-point numbers.
+ * representable with the number of available bits. Thus, the results are
+ * rounded in a certain way to one of the representable floating-point numbers.
*
* \verbatim embed:rst:leading-asterisk
* These rounding modes directly follow the SMT-LIB theory for floating-point
/* -------------------------------------------------------------------------- */
/**
- * A CVC4 solver.
+ * A cvc5 solver.
*/
class CVC4_EXPORT Solver
{
Sort getBooleanSort() const;
/**
- * @return sort Integer (in CVC4, Integer is a subtype of Real)
+ * @return sort Integer (in cvc5, Integer is a subtype of Real)
*/
Sort getIntegerSort() const;
Term mkConstArray(const Sort& sort, const Term& val) const;
/**
- * Create a positive infinity floating-point constant. Requires CVC4 to be
+ * Create a positive infinity floating-point constant. Requires cvc5 to be
* compiled with SymFPU support.
* @param exp Number of bits in the exponent
* @param sig Number of bits in the significand
Term mkPosInf(uint32_t exp, uint32_t sig) const;
/**
- * Create a negative infinity floating-point constant. Requires CVC4 to be
+ * Create a negative infinity floating-point constant. Requires cvc5 to be
* compiled with SymFPU support.
* @param exp Number of bits in the exponent
* @param sig Number of bits in the significand
Term mkNegInf(uint32_t exp, uint32_t sig) const;
/**
- * Create a not-a-number (NaN) floating-point constant. Requires CVC4 to be
+ * Create a not-a-number (NaN) floating-point constant. Requires cvc5 to be
* compiled with SymFPU support.
* @param exp Number of bits in the exponent
* @param sig Number of bits in the significand
Term mkNaN(uint32_t exp, uint32_t sig) const;
/**
- * Create a positive zero (+0.0) floating-point constant. Requires CVC4 to be
+ * Create a positive zero (+0.0) floating-point constant. Requires cvc5 to be
* compiled with SymFPU support.
* @param exp Number of bits in the exponent
* @param sig Number of bits in the significand
Term mkPosZero(uint32_t exp, uint32_t sig) const;
/**
- * Create a negative zero (-0.0) floating-point constant. Requires CVC4 to be
+ * Create a negative zero (-0.0) floating-point constant. Requires cvc5 to be
* compiled with SymFPU support.
* @param exp Number of bits in the exponent
* @param sig Number of bits in the significand
Term mkAbstractValue(uint64_t index) const;
/**
- * Create a floating-point constant (requires CVC4 to be compiled with symFPU
+ * Create a floating-point constant (requires cvc5 to be compiled with symFPU
* support).
* @param exp Size of the exponent
* @param sig Size of the significand
/**
* The base check macro.
- * Throws a CVC4ApiException if 'cond' is false.
+ * Throws a CVC5ApiException if 'cond' is false.
*/
#define CVC5_API_CHECK(cond) \
CVC5_PREDICT_TRUE(cond) \
- ? (void)0 : OstreamVoider() & CVC4ApiExceptionStream().ostream()
+ ? (void)0 : OstreamVoider() & CVC5ApiExceptionStream().ostream()
/**
* The base check macro for throwing recoverable exceptions.
- * Throws a CVC4RecoverableApiException if 'cond' is false.
+ * Throws a CVC5ApiRecoverableException if 'cond' is false.
*/
#define CVC5_API_RECOVERABLE_CHECK(cond) \
CVC5_PREDICT_TRUE(cond) \
- ? (void)0 : OstreamVoider() & CVC4ApiRecoverableExceptionStream().ostream()
+ ? (void)0 : OstreamVoider() & CVC5ApiRecoverableExceptionStream().ostream()
/* -------------------------------------------------------------------------- */
/* Not null checks. */
CVC5_PREDICT_TRUE(cond) \
? (void)0 \
: OstreamVoider() \
- & CVC4ApiExceptionStream().ostream() \
+ & CVC5ApiExceptionStream().ostream() \
<< "Invalid kind '" << kindToString(kind) << "', expected "
/* -------------------------------------------------------------------------- */
CVC5_PREDICT_TRUE(cond) \
? (void)0 \
: OstreamVoider() \
- & CVC4ApiExceptionStream().ostream() \
+ & CVC5ApiExceptionStream().ostream() \
<< "Invalid argument '" << arg << "' for '" << #arg \
<< "', expected "
CVC5_PREDICT_TRUE(cond) \
? (void)0 \
: OstreamVoider() \
- & CVC4ApiRecoverableExceptionStream().ostream() \
+ & CVC5ApiRecoverableExceptionStream().ostream() \
<< "Invalid argument '" << arg << "' for '" << #arg \
<< "', expected "
CVC5_PREDICT_TRUE(cond) \
? (void)0 \
: OstreamVoider() \
- & CVC4ApiExceptionStream().ostream() \
+ & CVC5ApiExceptionStream().ostream() \
<< "Invalid size of argument '" << #arg << "', expected "
/**
CVC5_PREDICT_TRUE(cond) \
? (void)0 \
: OstreamVoider() \
- & CVC4ApiExceptionStream().ostream() \
+ & CVC5ApiExceptionStream().ostream() \
<< "Invalid " << (what) << " in '" << #args << "' at index " \
<< (idx) << ", expected "
// TODO(Gereon): Fix links that involve std::vector. See https://github.com/doxygen/doxygen/issues/8503
/**
- * The kind of a CVC4 term.
+ * The kind of a cvc5 term.
*
* Note that the underlying type of Kind must be signed (to enable range
* checks for validity). The size of this type depends on the size of
/**
* Uninterpreted constant.
- *
+ *
* Parameters:
* - 1: Sort of the constant
* - 2: Index of the constant
- *
+ *
* Create with:
* - `Solver::mkUninterpretedConst(const Sort& sort, int32_t index) const`
*/
UNINTERPRETED_CONSTANT,
/**
* Abstract value (other than uninterpreted sort constants).
- *
+ *
* Parameters:
* - 1: Index of the abstract value
- *
+ *
* Create with:
* - `Solver::mkAbstractValue(const std::string& index) const`
* - `Solver::mkAbstractValue(uint64_t index) const`
#endif
/**
* Equality, chainable.
- *
+ *
* Parameters: n > 1
* - 1..n: Terms with same sorts
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
EQUAL,
/**
* Disequality.
- *
+ *
* Parameters: n > 1
* - 1..n: Terms with same sorts
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
DISTINCT,
/**
* First-order constant.
- *
+ *
* Not permitted in bindings (forall, exists, ...).
- *
+ *
* Parameters:
* - See @ref cvc5::api::Solver::mkConst() "mkConst()".
- *
+ *
* Create with:
* - `Solver::mkConst(const Sort& sort, const std::string& symbol) const`
* - `Solver::mkConst(const Sort& sort) const`
CONSTANT,
/**
* (Bound) variable.
- *
+ *
* Permitted in bindings and in the lambda and quantifier bodies only.
- *
+ *
* Parameters:
* - See @ref cvc5::api::Solver::mkVar() "mkVar()".
- *
+ *
* Create with:
* - `Solver::mkVar(const Sort& sort, const std::string& symbol) const`
*/
#endif
/**
* Symbolic expression.
- *
+ *
* Parameters: n > 0
* - 1..n: terms
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
SEXPR,
/**
* Lambda expression.
- *
+ *
* Parameters:
* - 1: BOUND_VAR_LIST
* - 2: Lambda body
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
* (see https://planetmath.org/hilbertsvarepsilonoperator) if there is no x
* that satisfies F. But if such x exists, the witness operator does not
* enforce the axiom that ensures uniqueness up to logical equivalence:
- *
+ *
* @f[
* \forall x. F \equiv G \Rightarrow witness~x. F = witness~x. G
* @f]
*
* For example if there are 2 elements of type T that satisfy F, then the
* following formula is satisfiable:
- *
+ *
* (distinct
* (witness ((x Int)) F)
* (witness ((x Int)) F))
* Parameters:
* - 1: BOUND_VAR_LIST
* - 2: Witness body
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
/**
* Boolean constant.
- *
+ *
* Parameters:
* - 1: Boolean value of the constant
- *
+ *
* Create with:
* - `Solver::mkTrue() const`
* - `Solver::mkFalse() const`
CONST_BOOLEAN,
/**
* Logical negation.
- *
+ *
* Parameters:
* - 1: Boolean Term to negate
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
NOT,
/**
* Logical conjunction.
- *
+ *
* Parameters: n > 1
* - 1..n: Boolean Term of the conjunction
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
AND,
/**
* Logical implication.
- *
+ *
* Parameters: n > 1
* - 1..n: Boolean Terms, right associative
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
IMPLIES,
/**
* Logical disjunction.
- *
+ *
* Parameters: n > 1
* - 1..n: Boolean Term of the disjunction
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
OR,
/**
* Logical exclusive disjunction, left associative.
- *
+ *
* Parameters: n > 1
* - 1..n: Boolean Terms, `[1] xor ... xor [n]`
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
XOR,
/**
* If-then-else.
- *
+ *
* Parameters:
* - 1: is a Boolean condition Term
* - 2: the 'then' Term
* - 3: the 'else' Term
*
* 'then' and 'else' term must have same base sort.
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
/**
* Application of an uninterpreted function.
- *
+ *
* Parameters: n > 1
* - 1: Function Term
* - 2..n: Function argument instantiation Terms
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
* Cardinality constraint on uninterpreted sort S.
* Interpreted as a predicate that is true when the cardinality of S
* is less than or equal to the value of the second argument.
- *
+ *
* Parameters:
* - 1: Term of sort S
* - 2: Positive integer constant that bounds the cardinality of sort S
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
* Cardinality value for uninterpreted sort S.
* An operator that returns an integer indicating the value of the cardinality
* of sort S.
- *
+ *
* Parameters:
* - 1: Term of sort S
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
/**
* Higher-order applicative encoding of function application, left
* associative.
- *
+ *
* Parameters: n > 1
* - 1: Function to apply
* - 2..n: Arguments of the function
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
/**
* Arithmetic addition.
- *
+ *
* Parameters: n > 1
* - 1..n: Terms of sort Integer, Real (sorts must match)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
PLUS,
/**
* Arithmetic multiplication.
- *
+ *
* Parameters: n > 1
* - 1..n: Terms of sort Integer, Real (sorts must match)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
MULT,
/**
* Operator for Integer AND
- *
+ *
* Parameters:
* - 1: Size of the bit-vector that determines the semantics of the IAND
- *
+ *
* Create with:
* - `Solver::mkOp(Kind kind, uint32_t param) const`
*
* - 1: Op of kind IAND
* - 2: Integer term
* - 3: Integer term
- *
+ *
* Create with:
* - `Solver::mkTerm(const Op& op, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(const Op& op, const std::vector<Term>& children) const`
#endif
/**
* Arithmetic subtraction, left associative.
- *
+ *
* Parameters:
* - 1..n: Terms of sort Integer, Real (sorts must match)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
MINUS,
/**
* Arithmetic negation.
- *
+ *
* Parameters:
* - 1: Term of sort Integer, Real
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
UMINUS,
/**
* Real division, division by 0 undefined, left associative.
- *
+ *
* Parameters: n > 1
* - 1..n: Terms of sort Integer, Real
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
DIVISION,
/**
* Integer division, division by 0 undefined, left associative.
- *
+ *
* Parameters: n > 1
* - 1..n: Terms of sort Integer
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
INTS_DIVISION,
/**
* Integer modulus, division by 0 undefined.
- *
+ *
* Parameters:
* - 1: Term of sort Integer
* - 2: Term of sort Integer
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
INTS_MODULUS,
/**
* Absolute value.
- *
+ *
* Parameters:
* - 1: Term of sort Integer
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
ABS,
/**
* Arithmetic power.
- *
+ *
* Parameters:
* - 1: Term of sort Integer, Real
* - 2: Term of sort Integer, Real
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
POW,
/**
* Exponential function.
- *
+ *
* Parameters:
* - 1: Term of sort Integer, Real
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
EXPONENTIAL,
/**
* Sine function.
- *
+ *
* Parameters:
* - 1: Term of sort Integer, Real
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
SINE,
/**
* Cosine function.
- *
+ *
* Parameters:
* - 1: Term of sort Integer, Real
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
COSINE,
/**
* Tangent function.
- *
+ *
* Parameters:
* - 1: Term of sort Integer, Real
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
TANGENT,
/**
* Cosecant function.
- *
+ *
* Parameters:
* - 1: Term of sort Integer, Real
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
COSECANT,
/**
* Secant function.
- *
+ *
* Parameters:
* - 1: Term of sort Integer, Real
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
SECANT,
/**
* Cotangent function.
- *
+ *
* Parameters:
* - 1: Term of sort Integer, Real
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
COTANGENT,
/**
* Arc sine function.
- *
+ *
* Parameters:
* - 1: Term of sort Integer, Real
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
ARCSINE,
/**
* Arc cosine function.
- *
+ *
* Parameters:
* - 1: Term of sort Integer, Real
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
ARCCOSINE,
/**
* Arc tangent function.
- *
+ *
* Parameters:
* - 1: Term of sort Integer, Real
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
ARCTANGENT,
/**
* Arc cosecant function.
- *
+ *
* Parameters:
* - 1: Term of sort Integer, Real
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
ARCCOSECANT,
/**
* Arc secant function.
- *
+ *
* Parameters:
* - 1: Term of sort Integer, Real
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
ARCSECANT,
/**
* Arc cotangent function.
- *
+ *
* Parameters:
* - 1: Term of sort Integer, Real
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
ARCCOTANGENT,
/**
* Square root.
- *
+ *
* Parameters:
* - 1: Term of sort Integer, Real
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
SQRT,
/**
* Operator for the divisibility-by-k predicate.
- *
+ *
* Parameter:
* - 1: The k to divide by (sort Integer)
- *
+ *
* Create with:
* - `Solver::mkOp(Kind kind, uint32_t param) const`
*
* Apply divisibility-by-k predicate.
- *
+ *
* Parameters:
* - 1: Op of kind DIVISIBLE
* - 2: Integer Term
- *
+ *
* Create with:
* - `Solver::mkTerm(const Op& op, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(const Op& op, const std::vector<Term>& children) const`
DIVISIBLE,
/**
* Multiple-precision rational constant.
- *
+ *
* Parameters:
* See @ref cvc5::api::Solver::mkInteger() "mkInteger()", @ref cvc5::api::Solver::mkReal() "mkReal()".
- *
+ *
* Create with:
* - `Solver::mkInteger(const std::string& s) const`
* - `Solver::mkInteger(int64_t val) const`
CONST_RATIONAL,
/**
* Less than, chainable.
- *
+ *
* Parameters: n
* - 1..n: Terms of sort Integer, Real; [1] < ... < [n]
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
LT,
/**
* Less than or equal, chainable.
- *
+ *
* Parameters: n > 1
* - 1..n: Terms of sort Integer, Real; [1] <= ... <= [n]
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
LEQ,
/**
* Greater than, chainable.
- *
+ *
* Parameters: n > 1
* - 1..n: Terms of sort Integer, Real, [1] > ... > [n]
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
GT,
/**
* Greater than or equal, chainable.
- *
+ *
* Parameters: n > 1
* - 1..n: Terms of sort Integer, Real; [1] >= ... >= [n]
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
GEQ,
/**
* Is-integer predicate.
- *
+ *
* Parameters:
* - 1: Term of sort Integer, Real
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
IS_INTEGER,
/**
* Convert Term to Integer by the floor function.
- *
+ *
* Parameters:
* - 1: Term of sort Integer, Real
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
TO_INTEGER,
/**
* Convert Term to Real.
- *
+ *
* Parameters:
- *
+ *
* - 1: Term of sort Integer, Real
- *
- * This is a no-op in CVC4, as Integer is a subtype of Real.
+ *
+ * This is a no-op in cvc5, as Integer is a subtype of Real.
*/
TO_REAL,
/**
* Pi constant.
- *
+ *
* Create with:
* - `Solver::mkPi() const`
* - `Solver::mkTerm(Kind kind) const`
/**
* Fixed-size bit-vector constant.
- *
+ *
* Parameters:
* See @ref cvc5::api::Solver::mkBitVector() "mkBitVector()".
- *
+ *
* Create with:
* - `Solver::mkBitVector(uint32_t size, uint64_t val) const`
* - `Solver::mkBitVector(const std::string& s, uint32_t base) const`
CONST_BITVECTOR,
/**
* Concatenation of two or more bit-vectors.
- *
+ *
* Parameters: n > 1
* - 1..n: Terms of bit-vector sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
BITVECTOR_CONCAT,
/**
* Bit-wise and.
- *
+ *
* Parameters: n > 1
* - 1..n: Terms of bit-vector sort (sorts must match)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
BITVECTOR_AND,
/**
* Bit-wise or.
- *
+ *
* Parameters: n > 1
* - 1..n: Terms of bit-vector sort (sorts must match)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
BITVECTOR_OR,
/**
* Bit-wise xor.
- *
+ *
* Parameters: n > 1
* - 1..n: Terms of bit-vector sort (sorts must match)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
BITVECTOR_XOR,
/**
* Bit-wise negation.
- *
+ *
* Parameters:
* - 1: Term of bit-vector sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
BITVECTOR_NOT,
/**
* Bit-wise nand.
- *
+ *
* Parameters:
* - 1..2: Terms of bit-vector sort (sorts must match)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
BITVECTOR_NAND,
/**
* Bit-wise nor.
- *
+ *
* Parameters:
* - 1..2: Terms of bit-vector sort (sorts must match)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
BITVECTOR_NOR,
/**
* Bit-wise xnor, left associative.
- *
+ *
* Parameters: n > 1
* - 1..n: Terms of bit-vector sort (sorts must match)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
BITVECTOR_XNOR,
/**
* Equality comparison (returns bit-vector of size 1).
- *
+ *
* Parameters:
* - 1..2: Terms of bit-vector sort (sorts must match)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
BITVECTOR_COMP,
/**
* Multiplication of two or more bit-vectors.
- *
+ *
* Parameters: n > 1
* - 1..n: Terms of bit-vector sort (sorts must match)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
BITVECTOR_MULT,
/**
* Addition of two or more bit-vectors.
- *
+ *
* Parameters: n > 1
* - 1..n: Terms of bit-vector sort (sorts must match)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
BITVECTOR_PLUS,
/**
* Subtraction of two bit-vectors.
- *
+ *
* Parameters:
* - 1..2: Terms of bit-vector sort (sorts must match)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
BITVECTOR_SUB,
/**
* Negation of a bit-vector (two's complement).
- *
+ *
* Parameters:
* - 1: Term of bit-vector sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
*
* Parameters:
* - 1..2: Terms of bit-vector sort (sorts must match)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
*
* Parameters:
* - 1..2: Terms of bit-vector sort (sorts must match)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
*
* Parameters:
* - 1..2: Terms of bit-vector sort (sorts must match)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
*
* Parameters:
* - 1..2: Terms of bit-vector sort (sorts must match)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
*
* Parameters:
* - 1..2: Terms of bit-vector sort (sorts must match)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
/**
* Bit-vector shift left.
* The two bit-vector parameters must have same width.
- *
+ *
* Parameters:
* - 1..2: Terms of bit-vector sort (sorts must match)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
/**
* Bit-vector logical shift right.
* The two bit-vector parameters must have same width.
- *
+ *
* Parameters:
* - 1..2: Terms of bit-vector sort (sorts must match)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
/**
* Bit-vector arithmetic shift right.
* The two bit-vector parameters must have same width.
- *
+ *
* Parameters:
* - 1..2: Terms of bit-vector sort (sorts must match)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
/**
* Bit-vector unsigned less than.
* The two bit-vector parameters must have same width.
- *
+ *
* Parameters:
* - 1..2: Terms of bit-vector sort (sorts must match)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
/**
* Bit-vector unsigned less than or equal.
* The two bit-vector parameters must have same width.
- *
+ *
* Parameters:
* - 1..2: Terms of bit-vector sort (sorts must match)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
/**
* Bit-vector unsigned greater than.
* The two bit-vector parameters must have same width.
- *
+ *
* Parameters:
* - 1..2: Terms of bit-vector sort (sorts must match)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
/**
* Bit-vector unsigned greater than or equal.
* The two bit-vector parameters must have same width.
- *
+ *
* Parameters:
* - 1..2: Terms of bit-vector sort (sorts must match)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
/**
* Bit-vector signed less than.
* The two bit-vector parameters must have same width.
- *
+ *
* Parameters:
* - 1..2: Terms of bit-vector sort (sorts must match)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
/**
* Bit-vector signed less than or equal.
* The two bit-vector parameters must have same width.
- *
+ *
* Parameters:
* - 1..2: Terms of bit-vector sort (sorts must match)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
/**
* Bit-vector signed greater than.
* The two bit-vector parameters must have same width.
- *
+ *
* Parameters:
* - 1..2: Terms of bit-vector sort (sorts must match)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
/**
* Bit-vector signed greater than or equal.
* The two bit-vector parameters must have same width.
- *
+ *
* Parameters:
* - 1..2: Terms of bit-vector sort (sorts must match)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
BITVECTOR_SGE,
/**
* Bit-vector unsigned less than, returns bit-vector of size 1.
- *
+ *
* Parameters:
* - 1..2: Terms of bit-vector sort (sorts must match)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
BITVECTOR_ULTBV,
/**
* Bit-vector signed less than. returns bit-vector of size 1.
- *
+ *
* Parameters:
* - 1..2: Terms of bit-vector sort (sorts must match)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
BITVECTOR_SLTBV,
/**
* Same semantics as regular ITE, but condition is bit-vector of size 1.
- *
+ *
* Parameters:
* - 1: Term of bit-vector sort of size 1, representing the condition
* - 2: Term reprsenting the 'then' branch
* - 3: Term representing the 'else' branch
- *
+ *
* 'then' and 'else' term must have same base sort.
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
BITVECTOR_ITE,
/**
* Bit-vector redor.
- *
+ *
* Parameters:
* - 1: Term of bit-vector sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
BITVECTOR_REDOR,
/**
* Bit-vector redand.
- *
+ *
* Parameters:
* - 1: Term of bit-vector sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
#endif
/**
* Operator for bit-vector extract (from index 'high' to 'low').
- *
+ *
* Parameters:
* - 1: The 'high' index
* - 2: The 'low' index
- *
+ *
* Create with:
* - `Solver::mkOp(Kind kind, uint32_t param, uint32_t param) const`
*
* Apply bit-vector extract.
- *
+ *
* Parameters:
* - 1: Op of kind BITVECTOR_EXTRACT
* - 2: Term of bit-vector sort
- *
+ *
* Create with:
* - `Solver::mkTerm(const Op& op, const Term& child) const`
* - `Solver::mkTerm(const Op& op, const std::vector<Term>& children) const`
BITVECTOR_EXTRACT,
/**
* Operator for bit-vector repeat.
- *
+ *
* Parameter:
* - 1: Number of times to repeat a given bit-vector
- *
+ *
* Create with:
* - `Solver::mkOp(Kind kind, uint32_t param) const`.
*
* Apply bit-vector repeat.
- *
+ *
* Parameters:
* - 1: Op of kind BITVECTOR_REPEAT
* - 2: Term of bit-vector sort
- *
+ *
* Create with:
* - `Solver::mkTerm(const Op& op, const Term& child) const`
* - `Solver::mkTerm(const Op& op, const std::vector<Term>& children) const`
BITVECTOR_REPEAT,
/**
* Operator for bit-vector zero-extend.
- *
+ *
* Parameter:
* - 1: Number of bits by which a given bit-vector is to be extended
- *
+ *
* Create with:
* - `Solver::mkOp(Kind kind, uint32_t param) const`.
*
* Apply bit-vector zero-extend.
- *
+ *
* Parameters:
* - 1: Op of kind BITVECTOR_ZERO_EXTEND
* - 2: Term of bit-vector sort
- *
+ *
* Create with:
* - `Solver::mkTerm(const Op& op, const Term& child) const`
* - `Solver::mkTerm(const Op& op, const std::vector<Term>& children) const`
BITVECTOR_ZERO_EXTEND,
/**
* Operator for bit-vector sign-extend.
- *
+ *
* Parameter:
* - 1: Number of bits by which a given bit-vector is to be extended
- *
+ *
* Create with:
* - `Solver::mkOp(Kind kind, uint32_t param) const`.
*
* Apply bit-vector sign-extend.
- *
+ *
* Parameters:
* - 1: Op of kind BITVECTOR_SIGN_EXTEND
* - 2: Term of bit-vector sort
- *
+ *
* Create with:
* - `Solver::mkTerm(const Op& op, const Term& child) const`
* - `Solver::mkTerm(const Op& op, const std::vector<Term>& children) const`
BITVECTOR_SIGN_EXTEND,
/**
* Operator for bit-vector rotate left.
- *
+ *
* Parameter:
* - 1: Number of bits by which a given bit-vector is to be rotated
- *
+ *
* Create with:
* - `Solver::mkOp(Kind kind, uint32_t param) const`.
*
* Apply bit-vector rotate left.
- *
+ *
* Parameters:
* - 1: Op of kind BITVECTOR_ROTATE_LEFT
* - 2: Term of bit-vector sort
- *
+ *
* Create with:
* - `Solver::mkTerm(const Op& op, const Term& child) const`
* - `Solver::mkTerm(const Op& op, const std::vector<Term>& children) const`
BITVECTOR_ROTATE_LEFT,
/**
* Operator for bit-vector rotate right.
- *
+ *
* Parameter:
* - 1: Number of bits by which a given bit-vector is to be rotated
- *
+ *
* Create with:
* - `Solver::mkOp(Kind kind, uint32_t param) const`.
*
* Apply bit-vector rotate right.
- *
+ *
* Parameters:
* - 1: Op of kind BITVECTOR_ROTATE_RIGHT
* - 2: Term of bit-vector sort
- *
+ *
* Create with:
* - `Solver::mkTerm(const Op& op, const Term& child) const`
* - `Solver::mkTerm(const Op& op, const std::vector<Term>& children) const`
#endif
/**
* Operator for the conversion from Integer to bit-vector.
- *
+ *
* Parameter:
* - 1: Size of the bit-vector to convert to
- *
+ *
* Create with:
* - `Solver::mkOp(Kind kind, uint32_t param) const`.
*
* Apply integer conversion to bit-vector.
- *
+ *
* Parameters:
* - 1: Op of kind INT_TO_BITVECTOR
* - 2: Integer term
- *
+ *
* Create with:
* - `Solver::mkTerm(const Op& op, const Term& child) const`
* - `Solver::mkTerm(const Op& op, const std::vector<Term>& children) const`
INT_TO_BITVECTOR,
/**
* Bit-vector conversion to (nonnegative) integer.
- *
+ *
* Parameter:
* - 1: Term of bit-vector sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
/**
* Floating-point constant, constructed from a double or string.
- *
+ *
* Parameters:
* - 1: Size of the exponent
* - 2: Size of the significand
* - 3: Value of the floating-point constant as a bit-vector term
- *
+ *
* Create with:
* - `Solver::mkFloatingPoint(uint32_t exp, uint32_t sig, Term val) const`
*/
CONST_FLOATINGPOINT,
/**
* Floating-point rounding mode term.
- *
+ *
* Create with:
* - `Solver::mkRoundingMode(RoundingMode rm) const`
*/
CONST_ROUNDINGMODE,
/**
* Create floating-point literal from bit-vector triple.
- *
+ *
* Parameters:
* - 1: Sign bit as a bit-vector term
* - 2: Exponent bits as a bit-vector term
* - 3: Significand bits as a bit-vector term (without hidden bit)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
FLOATINGPOINT_FP,
/**
* Floating-point equality.
- *
+ *
* Parameters:
* - 1..2: Terms of floating point sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
FLOATINGPOINT_EQ,
/**
* Floating-point absolute value.
- *
+ *
* Parameters:
* - 1: Term of floating point sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
FLOATINGPOINT_ABS,
/**
* Floating-point negation.
- *
+ *
* Parameters:
* - 1: Term of floating point sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
FLOATINGPOINT_NEG,
/**
* Floating-point addition.
- *
+ *
* Parameters:
* - 1: CONST_ROUNDINGMODE
* - 2: Term of sort FloatingPoint
* - 3: Term of sort FloatingPoint
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
FLOATINGPOINT_PLUS,
/**
* Floating-point sutraction.
- *
+ *
* Parameters:
* - 1: CONST_ROUNDINGMODE
* - 2: Term of sort FloatingPoint
* - 3: Term of sort FloatingPoint
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
FLOATINGPOINT_SUB,
/**
* Floating-point multiply.
- *
+ *
* Parameters:
* - 1: CONST_ROUNDINGMODE
* - 2: Term of sort FloatingPoint
* - 3: Term of sort FloatingPoint
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
FLOATINGPOINT_MULT,
/**
* Floating-point division.
- *
+ *
* Parameters:
* - 1: CONST_ROUNDINGMODE
* - 2: Term of sort FloatingPoint
* - 3: Term of sort FloatingPoint
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
FLOATINGPOINT_DIV,
/**
* Floating-point fused multiply and add.
- *
+ *
* Parameters:
* - 1: CONST_ROUNDINGMODE
* - 2: Term of sort FloatingPoint
* - 3: Term of sort FloatingPoint
* - 4: Term of sort FloatingPoint
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
*/
FLOATINGPOINT_FMA,
/**
* Floating-point square root.
- *
+ *
* Parameters:
* - 1: CONST_ROUNDINGMODE
* - 2: Term of sort FloatingPoint
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
FLOATINGPOINT_SQRT,
/**
* Floating-point remainder.
- *
+ *
* Parameters:
* - 1..2: Terms of floating point sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
FLOATINGPOINT_REM,
/**
* Floating-point round to integral.
- *
+ *
* Parameters:
* -1..2: Terms of floating point sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
FLOATINGPOINT_RTI,
/**
* Floating-point minimum.
- *
+ *
* Parameters:
* - 1..2: Terms of floating point sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
FLOATINGPOINT_MIN,
/**
* Floating-point maximum.
- *
+ *
* Parameters:
* - 1..2: Terms of floating point sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
FLOATINGPOINT_MAX,
/**
* Floating-point less than or equal.
- *
+ *
* Parameters:
* - 1..2: Terms of floating point sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
FLOATINGPOINT_LEQ,
/**
* Floating-point less than.
- *
+ *
* Parameters:
* - 1..2: Terms of floating point sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
FLOATINGPOINT_LT,
/**
* Floating-point greater than or equal.
- *
+ *
* Parameters:
* - 1..2: Terms of floating point sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
FLOATINGPOINT_GEQ,
/**
* Floating-point greater than.
- *
+ *
* Parameters:
* - 1..2: Terms of floating point sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
FLOATINGPOINT_GT,
/**
* Floating-point is normal.
- *
+ *
* Parameters:
* - 1: Term of floating point sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
FLOATINGPOINT_ISN,
/**
* Floating-point is sub-normal.
- *
+ *
* Parameters:
* - 1: Term of floating point sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
FLOATINGPOINT_ISSN,
/**
* Floating-point is zero.
- *
+ *
* Parameters:
* - 1: Term of floating point sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
FLOATINGPOINT_ISZ,
/**
* Floating-point is infinite.
- *
+ *
* Parameters:
* - 1: Term of floating point sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
FLOATINGPOINT_ISINF,
/**
* Floating-point is NaN.
- *
+ *
* Parameters:
* - 1: Term of floating point sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
FLOATINGPOINT_ISNAN,
/**
* Floating-point is negative.
- *
+ *
* Parameters:
* - 1: Term of floating point sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
FLOATINGPOINT_ISNEG,
/**
* Floating-point is positive.
- *
+ *
* Parameters:
* - 1: Term of floating point sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
FLOATINGPOINT_ISPOS,
/**
* Operator for to_fp from bit vector.
- *
+ *
* Parameters:
* - 1: Exponent size
* - 2: Significand size
- *
+ *
* Create with:
* - `Solver::mkOp(Kind kind, uint32_t param1, uint32_t param2) const`
*
* Conversion from an IEEE-754 bit vector to floating-point.
- *
+ *
* Parameters:
* - 1: Op of kind FLOATINGPOINT_TO_FP_IEEE_BITVECTOR
* - 2: Term of sort FloatingPoint
- *
+ *
* Create with:
* - `Solver::mkTerm(const Op& op, const Term& child) const`
* - `Solver::mkTerm(const Op& op, const std::vector<Term>& children) const`
FLOATINGPOINT_TO_FP_IEEE_BITVECTOR,
/**
* Operator for to_fp from floating point.
- *
+ *
* Parameters:
* - 1: Exponent size
* - 2: Significand size
- *
+ *
* Create with:
* - `Solver::mkOp(Kind kind, uint32_t param1, uint32_t param2) const`
*
* Conversion between floating-point sorts.
- *
+ *
* Parameters:
* - 1: Op of kind FLOATINGPOINT_TO_FP_FLOATINGPOINT
* - 2: Term of sort FloatingPoint
- *
+ *
* Create with:
* - `Solver::mkTerm(const Op& op, const Term& child) const`
* - `Solver::mkTerm(const Op& op, const std::vector<Term>& children) const`
FLOATINGPOINT_TO_FP_FLOATINGPOINT,
/**
* Operator for to_fp from real.
- *
+ *
* Parameters:
* - 1: Exponent size
* - 2: Significand size
- *
+ *
* Create with:
* - `Solver::mkOp(Kind kind, uint32_t param1, uint32_t param2) const`
*
* Conversion from a real to floating-point.
- *
+ *
* Parameters:
* - 1: Op of kind FLOATINGPOINT_TO_FP_REAL
* - 2: Term of sort FloatingPoint
- *
+ *
* Create with:
* - `Solver::mkTerm(const Op& op, const Term& child) const`
* - `Solver::mkTerm(const Op& op, const std::vector<Term>& children) const`
FLOATINGPOINT_TO_FP_REAL,
/**
* Operator for to_fp from signed bit vector
- *
+ *
* Parameters:
* - 1: Exponent size
* - 2: Significand size
- *
+ *
* Create with:
* - `Solver::mkOp(Kind kind, uint32_t param1, uint32_t param2) const`
*
* Conversion from a signed bit vector to floating-point.
- *
+ *
* Parameters:
* - 1: Op of kind FLOATINGPOINT_TO_FP_SIGNED_BITVECTOR
* - 2: Term of sort FloatingPoint
- *
+ *
* Create with:
* - `Solver::mkTerm(const Op& op, const Term& child) const`
* - `Solver::mkTerm(const Op& op, const std::vector<Term>& children) const`
FLOATINGPOINT_TO_FP_SIGNED_BITVECTOR,
/**
* Operator for to_fp from unsigned bit vector.
- *
+ *
* Parameters:
* - 1: Exponent size
* - 2: Significand size
- *
+ *
* Create with:
* - `Solver::mkOp(Kind kind, uint32_t param1, uint32_t param2) const`
*
* Converting an unsigned bit vector to floating-point.
- *
+ *
* Parameters:
* - 1: Op of kind FLOATINGPOINT_TO_FP_UNSIGNED_BITVECTOR
* - 2: Term of sort FloatingPoint
- *
+ *
* Create with:
* - `Solver::mkTerm(const Op& op, const Term& child) const`
* - `Solver::mkTerm(const Op& op, const std::vector<Term>& children) const`
FLOATINGPOINT_TO_FP_UNSIGNED_BITVECTOR,
/**
* Operator for a generic to_fp.
- *
+ *
* Parameters:
* - 1: exponent size
* - 2: Significand size
- *
+ *
* Create with:
* - `Solver::mkOp(Kind kind, uint32_t param1, uint32_t param2) const`
*
* Generic conversion to floating-point, used in parsing only.
- *
+ *
* Parameters:
* - 1: Op of kind FLOATINGPOINT_TO_FP_GENERIC
* - 2: Term of sort FloatingPoint
- *
+ *
* Create with:
* - `Solver::mkTerm(const Op& op, const Term& child) const`
* - `Solver::mkTerm(const Op& op, const std::vector<Term>& children) const`
FLOATINGPOINT_TO_FP_GENERIC,
/**
* Operator for to_ubv.
- *
+ *
* Parameters:
* - 1: Size of the bit-vector to convert to
- *
+ *
* Create with:
* - `Solver::mkOp(Kind kind, uint32_t param) const`
*
* Conversion from a floating-point value to an unsigned bit vector.
- *
+ *
* Parameters:
* - 1: Op of kind FLOATINGPOINT_TO_FP_TO_UBV
* - 2: Term of sort FloatingPoint
- *
+ *
* Create with:
* - `Solver::mkTerm(const Op& op, const Term& child) const`
* - `Solver::mkTerm(const Op& op, const std::vector<Term>& children) const`
FLOATINGPOINT_TO_UBV,
/**
* Operator for to_sbv.
- *
+ *
* Parameters:
* - 1: Size of the bit-vector to convert to
- *
+ *
* Create with:
* - `Solver::mkOp(Kind kind, uint32_t param) const`
*
* Conversion from a floating-point value to a signed bit vector.
- *
+ *
* Parameters:
* - 1: Op of kind FLOATINGPOINT_TO_FP_TO_SBV
* - 2: Term of sort FloatingPoint
- *
+ *
* Create with:
* - `Solver::mkTerm(const Op& op, const Term& child) const`
* - `Solver::mkTerm(const Op& op, const std::vector<Term>& children) const`
FLOATINGPOINT_TO_SBV,
/**
* Floating-point to real.
- *
+ *
* Parameters:
* - 1: Term of sort FloatingPoint
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
/**
* Array select.
- *
+ *
* Parameters:
* - 1: Term of array sort
* - 2: Selection index
- *
+ *
* Create with:
* - `Solver::mkTerm(const Op& op, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(const Op& op, const std::vector<Term>& children) const`
SELECT,
/**
* Array store.
- *
+ *
* Parameters:
* - 1: Term of array sort
* - 2: Store index
* - 3: Term to store at the index
- *
+ *
* Create with:
* - `Solver::mkTerm(const Op& op, const Term& child1, const Term& child2, const Term& child3) const`
* - `Solver::mkTerm(const Op& op, const std::vector<Term>& children) const`
STORE,
/**
* Constant array.
- *
+ *
* Parameters:
* - 1: Array sort
* - 2: Term representing a constant
- *
+ *
* Create with:
* - `Solver::mkTerm(const Op& op, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(const Op& op, const std::vector<Term>& children) const`
* - 2: Second array
* - 3: Lower bound of range (inclusive)
* - 4: Uppper bound of range (inclusive)
- *
+ *
* Create with:
* - `Solver::mkTerm(const Op& op, const std::vector<Term>& children) const`
*
/**
* Constructor application.
- *
+ *
* Paramters: n > 0
* - 1: Constructor (operator)
* - 2..n: Parameters to the constructor
- *
+ *
* Create with:
* - `Solver::mkTerm(const Op& op) const`
* - `Solver::mkTerm(const Op& op, const Term& child) const`
APPLY_CONSTRUCTOR,
/**
* Datatype selector application.
- *
+ *
* Parameters:
* - 1: Selector (operator)
* - 2: Datatype term (undefined if mis-applied)
- *
+ *
* Create with:
* - `Solver::mkTerm(const Op& op, const Term& child) const`
*/
APPLY_SELECTOR,
/**
* Datatype tester application.
- *
+ *
* Parameters:
* - 1: Tester term
* - 2: Datatype term
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
#endif
/**
* Operator for a tuple update.
- *
+ *
* Parameters:
* - 1: Index of the tuple to be updated
- *
+ *
* Create with:
* - `Solver::mkOp(Kind kind, uint32_t param) const`
*
* Apply tuple update.
- *
+ *
* Parameters:
* - 1: Op of kind TUPLE_UPDATE (which references an index)
* - 2: Tuple
* - 3: Element to store in the tuple at the given index
- *
+ *
* Create with:
* - `Solver::mkTerm(const Op& op, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(const Op& op, const std::vector<Term>& children) const`
TUPLE_UPDATE,
/**
* Operator for a record update.
- *
+ *
* Parameters:
* - 1: Name of the field to be updated
- *
+ *
* Create with:
* - `Solver::mkOp(Kind kind, const std::string& param) const`
*
* Record update.
- *
+ *
* Parameters:
* - 1: Op of kind RECORD_UPDATE (which references a field)
* - 2: Record term to update
* - 3: Element to store in the record in the given field
- *
+ *
* Create with:
* - `Solver::mkTerm(const Op& op, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(const Op& op,, const std::vector<Term>& children) const`
* For example, the smt2 syntax match term
* `(match l (((cons h t) h) (nil 0)))`
* is represented by the AST
- *
+ *
* (MATCH l
* (MATCH_BIND_CASE (BOUND_VAR_LIST h t) (cons h t) h)
* (MATCH_CASE nil 0))
- *
+ *
* The type of the last argument of each case term could be equal.
- *
+ *
* Parameters: n > 1
* - 1..n: Terms of kind MATCH_CASE or MATCH_BIND_CASE
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
/**
* Match case
* A (constant) case expression to be used within a match expression.
- *
+ *
* Parameters:
* - 1: Term denoting the pattern expression
* - 2: Term denoting the return value
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
/**
* Match bind case
* A (non-constant) case expression to be used within a match expression.
- *
+ *
* Parameters:
* - 1: a BOUND_VAR_LIST Term containing the free variables of the case
* - 2: Term denoting the pattern expression
* - 3: Term denoting the return value
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
* Datatypes size
* An operator mapping datatypes to an integer denoting the number of
* non-nullary applications of constructors they contain.
- *
+ *
* Parameters:
* - 1: Datatype term
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
DT_SIZE,
/**
* Operator for tuple projection indices
- *
+ *
* Parameters:
* - 1: The tuple projection indices
- *
+ *
* Create with:
* - `Solver::mkOp(Kind TUPLE_PROJECT, std::vector<uint32_t> param) const`
*
* Constructs a new tuple from an existing one using the elements at the
* given indices
- *
+ *
* Parameters:
* - 1: a term of tuple sort
- *
+ *
* Create with:
* - `Solver::mkTerm(const Op& op, const Term& child) const`
* - `Solver::mkTerm(const Op& op, const std::vector<Term>& children) const`
/**
* Separation logic nil term.
- *
+ *
* Parameters: none
- *
+ *
* Create with:
* - `Solver::mkSepNil(const Sort& sort) const`
*/
SEP_NIL,
/**
* Separation logic empty heap.
- *
+ *
* Parameters:
* - 1: Term of the same sort as the sort of the location of the heap
* that is constrained to be empty
* - 2: Term of the same sort as the data sort of the heap that is
* that is constrained to be empty
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
SEP_EMP,
/**
* Separation logic points-to relation.
- *
+ *
* Parameters:
* - 1: Location of the points-to constraint
* - 2: Data of the points-to constraint
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
SEP_PTO,
/**
* Separation logic star.
- *
+ *
* Parameters: n > 1
* - 1..n: Child constraints that hold in disjoint (separated) heaps
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
SEP_STAR,
/**
* Separation logic magic wand.
- *
+ *
* Parameters:
* - 1: Antecendant of the magic wand constraint
* - 2: Conclusion of the magic wand constraint, which is asserted to
* hold in all heaps that are disjoint extensions of the antecedent.
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
/**
* Empty set constant.
- *
+ *
* Parameters:
* - 1: Sort of the set elements
- *
+ *
* Create with:
* - `Solver::mkEmptySet(const Sort& sort) const`
*/
EMPTYSET,
/**
* Set union.
- *
+ *
* Parameters:
* - 1..2: Terms of set sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
UNION,
/**
* Set intersection.
- *
+ *
* Parameters:
* - 1..2: Terms of set sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
INTERSECTION,
/**
* Set subtraction.
- *
+ *
* Parameters:
* - 1..2: Terms of set sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
SETMINUS,
/**
* Subset predicate.
- *
+ *
* Parameters:
* - 1..2: Terms of set sort, [1] a subset of set [2]?
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
SUBSET,
/**
* Set membership predicate.
- *
+ *
* Parameters:
* - 1..2: Terms of set sort, [1] a member of set [2]?
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
/**
* Construct a singleton set from an element given as a parameter.
* The returned set has same type of the element.
- *
+ *
* Parameters:
* - 1: Single element
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
SINGLETON,
/**
* The set obtained by inserting elements;
- *
+ *
* Parameters: n > 0
* - 1..n-1: Elements inserted into set [n]
* - n: Set Term
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
INSERT,
/**
* Set cardinality.
- *
+ *
* Parameters:
* - 1: Set to determine the cardinality of
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
CARD,
/**
* Set complement with respect to finite universe.
- *
+ *
* Parameters:
* - 1: Set to complement
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
/**
* Finite universe set.
* All set variables must be interpreted as subsets of it.
- *
+ *
* Create with:
* - `Solver::mkUniverseSet(const Sort& sort) const`
*/
UNIVERSE_SET,
/**
* Set join.
- *
+ *
* Parameters:
* - 1..2: Terms of set sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
JOIN,
/**
* Set cartesian product.
- *
+ *
* Parameters:
* - 1..2: Terms of set sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
PRODUCT,
/**
* Set transpose.
- *
+ *
* Parameters:
* - 1: Term of set sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
TRANSPOSE,
/**
* Set transitive closure.
- *
+ *
* Parameters:
* - 1: Term of set sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
TCLOSURE,
/**
* Set join image.
- *
+ *
* Parameters:
* - 1..2: Terms of set sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
JOIN_IMAGE,
/**
* Set identity.
- *
+ *
* Parameters:
* - 1: Term of set sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
* where y ranges over the element type of the (set) type of the
* comprehension. If @f$ t[x_1..x_n] @f$ is not provided, it is equivalent to y in the
* above formula.
- *
+ *
* Parameters:
* - 1: Term BOUND_VAR_LIST
* - 2: Term denoting the predicate of the comprehension
* - 3: (optional) a Term denoting the generator for the comprehension
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
* If the set is empty, then (choose A) is an arbitrary value.
* If the set has cardinality > 1, then (choose A) will deterministically
* return an element in A.
- *
+ *
* Parameters:
* - 1: Term of set sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
CHOOSE,
/**
* Set is_singleton predicate.
- *
+ *
* Parameters:
* - 1: Term of set sort, is [1] a singleton set?
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
/* Bags ------------------------------------------------------------------ */
/**
* Empty bag constant.
- *
+ *
* Parameters:
* - 1: Sort of the bag elements
- *
+ *
* Create with:
* mkEmptyBag(const Sort& sort)
*/
* Bag max union.
* Parameters:
* - 1..2: Terms of bag sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
UNION_MAX,
/**
* Bag disjoint union (sum).
- *
+ *
* Parameters:
* -1..2: Terms of bag sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
UNION_DISJOINT,
/**
* Bag intersection (min).
- *
+ *
* Parameters:
* - 1..2: Terms of bag sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
/**
* Bag difference subtract (subtracts multiplicities of the second from the
* first).
- *
+ *
* Parameters:
* - 1..2: Terms of bag sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
DIFFERENCE_SUBTRACT,
/**
* Bag difference 2 (removes shared elements in the two bags).
- *
+ *
* Parameters:
* - 1..2: Terms of bag sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
/**
* Inclusion predicate for bags
* (multiplicities of the first bag <= multiplicities of the second bag).
- *
+ *
* Parameters:
* - 1..2: Terms of bag sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
SUBBAG,
/**
* Element multiplicity in a bag
- *
+ *
* Parameters:
* - 1..2: Terms of bag sort (Bag E), [1] an element of sort E
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
/**
* Eliminate duplicates in a given bag. The returned bag contains exactly the
* same elements in the given bag, but with multiplicity one.
- *
+ *
* Parameters:
* - 1: a term of bag sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
DUPLICATE_REMOVAL,
/**
* The bag of the single element given as a parameter.
- *
+ *
* Parameters:
* - 1: Single element
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
MK_BAG,
/**
* Bag cardinality.
- *
+ *
* Parameters:
* - 1: Bag to determine the cardinality of
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
* If the bag is empty, then (choose A) is an arbitrary value.
* If the bag contains distinct elements, then (choose A) will
* deterministically return an element in A.
- *
+ *
* Parameters:
* - 1: Term of bag sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
* Bag is_singleton predicate (single element with multiplicity exactly one).
* Parameters:
* - 1: Term of bag sort, is [1] a singleton bag?
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
BAG_IS_SINGLETON,
/**
* Bag.from_set converts a set to a bag.
- *
+ *
* Parameters:
* - 1: Term of set sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
BAG_FROM_SET,
/**
* Bag.to_set converts a bag to a set.
- *
+ *
* Parameters:
* - 1: Term of bag sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
/**
* String concat.
- *
+ *
* Parameters: n > 1
* - 1..n: Terms of String sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
STRING_CONCAT,
/**
* String membership.
- *
+ *
* Parameters:
* - 1: Term of String sort
* - 2: Term of RegExp sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
STRING_IN_REGEXP,
/**
* String length.
- *
+ *
* Parameters:
* - 1: Term of String sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
* s. If the start index is negative, the start index is greater than the
* length of the string, or the length is negative, the result is the empty
* string.
- *
+ *
* Parameters:
* - 1: Term of sort String
* - 2: Term of sort Integer (index i)
* - 3: Term of sort Integer (length l)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
* If the start index is negative, the start index is greater than the
* length of the string, the result is s. Otherwise, the length of the
* original string is preserved.
- *
+ *
* Parameters:
* - 1: Term of sort String
* - 2: Term of sort Integer (index i)
* - 3: Term of sort String (replacement string t)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
* Returns the character at index i from a string s. If the index is negative
* or the index is greater than the length of the string, the result is the
* empty string. Otherwise the result is a string of length 1.
- *
+ *
* Parameters:
* - 1: Term of sort String (string s)
* - 2: Term of sort Integer (index i)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
* String contains.
* Checks whether a string s1 contains another string s2. If s2 is empty, the
* result is always true.
- *
+ *
* Parameters:
* - 1: Term of sort String (the string s1)
* - 2: Term of sort String (the string s2)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
* Returns the index of a substring s2 in a string s1 starting at index i. If
* the index is negative or greater than the length of string s1 or the
* substring s2 does not appear in string s1 after index i, the result is -1.
- *
+ *
* Parameters:
* - 1: Term of sort String (substring s1)
* - 2: Term of sort String (substring s2)
* - 3: Term of sort Integer (index i)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
* String replace.
* Replaces a string s2 in a string s1 with string s3. If s2 does not appear
* in s1, s1 is returned unmodified.
- *
+ *
* Parameters:
* - 1: Term of sort String (string s1)
* - 2: Term of sort String (string s2)
* - 3: Term of sort String (string s3)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
* String replace all.
* Replaces all occurrences of a string s2 in a string s1 with string s3.
* If s2 does not appear in s1, s1 is returned unmodified.
- *
+ *
* Parameters:
* - 1: Term of sort String (string s1)
* - 2: Term of sort String (string s2)
* - 3: Term of sort String (string s3)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
* Replaces the first match of a regular expression r in string s1 with
* string s2. If r does not match a substring of s1, s1 is returned
* unmodified.
- *
+ *
* Parameters:
* - 1: Term of sort String (string s1)
* - 2: Term of sort Regexp (regexp r)
* - 3: Term of sort String (string s2)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
* String replace all regular expression matches.
* Replaces all matches of a regular expression r in string s1 with string
* s2. If r does not match a substring of s1, s1 is returned unmodified.
- *
+ *
* Parameters:
* - 1: Term of sort String (string s1)
* - 2: Term of sort Regexp (regexp r)
* - 3: Term of sort String (string s2)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
STRING_REPLACE_RE_ALL,
/**
* String to lower case.
- *
+ *
* Parameters:
* - 1: Term of String sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
STRING_TOLOWER,
/**
* String to upper case.
- *
+ *
* Parameters:
* - 1: Term of String sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
STRING_TOUPPER,
/**
* String reverse.
- *
+ *
* Parameters:
* - 1: Term of String sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
* String to code.
* Returns the code point of a string if it has length one, or returns -1
* otherwise.
- *
+ *
* Parameters:
* - 1: Term of String sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
* Returns a string containing a single character whose code point matches
* the argument to this function, or the empty string if the argument is
* out-of-bounds.
- *
+ *
* Parameters:
* - 1: Term of Integer sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
* String less than.
* Returns true if string s1 is (strictly) less than s2 based on a
* lexiographic ordering over code points.
- *
+ *
* Parameters:
* - 1: Term of sort String (the string s1)
* - 2: Term of sort String (the string s2)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
* String less than or equal.
* Returns true if string s1 is less than or equal to s2 based on a
* lexiographic ordering over code points.
- *
+ *
* Parameters:
* - 1: Term of sort String (the string s1)
* - 2: Term of sort String (the string s2)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
* String prefix-of.
* Checks whether a string s1 is a prefix of string s2. If string s1 is
* empty, this operator returns true.
- *
+ *
* Parameters:
* - 1: Term of sort String (string s1)
* - 2: Term of sort String (string s2)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
* String suffix-of.
* Checks whether a string s1 is a suffix of string 2. If string s1 is empty,
* this operator returns true.
- *
+ *
* Parameters:
* - 1: Term of sort String (string s1)
* - 2: Term of sort String (string s2)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
/**
* String is-digit.
* Returns true if string s is digit (it is one of "0", ..., "9").
- *
+ *
* Parameters:
* - 1: Term of sort String
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
/**
* Integer to string.
* If the integer is negative this operator returns the empty string.
- *
+ *
* Parameters:
* - 1: Term of sort Integer
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
* String to integer (total function).
* If the string does not contain an integer or the integer is negative, the
* operator returns -1.
- *
+ *
* Parameters:
* - 1: Term of sort String
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
STRING_TO_INT,
/**
* Constant string.
- *
+ *
* Parameters:
* - See @ref cvc5::api::Solver::mkString() "mkString()".
- *
+ *
* Create with:
* - `Solver::mkString(const std::string& s, bool useEscSequences) const`
* - `Solver::mkString(const unsigned char c) const`
CONST_STRING,
/**
* Conversion from string to regexp.
- *
+ *
* Parameters:
* - 1: Term of sort String
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
STRING_TO_REGEXP,
/**
* Regexp Concatenation.
- *
+ *
* Parameters:
* - 1..2: Terms of Regexp sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
REGEXP_CONCAT,
/**
* Regexp union.
- *
+ *
* Parameters:
* - 1..2: Terms of Regexp sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
REGEXP_UNION,
/**
* Regexp intersection.
- *
+ *
* Parameters:
* - 1..2: Terms of Regexp sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
REGEXP_INTER,
/**
* Regexp difference.
- *
+ *
* Parameters:
* - 1..2: Terms of Regexp sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
REGEXP_DIFF,
/**
* Regexp *.
- *
+ *
* Parameters:
* - 1: Term of sort Regexp
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
REGEXP_STAR,
/**
* Regexp +.
- *
+ *
* Parameters:
* - 1: Term of sort Regexp
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
REGEXP_PLUS,
/**
* Regexp ?.
- *
+ *
* Parameters:
* - 1: Term of sort Regexp
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
REGEXP_OPT,
/**
* Regexp range.
- *
+ *
* Parameters:
* - 1: Lower bound character for the range
* - 2: Upper bound character for the range
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
REGEXP_RANGE,
/**
* Operator for regular expression repeat.
- *
+ *
* Parameters:
* - 1: The number of repetitions
- *
+ *
* Create with:
* - `Solver::mkOp(Kind kind, uint32_t param) const`
*
* Apply regular expression loop.
- *
+ *
* Parameters:
* - 1: Op of kind REGEXP_REPEAT
* - 2: Term of regular expression sort
- *
+ *
* Create with:
* - `Solver::mkTerm(const Op& op, const Term& child) const`
* - `Solver::mkTerm(const Op& op, const std::vector<Term>& children) const`
/**
* Operator for regular expression loop, from lower bound to upper bound
* number of repetitions.
- *
+ *
* Parameters:
* - 1: The lower bound
* - 2: The upper bound
- *
+ *
* Create with:
* - `Solver::mkOp(Kind kind, uint32_t param, uint32_t param) const`
*
* Apply regular expression loop.
- *
+ *
* Parameters:
* - 1: Op of kind REGEXP_LOOP
* - 2: Term of regular expression sort
- *
+ *
* Create with:
* - `Solver::mkTerm(const Op& op, const Term& child) const`
* - `Solver::mkTerm(const Op& op, const std::vector<Term>& children) const`
REGEXP_LOOP,
/**
* Regexp empty.
- *
+ *
* Parameters: none
- *
+ *
* Create with:
* - `Solver::mkRegexpEmpty() const`
* - `Solver::mkTerm(Kind kind) const`
REGEXP_EMPTY,
/**
* Regexp all characters.
- *
+ *
* Parameters: none
- *
+ *
* Create with:
* - `Solver::mkRegexpSigma() const`
* - `Solver::mkTerm(Kind kind) const`
REGEXP_SIGMA,
/**
* Regexp complement.
- *
+ *
* Parameters:
* - 1: Term of sort RegExp
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1) const`
*/
/**
* Sequence concat.
- *
+ *
* Parameters: n > 1
* - 1..n: Terms of Sequence sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
SEQ_CONCAT,
/**
* Sequence length.
- *
+ *
* Parameters:
* - 1: Term of Sequence sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
* sequence s. If the start index is negative, the start index is greater
* than the length of the sequence, or the length is negative, the result is
* the empty sequence.
- *
+ *
* Parameters:
* - 1: Term of sort Sequence
* - 2: Term of sort Integer (index i)
* - 3: Term of sort Integer (length l)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
* If the start index is negative, the start index is greater than the
* length of the sequence, the result is s. Otherwise, the length of the
* original sequence is preserved.
- *
+ *
* Parameters:
* - 1: Term of sort Sequence
* - 2: Term of sort Integer (index i)
* - 3: Term of sort Sequence (replacement sequence t)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
* Returns the element at index i from a sequence s. If the index is negative
* or the index is greater or equal to the length of the sequence, the result
* is the empty sequence. Otherwise the result is a sequence of length 1.
- *
+ *
* Parameters:
* - 1: Term of sequence sort (string s)
* - 2: Term of sort Integer (index i)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
* Sequence contains.
* Checks whether a sequence s1 contains another sequence s2. If s2 is empty,
* the result is always true.
- *
+ *
* Parameters:
* - 1: Term of sort Sequence (the sequence s1)
* - 2: Term of sort Sequence (the sequence s2)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
* If the index is negative or greater than the length of sequence s1 or the
* subsequence s2 does not appear in sequence s1 after index i, the result is
* -1.
- *
+ *
* Parameters:
* - 1: Term of sort Sequence (subsequence s1)
* - 2: Term of sort Sequence (subsequence s2)
* - 3: Term of sort Integer (index i)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
* Sequence replace.
* Replaces the first occurrence of a sequence s2 in a sequence s1 with
* sequence s3. If s2 does not appear in s1, s1 is returned unmodified.
- *
+ *
* Parameters:
* - 1: Term of sort Sequence (sequence s1)
* - 2: Term of sort Sequence (sequence s2)
* - 3: Term of sort Sequence (sequence s3)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
* Sequence replace all.
* Replaces all occurrences of a sequence s2 in a sequence s1 with sequence
* s3. If s2 does not appear in s1, s1 is returned unmodified.
- *
+ *
* Parameters:
* - 1: Term of sort Sequence (sequence s1)
* - 2: Term of sort Sequence (sequence s2)
* - 3: Term of sort Sequence (sequence s3)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
SEQ_REPLACE_ALL,
/**
* Sequence reverse.
- *
+ *
* Parameters:
* - 1: Term of Sequence sort
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
* Sequence prefix-of.
* Checks whether a sequence s1 is a prefix of sequence s2. If sequence s1 is
* empty, this operator returns true.
- *
+ *
* Parameters:
* - 1: Term of sort Sequence (sequence s1)
* - 2: Term of sort Sequence (sequence s2)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
* Sequence suffix-of.
* Checks whether a sequence s1 is a suffix of sequence s2. If sequence s1 is
* empty, this operator returns true.
- *
+ *
* Parameters:
* - 1: Term of sort Sequence (sequence s1)
* - 2: Term of sort Sequence (sequence s2)
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const std::vector<Term>& children) const`
SEQ_SUFFIX,
/**
* Constant sequence.
- *
+ *
* Parameters:
* - See @ref cvc5::api::Solver::mkEmptySequence() "mkEmptySequence()".
- *
+ *
* Create with:
* - `Solver::mkEmptySequence(const Sort& sort) const`
- *
+ *
* Note that a constant sequence is a term that is equivalent to:
- *
+ *
* (seq.++ (seq.unit c1) ... (seq.unit cn))
- *
+ *
* where n>=0 and c1, ..., cn are constants of some sort. The elements
* can be extracted by `Term::getConstSequenceElements()`.
*/
/**
* Sequence unit, corresponding to a sequence of length one with the given
* term.
- *
+ *
* Parameters:
* - 1: Element term.
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1) const`
*/
SEQ_UNIT,
/**
* Sequence nth, corresponding to the nth element of a sequence.
- *
+ *
* Parameters:
* - 1: Sequence term.
* - 2: Integer term.
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
*/
/**
* Universally quantified formula.
- *
+ *
* Parameters:
* - 1: BOUND_VAR_LIST Term
* - 2: Quantifier body
* - 3: (optional) INST_PATTERN_LIST Term
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
FORALL,
/**
* Existentially quantified formula.
- *
+ *
* Parameters:
* - 1: BOUND_VAR_LIST Term
* - 2: Quantifier body
* - 3: (optional) INST_PATTERN_LIST Term
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
EXISTS,
/**
* A list of bound variables (used to bind variables under a quantifier)
- *
+ *
* Parameters: n > 1
* - 1..n: Terms with kind BOUND_VARIABLE
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
* An instantiation pattern.
* Specifies a (list of) terms to be used as a pattern for quantifier
* instantiation.
- *
+ *
* Parameters: n > 1
* - 1..n: Terms with kind BOUND_VARIABLE
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
* An instantiation no-pattern.
* Specifies a (list of) terms that should not be used as a pattern for
* quantifier instantiation.
- *
+ *
* Parameters: n > 1
* - 1..n: Terms with kind BOUND_VARIABLE
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
*
* Parameters:
* - 1: Term with a user attribute.
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child) const`
*/
INST_ATTRIBUTE,
/**
* A list of instantiation patterns and/or attributes.
- *
+ *
* Parameters: n > 1
* - 1..n: Terms with kind INST_PATTERN, INST_NO_PATTERN, or
* INST_ATTRIBUTE.
- *
+ *
* Create with:
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2) const`
* - `Solver::mkTerm(Kind kind, const Term& child1, const Term& child2, const Term& child3) const`
##
"""
-This script reads CVC4/src/api/cpp/cvc5_kind.h and generates
-cvc/Kind.java file which declare all the CVC4 kinds.
+This script reads cvc5/src/api/cpp/cvc5_kind.h and generates
+cvc/Kind.java file which declare all the cvc5 kinds.
"""
import argparse
import os
import sys
-# get access to CVC4/src/api/parsekinds.py
+# get access to cvc5/src/api/parsekinds.py
sys.path.insert(0, os.path.abspath('${CMAKE_SOURCE_DIR}/src/api'))
from parsekinds import *
"""
This script implements KindsParser which
-parses the header file CVC4/src/api/cpp/cvc5_kind.h
+parses the header file cvc5/src/api/cpp/cvc5_kind.h
The script is aware of the '#if 0' pattern and will ignore
kinds declared between '#if 0' and '#endif'. It can also
ostream cout
-cdef extern from "api/cpp/cvc5.h" namespace "CVC4":
+cdef extern from "api/cpp/cvc5.h" namespace "cvc5":
cdef cppclass Options:
pass
##
"""
-This script reads CVC4/src/api/cpp/cvc5_kind.h and generates
-.pxd and .pxi files which declare all the CVC4 kinds and
+This script reads cvc5/src/api/cpp/cvc5_kind.h and generates
+.pxd and .pxi files which declare all the cvc5 kinds and
implement a Python wrapper for kinds, respectively. The
default names are kinds.pxd / kinds.pxi, but the name is
configurable from the command line with --kinds-file-prefix.
import os
import sys
-# get access to CVC4/src/api/parsekinds.py
+# get access to cvc5/src/api/parsekinds.py
sys.path.insert(0, os.path.abspath('${CMAKE_SOURCE_DIR}/src/api'))
from parsekinds import *
# directory for licensing information.
# #############################################################################
#
-# This script is automatically configured with cmake when CVC4
+# This script is automatically configured with cmake when cvc5
# is built with --python-bindings. It is called during make
# install to automatically install the python bindings using
# distutils.
from distutils.command.clean import clean
from distutils.command.install import install
-class PyCVC4Install(install):
+class PyCVC5Install(install):
# Calls the default run command, then deletes the build area
# (equivalent to "setup clean --all").
c.run()
setup(name='pycvc4',
- version='${CVC5_MAJOR}.${CVC5_MINOR}.${CVC4_RELEASE}',
+ version='${CVC5_MAJOR}.${CVC5_MINOR}.${CVC5_RELEASE}',
packages=['pycvc4'],
package_dir={'pycvc4': '${CMAKE_CURRENT_BINARY_DIR}/pycvc4'},
package_data={'pycvc4': ['pycvc4.so']},
- cmdclass={'install': PyCVC4Install})
+ cmdclass={'install': PyCVC5Install})
* ****************************************************************************
*
* Implementation of Configuration class, which provides compile-time
- * configuration information about the CVC4 library.
+ * configuration information about the cvc5 library.
*/
#include "base/configuration.h"
<< "affiliations listed at http://cvc4.cs.stanford.edu/authors\n\n";
if (Configuration::licenseIsGpl()) {
- ss << "This build of CVC4 uses GPLed libraries, and is thus covered by\n"
- << "the GNU General Public License (GPL) version 3. Versions of CVC4\n"
+ ss << "This build of cvc5 uses GPLed libraries, and is thus covered by\n"
+ << "the GNU General Public License (GPL) version 3. Versions of cvc5\n"
<< "are available that are covered by the (modified) BSD license. If\n"
- << "you want to license CVC4 under this license, please configure CVC4\n"
+ << "you want to license cvc5 under this license, please configure cvc5\n"
<< "with the \"--no-gpl\" option before building from sources.\n\n";
} else {
- ss << "CVC4 is open-source and is covered by the BSD license (modified)."
+ ss << "cvc5 is open-source and is covered by the BSD license (modified)."
<< "\n\n";
}
ss << "THIS SOFTWARE IS PROVIDED AS-IS, WITHOUT ANY WARRANTIES.\n"
<< "USE AT YOUR OWN RISK.\n\n";
- ss << "CVC4 incorporates code from ANTLR3 (http://www.antlr.org).\n"
+ ss << "cvc5 incorporates code from ANTLR3 (http://www.antlr.org).\n"
<< "See licenses/antlr3-LICENSE for copyright and licensing information."
<< "\n\n";
|| Configuration::isBuiltWithSymFPU()
|| Configuration::isBuiltWithEditline())
{
- ss << "This version of CVC4 is linked against the following non-(L)GPL'ed\n"
+ ss << "This version of cvc5 is linked against the following non-(L)GPL'ed\n"
<< "third party libraries.\n\n";
if (Configuration::isBuiltWithAbc()) {
ss << " ABC - A System for Sequential Synthesis and Verification\n"
if (Configuration::isBuiltWithSymFPU())
{
ss << " SymFPU - The Symbolic Floating Point Unit\n"
- << " See https://github.com/martin-cs/symfpu/tree/CVC4 for copyright "
+ << " See https://github.com/martin-cs/symfpu/tree/cvc5 for copyright "
<< "information.\n\n";
}
if (Configuration::isBuiltWithEditline())
if (Configuration::isBuiltWithGmp() || Configuration::isBuiltWithPoly())
{
- ss << "This version of CVC4 is linked against the following third party\n"
+ ss << "This version of cvc5 is linked against the following third party\n"
<< "libraries covered by the LGPLv3 license.\n"
<< "See licenses/lgpl-3.0.txt for more information.\n\n";
if (Configuration::isBuiltWithGmp()) {
}
if (Configuration::isStaticBuild())
{
- ss << "CVC4 is statically linked against these libraries. To recompile\n"
- "this version of CVC4 with different versions of these libraries\n"
+ ss << "cvc5 is statically linked against these libraries. To recompile\n"
+ "this version of cvc5 with different versions of these libraries\n"
"follow the instructions on "
"https://github.com/CVC4/CVC4/blob/master/INSTALL.md\n\n";
}
if (Configuration::isBuiltWithCln()
|| Configuration::isBuiltWithGlpk ()) {
- ss << "This version of CVC4 is linked against the following third party\n"
+ ss << "This version of cvc5 is linked against the following third party\n"
<< "libraries covered by the GPLv3 license.\n"
<< "See licenses/gpl-3.0.txt for more information.\n\n";
if (Configuration::isBuiltWithCln()) {
}
ss << "See the file COPYING (distributed with the source code, and with\n"
- << "all binaries) for the full CVC4 copyright, licensing, and (lack of)\n"
+ << "all binaries) for the full cvc5 copyright, licensing, and (lack of)\n"
<< "warranty information.\n";
return ss.str();
}
std::string Configuration::about() {
std::stringstream ss;
- ss << "This is CVC4 version " << CVC5_RELEASE_STRING;
+ ss << "This is cvc5 version " << CVC5_RELEASE_STRING;
if (Configuration::isGitBuild()) {
ss << " [" << Configuration::getGitId() << "]";
}
* ****************************************************************************
*
* Interface to a public class that provides compile-time information
- * about the CVC4 library.
+ * about the cvc5 library.
*/
#include "cvc5_public.h"
namespace cvc5 {
/**
- * Represents the (static) configuration of CVC4.
+ * Represents the (static) configuration of cvc5.
*/
class CVC4_EXPORT Configuration
{
* ****************************************************************************
*
* An exception that is thrown when an interactive-only feature while
- * CVC4 is being used in a non-interactive setting (for example, the
+ * cvc5 is being used in a non-interactive setting (for example, the
* "(get-assertions)" command in an SMT-LIBv2 script).
*/
NullC nullCvc4Stream;
-const std::string CVC4ostream::s_tab = " ";
-const int CVC4ostream::s_indentIosIndex = ios_base::xalloc();
+const std::string CVC5ostream::s_tab = " ";
+const int CVC5ostream::s_indentIosIndex = ios_base::xalloc();
DebugC DebugChannel(&cout);
WarningC WarningChannel(&cerr);
/** A null output stream singleton */
extern std::ostream null_os CVC4_EXPORT;
-class CVC4_EXPORT CVC4ostream
+class CVC4_EXPORT CVC5ostream
{
static const std::string s_tab;
static const int s_indentIosIndex;
std::ostream& (*const d_endl)(std::ostream&);
// do not allow use
- CVC4ostream& operator=(const CVC4ostream&);
+ CVC5ostream& operator=(const CVC5ostream&);
-public:
- CVC4ostream() :
- d_os(NULL),
- d_firstColumn(false),
- d_endl(&std::endl) {
- }
- explicit CVC4ostream(std::ostream* os) :
- d_os(os),
- d_firstColumn(true),
- d_endl(&std::endl) {
+ public:
+ CVC5ostream() : d_os(NULL), d_firstColumn(false), d_endl(&std::endl) {}
+ explicit CVC5ostream(std::ostream* os)
+ : d_os(os), d_firstColumn(true), d_endl(&std::endl)
+ {
}
void pushIndent() {
}
}
- CVC4ostream& flush() {
+ CVC5ostream& flush()
+ {
if(d_os != NULL) {
d_os->flush();
}
std::ostream* getStreamPointer() const { return d_os; }
template <class T>
- CVC4ostream& operator<<(T const& t) CVC4_EXPORT;
+ CVC5ostream& operator<<(T const& t) CVC4_EXPORT;
// support manipulators, endl, etc..
- CVC4ostream& operator<<(std::ostream& (*pf)(std::ostream&)) {
+ CVC5ostream& operator<<(std::ostream& (*pf)(std::ostream&))
+ {
if(d_os != NULL) {
d_os = &(*d_os << pf);
}
return *this;
}
- CVC4ostream& operator<<(std::ios& (*pf)(std::ios&)) {
+ CVC5ostream& operator<<(std::ios& (*pf)(std::ios&))
+ {
if(d_os != NULL) {
d_os = &(*d_os << pf);
}
return *this;
}
- CVC4ostream& operator<<(std::ios_base& (*pf)(std::ios_base&)) {
+ CVC5ostream& operator<<(std::ios_base& (*pf)(std::ios_base&))
+ {
if(d_os != NULL) {
d_os = &(*d_os << pf);
}
return *this;
}
- CVC4ostream& operator<<(CVC4ostream& (*pf)(CVC4ostream&)) {
+ CVC5ostream& operator<<(CVC5ostream& (*pf)(CVC5ostream&))
+ {
return pf(*this);
}
-}; /* class CVC4ostream */
+}; /* class CVC5ostream */
-inline CVC4ostream& push(CVC4ostream& stream) {
+inline CVC5ostream& push(CVC5ostream& stream)
+{
stream.pushIndent();
return stream;
}
-inline CVC4ostream& pop(CVC4ostream& stream) {
+inline CVC5ostream& pop(CVC5ostream& stream)
+{
stream.popIndent();
return stream;
}
template <class T>
-CVC4ostream& CVC4ostream::operator<<(T const& t) {
+CVC5ostream& CVC5ostream::operator<<(T const& t)
+{
if(d_os != NULL) {
if(d_firstColumn) {
d_firstColumn = false;
{
public:
operator bool() const { return false; }
- operator CVC4ostream() const { return CVC4ostream(); }
+ operator CVC5ostream() const { return CVC5ostream(); }
operator std::ostream&() const { return null_os; }
}; /* class NullC */
public:
explicit DebugC(std::ostream* os) : d_os(os) {}
- CVC4ostream operator()(const std::string& tag) const
+ CVC5ostream operator()(const std::string& tag) const
{
if(!d_tags.empty() && d_tags.find(tag) != d_tags.end()) {
- return CVC4ostream(d_os);
+ return CVC5ostream(d_os);
} else {
- return CVC4ostream();
+ return CVC5ostream();
}
}
public:
explicit WarningC(std::ostream* os) : d_os(os) {}
- CVC4ostream operator()() const { return CVC4ostream(d_os); }
+ CVC5ostream operator()() const { return CVC5ostream(d_os); }
std::ostream& setStream(std::ostream* os) { d_os = os; return *d_os; }
std::ostream& getStream() const { return *d_os; }
// This function supports the WarningOnce() macro, which allows you
// to easily indicate that a warning should be emitted, but only
- // once for a given run of CVC4.
+ // once for a given run of cvc5.
bool warnOnce(const std::string& file, size_t line)
{
std::pair<std::string, size_t> pr = std::make_pair(file, line);
public:
explicit MessageC(std::ostream* os) : d_os(os) {}
- CVC4ostream operator()() const { return CVC4ostream(d_os); }
+ CVC5ostream operator()() const { return CVC5ostream(d_os); }
std::ostream& setStream(std::ostream* os) { d_os = os; return *d_os; }
std::ostream& getStream() const { return *d_os; }
public:
explicit NoticeC(std::ostream* os) : d_os(os) {}
- CVC4ostream operator()() const { return CVC4ostream(d_os); }
+ CVC5ostream operator()() const { return CVC5ostream(d_os); }
std::ostream& setStream(std::ostream* os) { d_os = os; return *d_os; }
std::ostream& getStream() const { return *d_os; }
public:
explicit ChatC(std::ostream* os) : d_os(os) {}
- CVC4ostream operator()() const { return CVC4ostream(d_os); }
+ CVC5ostream operator()() const { return CVC5ostream(d_os); }
std::ostream& setStream(std::ostream* os) { d_os = os; return *d_os; }
std::ostream& getStream() const { return *d_os; }
public:
explicit TraceC(std::ostream* os) : d_os(os) {}
- CVC4ostream operator()(std::string tag) const
+ CVC5ostream operator()(std::string tag) const
{
if(!d_tags.empty() && d_tags.find(tag) != d_tags.end()) {
- return CVC4ostream(d_os);
+ return CVC5ostream(d_os);
} else {
- return CVC4ostream();
+ return CVC5ostream();
}
}
explicit DumpOutC(std::ostream* os) : d_os(os) {}
- CVC4ostream operator()(std::string tag) {
+ CVC5ostream operator()(std::string tag)
+ {
if(!d_tags.empty() && d_tags.find(tag) != d_tags.end()) {
- return CVC4ostream(d_os);
+ return CVC5ostream(d_os);
} else {
- return CVC4ostream();
+ return CVC5ostream();
}
}
::cvc5::__cvc4_true() ? ::cvc5::nullCvc4Stream : ::cvc5::WarningChannel
#define WarningOnce \
::cvc5::__cvc4_true() ? ::cvc5::nullCvc4Stream : ::cvc5::WarningChannel
-#define CVC4Message \
+#define CVC5Message \
::cvc5::__cvc4_true() ? ::cvc5::nullCvc4Stream : ::cvc5::MessageChannel
#define Notice \
::cvc5::__cvc4_true() ? ::cvc5::nullCvc4Stream : ::cvc5::NoticeChannel
|| !::cvc5::WarningChannel.warnOnce(__FILE__, __LINE__)) \
? ::cvc5::nullCvc4Stream \
: ::cvc5::WarningChannel
-#define CVC4Message \
+#define CVC5Message \
(!::cvc5::MessageChannel.isOn()) ? ::cvc5::nullCvc4Stream \
: ::cvc5::MessageChannel
#define Notice \
*/
class IndentedScope
{
- CVC4ostream d_out;
-public:
- inline IndentedScope(CVC4ostream out);
+ CVC5ostream d_out;
+
+ public:
+ inline IndentedScope(CVC5ostream out);
inline ~IndentedScope();
}; /* class IndentedScope */
#if defined(CVC5_DEBUG) && defined(CVC5_TRACING)
-inline IndentedScope::IndentedScope(CVC4ostream out) : d_out(out) { d_out << push; }
+inline IndentedScope::IndentedScope(CVC5ostream out) : d_out(out)
+{
+ d_out << push;
+}
inline IndentedScope::~IndentedScope() { d_out << pop; }
#else /* CVC5_DEBUG && CVC5_TRACING */
-inline IndentedScope::IndentedScope(CVC4ostream out) {}
+inline IndentedScope::IndentedScope(CVC5ostream out) {}
inline IndentedScope::~IndentedScope() {}
#endif /* CVC5_DEBUG && CVC5_TRACING */
void AttributeManager::debugHook(int debugFlag) {
/* DO NOT CHECK IN ANY CODE INTO THE DEBUG HOOKS!
* debugHook() is an empty function for the purpose of debugging
- * the AttributeManager without recompiling all of CVC4.
+ * the AttributeManager without recompiling all of cvc5.
* Formally this is a nop.
*/
}
/**
* debugHook() is an empty function for the purpose of debugging
- * the AttributeManager without recompiling all of CVC4.
+ * the AttributeManager without recompiling all of cvc5.
* Formally this is a nop.
*/
void debugHook(int debugFlag);
std::ostream& operator<<(std::ostream& os, const DType& dt)
{
- // can only output datatypes in the CVC4 native language
- language::SetLanguage::Scope ls(os, language::output::LANG_CVC4);
+ // can only output datatypes in the cvc5 native language
+ language::SetLanguage::Scope ls(os, language::output::LANG_CVC);
dt.toStream(os);
return os;
}
* allow the datatype to construct the necessary testers and selectors.
*
* An additional point to make is that we want to ease the burden on
- * both the parser AND the users of the CVC4 API, so this class takes
+ * both the parser AND the users of the cvc5 API, so this class takes
* on the task of generating its own selectors and testers, for
* instance. That means that, after reifying the DType with the
* NodeManager, the parser needs to go through the (now-resolved)
std::ostream& operator<<(std::ostream& os, const DTypeConstructor& ctor)
{
- // can only output datatypes in the CVC4 native language
- language::SetLanguage::Scope ls(os, language::output::LANG_CVC4);
+ // can only output datatypes in the cvc5 native language
+ language::SetLanguage::Scope ls(os, language::output::LANG_CVC);
ctor.toStream(os);
return os;
}
std::ostream& operator<<(std::ostream& os, const DTypeSelector& arg)
{
- // can only output datatypes in the CVC4 native language
- language::SetLanguage::Scope ls(os, language::output::LANG_CVC4);
+ // can only output datatypes in the cvc5 native language
+ language::SetLanguage::Scope ls(os, language::output::LANG_CVC);
arg.toStream(os);
return os;
}
} // namespace kind
-// import Kind into the "CVC4" namespace but keep the individual kind
+// import Kind into the "cvc5" namespace but keep the individual kind
// constants under kind::
typedef ::cvc5::kind::Kind_t Kind;
namespace metakind {
/**
- * Static, compile-time information about types T representing CVC4
+ * Static, compile-time information about types T representing cvc5
* constants:
*
* typename ConstantMap<T>::OwningTheory
/**
* Static, compile-time information about kinds k and what type their
- * corresponding CVC4 constants are:
+ * corresponding cvc5 constants are:
*
* typename ConstantMapReverse<k>::T
*
#!/usr/bin/env bash
#
# mkexpr
-# Morgan Deters <mdeters@cs.nyu.edu> for CVC4
-# Copyright (c) 2010-2013 The CVC4 Project
+# Morgan Deters <mdeters@cs.nyu.edu> for cvc5
+# Copyright (c) 2010-2013 The cvc5 Project
#
# The purpose of this script is to create {expr,expr_manager}.{h,cpp}
# from template files and a list of theory kinds. Basically it just
#!/usr/bin/env bash
#
# mkkind
-# Morgan Deters <mdeters@cs.nyu.edu> for CVC4
-# Copyright (c) 2010-2013 The CVC4 Project
+# Morgan Deters <mdeters@cs.nyu.edu> for cvc5
+# Copyright (c) 2010-2013 The cvc5 Project
#
# The purpose of this script is to create kind.h (and also
# type_properties.h) from a template and a list of theory kinds.
#!/usr/bin/env bash
#
# mkmetakind
-# Morgan Deters <mdeters@cs.nyu.edu> for CVC4
-# Copyright (c) 2010-2013 The CVC4 Project
+# Morgan Deters <mdeters@cs.nyu.edu> for cvc5
+# Copyright (c) 2010-2013 The cvc5 Project
#
# The purpose of this script is to create metakind.h from a template
# and a list of theory kinds.
* creation. If this is returned as a TNode rather than a Node, the
* count drops to zero, marking the expression as eligible for reclamation.)
*
- * More guidelines on when to use TNodes is available in the CVC4
+ * More guidelines on when to use TNodes is available in the cvc5
* Developer's Guide:
* http://cvc4.cs.stanford.edu/wiki/Developer%27s_Guide#Dealing_with_expressions_.28Nodes_and_TNodes.29
*/
* these functions, as they may only be needed in CNF conversion,
* where it's pointless to do a lazy isAtomic determination by
* searching through the DAG, and storing it, since the result will
- * only be used once. For more details see the 4/27/2010 CVC4
+ * only be used once. For more details see the 4/27/2010 cvc5
* developer's meeting notes at:
*
* http://cvc4.cs.stanford.edu/wiki/Meeting_Minutes_-_April_27,_2010#isAtomic.28.29_and_isAtomicFormula.28.29
* these functions, as they may only be needed in CNF conversion,
* where it's pointless to do a lazy isAtomic determination by
* searching through the DAG, and storing it, since the result will
- * only be used once. For more details see the 4/27/2010 CVC4
+ * only be used once. For more details see the 4/27/2010 cvc5
* developer's meeting notes at:
*
* http://cvc4.cs.stanford.edu/wiki/Meeting_Minutes_-_April_27,_2010#isAtomic.28.29_and_isAtomicFormula.28.29
* lookup is done on the name. If you mkVar("a", type) and then
* mkVar("a", type) again, you have two variables. The NodeManager
* version of this is private to avoid internal uses of mkVar() from
- * within CVC4. Such uses should employ SkolemManager::mkSkolem() instead.
+ * within cvc5. Such uses should employ SkolemManager::mkSkolem() instead.
*/
Node mkVar(const std::string& name, const TypeNode& type);
Node* mkVarPtr(const std::string& name, const TypeNode& type);
explicit NodeManager();
~NodeManager();
- /** The node manager in the current public-facing CVC4 library context */
+ /** The node manager in the current public-facing cvc5 library context */
static NodeManager* currentNM() { return s_current; }
/** Get this node manager's skolem manager */
SkolemManager* getSkolemManager() { return d_skManager.get(); }
* previous thread-global <code>NodeManager</code> when it is
* destroyed, effectively maintaining a set of nested
* <code>NodeManager</code> scopes. This is especially useful on
- * public-interface calls into the CVC4 library, where CVC4's notion
+ * public-interface calls into the cvc5 library, where cvc5's notion
* of the "current" <code>NodeManager</code> should be set to match
* the calling context. See, for example, the implementations of
* public calls in the <code>SmtEngine</code> class.
++d_rc;
Assert(NodeManager::currentNM() != NULL)
<< "No current NodeManager on incrementing of NodeValue: "
- "maybe a public CVC4 interface function is missing a "
+ "maybe a public cvc5 interface function is missing a "
"NodeManagerScope ?";
NodeManager::currentNM()->markRefCountMaxedOut(this);
}
if(__builtin_expect( ( d_rc == 0 ), false )) {
Assert(NodeManager::currentNM() != NULL)
<< "No current NodeManager on destruction of NodeValue: "
- "maybe a public CVC4 interface function is missing a "
+ "maybe a public cvc5 interface function is missing a "
"NodeManagerScope ?";
NodeManager::currentNM()->markForDeletion(this);
}
* An external proof checker is expected to formalize the ProofNode only in
* terms of *witness* forms.
*
- * However, the rest of CVC4 sees only the *Skolem* form of arguments and
- * conclusions in ProofNode, since this is what is used throughout CVC4.
+ * However, the rest of cvc5 sees only the *Skolem* form of arguments and
+ * conclusions in ProofNode, since this is what is used throughout cvc5.
*/
class ProofNode
{
typedef NodeTemplate<true> Node;
class TypeNode;
-/** The CVC4 sequence class
+/** The cvc5 sequence class
*
* This data structure is the domain of values for the sequence type.
*/
/** is closed enumerable type
*
* This returns true if this type has an enumerator that produces constants
- * that are fully handled by CVC4's quantifier-free theory solvers. Examples
+ * that are fully handled by cvc5's quantifier-free theory solvers. Examples
* of types that are not closed enumerable are:
* (1) uninterpreted sorts,
* (2) arrays,
#define CVC5_PRIVATE_H
#if !(defined(__BUILDING_CVC4LIB) || defined(__BUILDING_CVC4LIB_UNIT_TEST))
-# error A private CVC4 header was included when not building the library or private unit test code.
-#endif /* ! (__BUILDING_CVC4LIB || __BUILDING_CVC4LIB_UNIT_TEST) */
+# error A private cvc5 header was included when not building the library or private unit test code.
+#endif
#include "cvc4autoconfig.h"
#include "cvc5_public.h"
|| defined(__BUILDING_CVC4PARSERLIB) \
|| defined(__BUILDING_CVC4PARSERLIB_UNIT_TEST) \
|| defined(__BUILDING_CVC4DRIVER))
-# error A "private library" CVC4 header was included when not building the library, driver, or private unit test code.
-#endif /* ! (__BUILDING_CVC4LIB || __BUILDING_CVC4LIB_UNIT_TEST || \
- __BUILDING_CVC4PARSERLIB || __BUILDING_CVC4PARSERLIB_UNIT_TEST || \
- __BUILDING_CVC4DRIVER) */
+# error A "private library" cvc5 header was included when not building the library, driver, or private unit test code.
+#endif
#include "cvc4autoconfig.h"
#include "cvc5_public.h"
* when the file is included improperly.
*/
-#ifndef __CVC4PARSER_PRIVATE_H
-#define __CVC4PARSER_PRIVATE_H
+#ifndef CVC5PARSER_PRIVATE_H
+#define CVC5PARSER_PRIVATE_H
#if !(defined(__BUILDING_CVC4PARSERLIB) \
|| defined(__BUILDING_CVC4PARSERLIB_UNIT_TEST))
-# error A private CVC4 parser header was included when not building the parser library or private unit test code.
-#endif /* ! (__BUILDING_CVC4PARSERLIB || __BUILDING_CVC4PARSERLIB_UNIT_TEST) \
- */
+# error A private cvc5 parser header was included when not building the parser library or private unit test code.
+#endif
#include "cvc5parser_public.h"
// It would be nice to #include "cvc4autoconfig.h" here, but there are conflicts
//
// #include "cvc4autoconfig.h"
-#endif /* __CVC4PARSER_PRIVATE_H */
+#endif /* CVC5PARSER_PRIVATE_H */
* libraries and driver binary, and also exported to the user.
*/
-#ifndef __CVC4PARSER_PUBLIC_H
-#define __CVC4PARSER_PUBLIC_H
+#ifndef CVC5PARSER_PUBLIC_H
+#define CVC5PARSER_PUBLIC_H
#include "cvc5_public.h"
-#endif /* __CVC4PARSER_PUBLIC_H */
+#endif /* CVC5PARSER_PUBLIC_H */
* directory for licensing information.
* ****************************************************************************
*
- * Driver for CVC4 executable (cvc4).
+ * Driver for cvc5 executable (cvc4).
*/
#include <stdio.h>
void printUsage(Options& opts, bool full) {
stringstream ss;
- ss << "usage: " << opts.getBinaryName() << " [options] [input-file]"
- << endl << endl
- << "Without an input file, or with `-', CVC4 reads from standard input."
- << endl << endl
- << "CVC4 options:" << endl;
+ ss << "usage: " << opts.getBinaryName() << " [options] [input-file]" << endl
+ << endl
+ << "Without an input file, or with `-', cvc5 reads from standard input."
+ << endl
+ << endl
+ << "cvc5 options:" << endl;
if(full) {
Options::printUsage( ss.str(), *(opts.getOut()) );
} else {
if(opts.getInputLanguage() == language::input::LANG_AUTO) {
if( inputFromStdin ) {
// We can't do any fancy detection on stdin
- opts.setInputLanguage(language::input::LANG_CVC4);
+ opts.setInputLanguage(language::input::LANG_CVC);
} else {
unsigned len = filenameStr.size();
if(len >= 5 && !strcmp(".smt2", filename + len - 5)) {
opts.setInputLanguage(language::input::LANG_TPTP);
} else if(( len >= 4 && !strcmp(".cvc", filename + len - 4) )
|| ( len >= 5 && !strcmp(".cvc4", filename + len - 5) )) {
- opts.setInputLanguage(language::input::LANG_CVC4);
+ opts.setInputLanguage(language::input::LANG_CVC);
} else if((len >= 3 && !strcmp(".sy", filename + len - 3))
|| (len >= 3 && !strcmp(".sl", filename + len - 3))) {
// version 2 sygus is the default
InteractiveShell shell(pExecutor->getSolver(),
pExecutor->getSymbolManager());
if(opts.getInteractivePrompt()) {
- CVC4Message() << Configuration::getPackageName() << " "
+ CVC5Message() << Configuration::getPackageName() << " "
<< Configuration::getVersionString();
if(Configuration::isGitBuild()) {
- CVC4Message() << " [" << Configuration::getGitId() << "]";
+ CVC5Message() << " [" << Configuration::getGitId() << "]";
}
- CVC4Message() << (Configuration::isDebugBuild() ? " DEBUG" : "")
+ CVC5Message() << (Configuration::isDebugBuild() ? " DEBUG" : "")
<< " assertions:"
<< (Configuration::isAssertionBuild() ? "on" : "off")
<< endl
<< endl;
- CVC4Message() << Configuration::copyright() << endl;
+ CVC5Message() << Configuration::copyright() << endl;
}
while(true) {
#if HAVE_LIBEDITLINE
if(&d_in == &cin) {
- ::rl_readline_name = const_cast<char*>("CVC4");
+ ::rl_readline_name = const_cast<char*>("cvc5");
#if EDITLINE_COMPENTRY_FUNC_RETURNS_CHARP
::rl_completion_entry_function = commandGenerator;
#else /* EDITLINE_COMPENTRY_FUNC_RETURNS_CHARP */
OutputLanguage lang = toOutputLanguage(d_options.getInputLanguage());
switch(lang) {
- case output::LANG_CVC4:
- d_historyFilename = string(getenv("HOME")) + "/.cvc4_history";
- commandsBegin = cvc_commands;
- commandsEnd = cvc_commands + sizeof(cvc_commands) / sizeof(*cvc_commands);
- break;
- case output::LANG_TPTP:
- d_historyFilename = string(getenv("HOME")) + "/.cvc4_history_tptp";
- commandsBegin = tptp_commands;
- commandsEnd = tptp_commands + sizeof(tptp_commands) / sizeof(*tptp_commands);
- break;
- default:
- if (language::isOutputLang_smt2(lang))
- {
- d_historyFilename = string(getenv("HOME")) + "/.cvc4_history_smtlib2";
- commandsBegin = smt2_commands;
+ case output::LANG_CVC:
+ d_historyFilename = string(getenv("HOME")) + "/.cvc4_history";
+ commandsBegin = cvc_commands;
commandsEnd =
- smt2_commands + sizeof(smt2_commands) / sizeof(*smt2_commands);
- }
- else
- {
- std::stringstream ss;
- ss << "internal error: unhandled language " << lang;
- throw Exception(ss.str());
- }
+ cvc_commands + sizeof(cvc_commands) / sizeof(*cvc_commands);
+ break;
+ case output::LANG_TPTP:
+ d_historyFilename = string(getenv("HOME")) + "/.cvc4_history_tptp";
+ commandsBegin = tptp_commands;
+ commandsEnd =
+ tptp_commands + sizeof(tptp_commands) / sizeof(*tptp_commands);
+ break;
+ default:
+ if (language::isOutputLang_smt2(lang))
+ {
+ d_historyFilename = string(getenv("HOME")) + "/.cvc4_history_smtlib2";
+ commandsBegin = smt2_commands;
+ commandsEnd =
+ smt2_commands + sizeof(smt2_commands) / sizeof(*smt2_commands);
+ }
+ else
+ {
+ std::stringstream ss;
+ ss << "internal error: unhandled language " << lang;
+ throw Exception(ss.str());
+ }
}
d_usingEditline = true;
int err = ::read_history(d_historyFilename.c_str());
{
#if HAVE_LIBEDITLINE
lineBuf = ::readline(d_options.getInteractivePrompt()
- ? (line == "" ? "CVC4> " : "... > ") : "");
+ ? (line == "" ? "cvc5> " : "... > ")
+ : "");
if(lineBuf != NULL && lineBuf[0] != '\0') {
::add_history(lineBuf);
}
{
if(d_options.getInteractivePrompt()) {
if(line == "") {
- d_out << "CVC4> " << flush;
+ d_out << "cvc5> " << flush;
} else {
d_out << "... > " << flush;
}
// because the parse error might be for the second command on the
// line. The first ones haven't yet been executed by the SmtEngine,
// but the parser state has already made the variables and the mappings
- // in the symbol table. So unfortunately, either we exit CVC4 entirely,
+ // in the symbol table. So unfortunately, either we exit cvc5 entirely,
// or we commit to the current line up to the command with the parse
// error.
//
using namespace cvc5::language;
/**
- * CVC4's main() routine is just an exception-safe wrapper around CVC4.
+ * cvc5's main() routine is just an exception-safe wrapper around cvc5.
* Please don't construct anything here. Even if the constructor is
* inside the try { }, an exception during destruction can cause
* problems. That's why main() wraps runCvc4() in the first place.
void timeout_handler()
{
- safe_print(STDERR_FILENO, "CVC4 interrupted by timeout.\n");
+ safe_print(STDERR_FILENO, "cvc5 interrupted by timeout.\n");
print_statistics();
abort();
}
/** Handler for SIGTERM. */
void sigterm_handler(int sig, siginfo_t* info, void*)
{
- safe_print(STDERR_FILENO, "CVC4 interrupted by SIGTERM.\n");
+ safe_print(STDERR_FILENO, "cvc5 interrupted by SIGTERM.\n");
print_statistics();
abort();
}
/** Handler for SIGINT, i.e., when the user hits control C. */
void sigint_handler(int sig, siginfo_t* info, void*)
{
- safe_print(STDERR_FILENO, "CVC4 interrupted by user.\n");
+ safe_print(STDERR_FILENO, "cvc5 interrupted by user.\n");
print_statistics();
abort();
}
uintptr_t extent = reinterpret_cast<uintptr_t>(cvc4StackBase) - cvc4StackSize;
uintptr_t addr = reinterpret_cast<uintptr_t>(info->si_addr);
#ifdef CVC5_DEBUG
- safe_print(STDERR_FILENO, "CVC4 suffered a segfault in DEBUG mode.\n");
+ safe_print(STDERR_FILENO, "cvc5 suffered a segfault in DEBUG mode.\n");
safe_print(STDERR_FILENO, "Offending address is ");
safe_print(STDERR_FILENO, info->si_addr);
safe_print(STDERR_FILENO, "\n");
}
}
#else /* CVC5_DEBUG */
- safe_print(STDERR_FILENO, "CVC4 suffered a segfault.\n");
+ safe_print(STDERR_FILENO, "cvc5 suffered a segfault.\n");
safe_print(STDERR_FILENO, "Offending address is ");
safe_print(STDERR_FILENO, info->si_addr);
safe_print(STDERR_FILENO, "\n");
{
#ifdef CVC5_DEBUG
safe_print(STDERR_FILENO,
- "CVC4 executed an illegal instruction in DEBUG mode.\n");
+ "cvc5 executed an illegal instruction in DEBUG mode.\n");
if (!segvSpin)
{
print_statistics();
}
}
#else /* CVC5_DEBUG */
- safe_print(STDERR_FILENO, "CVC4 executed an illegal instruction.\n");
+ safe_print(STDERR_FILENO, "cvc5 executed an illegal instruction.\n");
print_statistics();
abort();
#endif /* CVC5_DEBUG */
safe_print(STDERR_FILENO,
"\n"
- "CVC4 was terminated by the C++ runtime.\n"
+ "cvc5 was terminated by the C++ runtime.\n"
"Perhaps an exception was thrown during stack unwinding. "
"(Don't do that.)\n");
print_statistics();
default_terminator();
#else /* CVC5_DEBUG */
safe_print(STDERR_FILENO,
- "CVC4 was terminated by the C++ runtime.\n"
+ "cvc5 was terminated by the C++ runtime.\n"
"Perhaps an exception was thrown during stack unwinding.\n");
print_statistics();
default_terminator();
type = "int"
default = "0"
predicates = ["setVerbosity"]
- help = "the verbosity level of CVC4"
+ help = "the verbosity level of cvc5"
[[option]]
category = "common"
* ``What do you mean? I don't understand.'' An attempt to be more
* helpful than that. Similar to one in git.
*
- * There are no dependencies on CVC4 (except namespace).
+ * There are no dependencies on cvc5 (except namespace).
*/
#include "options/didyoumean.h"
* ``What do you mean? I don't understand.'' An attempt to be more
* helpful than that. Similar to one in git.
*
- * There are no dependencies on CVC4 (except namespace).
+ * There are no dependencies on cvc5 (except namespace).
*/
#pragma once
* \todo document this file
*/
-// This is not built as a part of CVC4 and is not built by Makefile.am.
+// This is not built as a part of cvc5 and is not built by Makefile.am.
// Compile: g++ didyoumean_test.cpp didyoumean.cpp
// For debug compile with -DDIDYOUMEAN_DEBUG or -DDIDYOUMEAN_DEBUG1 or both
switch(language) {
case output::LANG_SMTLIB_V2_6:
case output::LANG_TPTP:
- case output::LANG_CVC4:
+ case output::LANG_CVC:
case output::LANG_SYGUS_V2:
// these entries directly correspond (by design)
return InputLanguage(int(language));
switch(language) {
case input::LANG_SMTLIB_V2_6:
case input::LANG_TPTP:
- case input::LANG_CVC4:
+ case input::LANG_CVC:
case input::LANG_SYGUS_V2:
// these entries directly correspond (by design)
return OutputLanguage(int(language));
// it's better to output SOMETHING related to the original
// exception rather than mask it with another exception. Also,
// the input language isn't always defined---e.g. during the
- // initial phase of the main CVC4 driver while it determines which
+ // initial phase of the main cvc5 driver while it determines which
// language is appropriate, and during unit tests. Also, when
// users are writing their own code against the library.
return output::LANG_AST;
}/* toOutputLanguage() */
OutputLanguage toOutputLanguage(std::string language) {
- if(language == "cvc4" || language == "pl" ||
- language == "presentation" || language == "native" ||
- language == "LANG_CVC4") {
- return output::LANG_CVC4;
- } else if(language == "cvc3" || language == "LANG_CVC3") {
+ if (language == "cvc4" || language == "pl" || language == "presentation"
+ || language == "native" || language == "LANG_CVC")
+ {
+ return output::LANG_CVC;
+ }
+ else if (language == "cvc3" || language == "LANG_CVC3")
+ {
return output::LANG_CVC3;
}
else if (language == "smtlib" || language == "smt" || language == "smtlib2"
}/* toOutputLanguage() */
InputLanguage toInputLanguage(std::string language) {
- if(language == "cvc4" || language == "pl" ||
- language == "presentation" || language == "native" ||
- language == "LANG_CVC4") {
- return input::LANG_CVC4;
- } else if(language == "smtlib" || language == "smt" ||
- language == "smtlib2" || language == "smt2" ||
- language == "smtlib2.6" || language == "smt2.6" ||
- language == "LANG_SMTLIB_V2_6" || language == "LANG_SMTLIB_V2") {
+ if (language == "cvc4" || language == "pl" || language == "presentation"
+ || language == "native" || language == "LANG_CVC")
+ {
+ return input::LANG_CVC;
+ }
+ else if (language == "smtlib" || language == "smt" || language == "smtlib2"
+ || language == "smt2" || language == "smtlib2.6"
+ || language == "smt2.6" || language == "LANG_SMTLIB_V2_6"
+ || language == "LANG_SMTLIB_V2")
+ {
return input::LANG_SMTLIB_V2_6;
- } else if(language == "tptp" || language == "LANG_TPTP") {
+ }
+ else if (language == "tptp" || language == "LANG_TPTP")
+ {
return input::LANG_TPTP;
- } else if(language == "sygus" || language == "sygus2" ||
- language == "LANG_SYGUS" || language == "LANG_SYGUS_V2") {
+ }
+ else if (language == "sygus" || language == "sygus2"
+ || language == "LANG_SYGUS" || language == "LANG_SYGUS_V2")
+ {
return input::LANG_SYGUS_V2;
}
else if (language == "auto" || language == "LANG_AUTO")
LANG_SMTLIB_V2 = LANG_SMTLIB_V2_6,
/** The TPTP input language */
LANG_TPTP,
- /** The CVC4 input language */
- LANG_CVC4,
+ /** The cvc5 input language */
+ LANG_CVC,
/** The SyGuS input language version 2.0 */
LANG_SYGUS_V2,
case LANG_TPTP:
out << "LANG_TPTP";
break;
- case LANG_CVC4:
- out << "LANG_CVC4";
- break;
+ case LANG_CVC: out << "LANG_CVC"; break;
case LANG_SYGUS_V2: out << "LANG_SYGUS_V2"; break;
default:
out << "undefined_input_language";
LANG_SMTLIB_V2 = input::LANG_SMTLIB_V2,
/** The TPTP output language */
LANG_TPTP = input::LANG_TPTP,
- /** The CVC4 output language */
- LANG_CVC4 = input::LANG_CVC4,
+ /** The cvc5 output language */
+ LANG_CVC = input::LANG_CVC,
/** The sygus output language version 2.0 */
LANG_SYGUS_V2 = input::LANG_SYGUS_V2,
case LANG_TPTP:
out << "LANG_TPTP";
break;
- case LANG_CVC4:
- out << "LANG_CVC4";
- break;
+ case LANG_CVC: out << "LANG_CVC"; break;
case LANG_SYGUS_V2: out << "LANG_SYGUS_V2"; break;
case LANG_AST:
out << "LANG_AST";
type = "bool"
read_only = true
alternate = false
- help = "identify this CVC4 binary"
+ help = "identify this cvc5 binary"
[[option]]
name = "help"
type = "void"
handler = "showConfiguration"
read_only = true
- help = "show CVC4 static configuration"
+ help = "show cvc5 static configuration"
[[option]]
category = "common"
type = "void"
handler = "copyright"
read_only = true
- help = "show CVC4 copyright information"
+ help = "show cvc5 copyright information"
[[option]]
name = "seed"
#ifndef CVC5_USE_ABC
if(value) {
std::stringstream ss;
- ss << "option `" << option << "' requires an abc-enabled build of CVC4; this binary was not built with abc support";
+ ss << "option `" << option
+ << "' requires an abc-enabled build of cvc5; this binary was not built "
+ "with abc support";
throw OptionException(ss.str());
}
#endif /* CVC5_USE_ABC */
#ifndef CVC5_USE_ABC
if(!value.empty()) {
std::stringstream ss;
- ss << "option `" << option << "' requires an abc-enabled build of CVC4; this binary was not built with abc support";
+ ss << "option `" << option
+ << "' requires an abc-enabled build of cvc5; this binary was not built "
+ "with abc support";
throw OptionException(ss.str());
}
#endif /* CVC5_USE_ABC */
{
std::stringstream ss;
ss << "option `" << option
- << "' requires a CryptoMiniSat build of CVC4; this binary was not built "
+ << "' requires a CryptoMiniSat build of cvc5; this binary was not built "
"with CryptoMiniSat support";
throw OptionException(ss.str());
}
{
std::stringstream ss;
ss << "option `" << option
- << "' requires a CaDiCaL build of CVC4; this binary was not built with "
+ << "' requires a CaDiCaL build of cvc5; this binary was not built with "
"CaDiCaL support";
throw OptionException(ss.str());
}
{
std::stringstream ss;
ss << "option `" << option
- << "' requires a Kissat build of CVC4; this binary was not built with "
+ << "' requires a Kissat build of cvc5; this binary was not built with "
"Kissat support";
throw OptionException(ss.str());
}
if (value)
{
std::stringstream ss;
- ss << "option `" << option << "' requires a statistics-enabled build of CVC4; this binary was not built with statistics support";
+ ss << "option `" << option
+ << "' requires a statistics-enabled build of cvc5; this binary was not "
+ "built with statistics support";
throw OptionException(ss.str());
}
#endif /* CVC5_STATISTICS_ON */
&& !defined(CVC5_USE_KISSAT)
std::stringstream ss;
ss << "option `" << option
- << "' requires CVC4 to be built with CryptoMiniSat or CaDiCaL or Kissat";
+ << "' requires cvc5 to be built with CryptoMiniSat or CaDiCaL or Kissat";
throw OptionException(ss.str());
#endif
}
static const std::string mostCommonOptionsDescription = "\
-Most commonly-used CVC4 options:\n"
+Most commonly-used cvc5 options:\n"
${help_common}$;
static const std::string optionsDescription = mostCommonOptionsDescription + "\n\
\n\
-Additional CVC4 options:\n"
+Additional cvc5 options:\n"
${help_others}$;
"\
Languages currently supported as arguments to the -L / --lang option:\n\
auto attempt to automatically determine language\n\
- cvc4 | presentation | pl CVC4 presentation language\n\
+ cvc4 | presentation | pl cvc5 presentation language\n\
smt | smtlib | smt2 |\n\
smt2.6 | smtlib2.6 SMT-LIB format 2.6 with support for the strings standard\n\
tptp TPTP format (cnf, fof and tff)\n\
\n\
Languages currently supported as arguments to the --output-lang option:\n\
auto match output language to input language\n\
- cvc4 | presentation | pl CVC4 presentation language\n\
+ cvc4 | presentation | pl cvc5 presentation language\n\
cvc3 CVC3 presentation language\n\
smt | smtlib | smt2 |\n\
smt2.6 | smtlib2.6 SMT-LIB format 2.6 with support for the strings standard\n\
# is still permitted to read the input file given on the command-line if any.
# creation/use of temp files are still permitted (but the paths aren't given by
# the user). Also note this is only safe for the version invoked through the
-# main driver, there are ways via the API to get the CVC4 library to open a file
+# main driver, there are ways via the API to get the cvc5 library to open a file
# for reading or writing and thus leak information from an existing file, or
# overwrite an existing file with malicious content.
[[option]]
# Solution reconstruction modes for single invocation conjectures
#
-# These modes indicate the policy when CVC4 solves a synthesis conjecture using
+# These modes indicate the policy when cvc5 solves a synthesis conjecture using
# single invocation techniques for a sygus problem with a user-specified
# grammar.
#
help_mode = "Modes for reconstruction solutions while using single invocation techniques."
[[option.mode.NONE]]
name = "none"
- help = "Do not try to reconstruct solutions in the original (user-provided) grammar when using single invocation techniques. In this mode, solutions produced by CVC4 may violate grammar restrictions."
+ help = "Do not try to reconstruct solutions in the original (user-provided) grammar when using single invocation techniques. In this mode, solutions produced by cvc5 may violate grammar restrictions."
[[option.mode.TRY]]
name = "try"
help = "Try to reconstruct solutions in the original grammar when using single invocation techniques in an incomplete (fail-fast) manner."
long = "sygus-query-gen-check"
type = "bool"
default = "true"
- help = "use interesting satisfiability queries to check soundness of CVC4"
+ help = "use interesting satisfiability queries to check soundness of cvc5"
[[option]]
name = "sygusQueryGenDumpFiles"
AntlrInput* input;
switch(lang) {
- case LANG_CVC4: {
- input = new CvcInput(inputStream);
- break;
- }
+ case LANG_CVC:
+ {
+ input = new CvcInput(inputStream);
+ break;
+ }
case LANG_SYGUS_V2: input = new SygusInput(inputStream); break;
/*
* The functions in this file are based on implementations in libantlr3c,
- * with only minor CVC4-specific changes.
+ * with only minor cvc5-specific changes.
*/
// [The "BSD licence"]
///
/// If you override, make sure to update errorCount if you care about that.
///
-/* *** CVC4 NOTE ***
+/* *** cvc5 NOTE ***
* This function is has been modified in not-completely-trivial ways from its
* libantlr3c implementation to support more informative error messages and to
* invoke the error reporting mechanism of the Input class instead of the
pANTLR3_UINT8 * tokenNames = recognizer->state->tokenNames;
stringstream ss;
- // Dig the CVC4 objects out of the ANTLR3 mess
+ // Dig the cvc5 objects out of the ANTLR3 mess
pANTLR3_PARSER antlr3Parser = (pANTLR3_PARSER)(recognizer->super);
Assert(antlr3Parser != NULL);
Parser *parser = (Parser*)(antlr3Parser->super);
///
/// \see nextToken
///
-/* *** CVC4 NOTE ***
+/* *** cvc5 NOTE ***
* This is copied, largely unmodified, from antlr3lexer.c
*
*/
// Recognition exception, report it and try to recover.
//
lexer->rec->state->failed = ANTLR3_TRUE;
- // *** CVC4 EDIT: Just call the AntlrInput error routine
+ // *** cvc5 EDIT: Just call the AntlrInput error routine
lexerError(lexer->rec);
lexer->recover(lexer);
}
{
// Emit the real token, which adds it in to the token stream basically
//
- // *** CVC4 Edit: call emit on the lexer object
+ // *** cvc5 Edit: call emit on the lexer object
lexer->emit(lexer);
}
else if (lexer->rec->state->token == &(toksource->skipToken))
}
}
-/* *** CVC4 NOTE ***
+/* *** cvc5 NOTE ***
* This is copied, totaly unmodified, from antlr3lexer.c
* in order to use nextTokenStr previously defined.
*
*
* By default, ANTLR expects the whole input to be in a single, consecutive
* buffer. When doing incremental solving and the input is coming from the
- * standard input, this is problematic because CVC4 might receive new input
+ * standard input, this is problematic because cvc5 might receive new input
* based on the result of solving the existing input.
*
* This file overwrites the _LA and the consume functions of the input streamto
struct JavaPrinter {
template <class T>
JavaPrinter operator+(const T& t) const {
- CVC4Message() << t;
+ CVC5Message() << t;
return JavaPrinter();
}
};/* struct JavaPrinter */
* to the call-by-value semantics of C. All that's left to
* do is print the newline.
*/
- void println(JavaPrinter) { CVC4Message() << std::endl; }
+ void println(JavaPrinter) { CVC5Message() << std::endl; }
} out;
} System;
// defaultErrorHandler = false;
// Only lookahead of <= k requested (disable for LL* parsing)
- // Note that CVC4's BoundedTokenBuffer requires a fixed k !
+ // Note that cvc5's BoundedTokenBuffer requires a fixed k !
// If you change this k, change it also in cvc_input.cpp !
k = 3;
}/* options */
namespace cvc5 {
class Expr;
-}/* CVC4 namespace */
+}/* cvc5 namespace */
}/* @parser::includes */
{ std::string s = AntlrInput::tokenText($IDENTIFIER);
if(s == "benchmark") {
PARSER_STATE->parseError(
- "In CVC4 presentation language mode, but SMT-LIBv1 format "
+ "In cvc5 presentation language mode, but SMT-LIBv1 format "
"detected, which is not supported anymore.");
} else if(s == "set" || s == "get" || s == "declare" ||
s == "define" || s == "assert") {
PARSER_STATE->parseError(
- "In CVC4 presentation language mode, but SMT-LIB format detected. "
+ "In cvc5 presentation language mode, but SMT-LIB format detected. "
"Use --lang smt for SMT-LIB support.");
} else {
PARSER_STATE->parseError(
- "A CVC4 presentation language command cannot begin with a "
+ "A cvc5 presentation language command cannot begin with a "
"parenthesis; expected command name.");
}
}
| DBG_TOK
( ( str[s] | IDENTIFIER { s = AntlrInput::tokenText($IDENTIFIER); } )
{ Debug.on(s); Trace.on(s); }
- | { CVC4Message() << "Please specify what to debug." << std::endl; }
+ | { CVC5Message() << "Please specify what to debug." << std::endl; }
)
| TRACE_TOK
( ( str[s] | IDENTIFIER { s = AntlrInput::tokenText($IDENTIFIER); } )
{ Trace.on(s); }
- | { CVC4Message() << "Please specify something to trace." << std::endl; }
+ | { CVC5Message() << "Please specify something to trace." << std::endl; }
)
| UNTRACE_TOK
( ( str[s] | IDENTIFIER { s = AntlrInput::tokenText($IDENTIFIER); } )
{ Trace.off(s); }
- | { CVC4Message() << "Please specify something to untrace." << std::endl; }
+ | { CVC5Message() << "Please specify something to untrace." << std::endl; }
)
| HELP_TOK
( ( str[s] | IDENTIFIER { s = AntlrInput::tokenText($IDENTIFIER); } )
- { CVC4Message() << "No help available for `" << s << "'." << std::endl; }
- | { CVC4Message() << "Please use --help at the command line for help."
+ { CVC5Message() << "No help available for `" << s << "'." << std::endl; }
+ | { CVC5Message() << "Please use --help at the command line for help."
<< std::endl; }
)
<< "with type " << oldType << std::endl;
if(oldType != t) {
std::stringstream ss;
- ss << language::SetLanguage(language::output::LANG_CVC4)
+ ss << language::SetLanguage(language::output::LANG_CVC)
<< "incompatible type for `" << *i << "':" << std::endl
<< " old type: " << oldType << std::endl
<< " new type: " << t << std::endl;
;
/**
- * Matches a CVC4 expression. Formulas and terms are not really
+ * Matches a cvc5 expression. Formulas and terms are not really
* distinguished during parsing; please ignore the naming of the
* grammar rules.
*
}
: identifier[name,CHECK_NONE,SYM_VARIABLE] EQUAL_TOK formula[e]
{
- Debug("parser") << language::SetLanguage(language::output::LANG_CVC4)
+ Debug("parser") << language::SetLanguage(language::output::LANG_CVC)
<< e.getSort() << std::endl;
PARSER_STATE->defineVar(name, e);
Debug("parser") << "LET[" << PARSER_STATE->scopeLevel() << "]: "
-Notes on CVC4's CVC language parser.
+Notes on cvc5's CVC language parser.
This language parser attempts to maintain some backward compatibility
with previous versions of the language. However, as the language
In order to support our users, we have tried to parse what CVC3 could
and (at least) offer an error when a feature is unavailable or
unimplemented. But this is not always possible. Please report a
-bug if a particular discrepancy between CVC3 and CVC4 handling of
+bug if a particular discrepancy between CVC3 and cvc5 handling of
the CVC language is a concern to you; we may be able to add a
compatibility mode, or at least offer better warnings or errors.
-Below is a list of the known differences between CVC3's and CVC4's
+Below is a list of the known differences between CVC3's and cvc5's
version of the CVC language. This is the list of differences in
-language design and parsing ONLY. The featureset of CVC4 is
+language design and parsing ONLY. The featureset of cvc5 is
rapidly expanding, but does not match CVC3's breadth yet. However,
-CVC4 should tell you of an unimplemented feature if you try to use
+cvc5 should tell you of an unimplemented feature if you try to use
it (rather than giving a cryptic parse or assertion error).
-* CVC4 does not add the current assumptions to the scope after
+* cvc5 does not add the current assumptions to the scope after
SAT/INVALID responses like CVC3 did.
-* CVC4 no longer supports the "old" function syntax:
+* cvc5 no longer supports the "old" function syntax:
f : [INT -> INT];
* QUERY and CHECKSAT do not add their argument to the current
list of assertions like CVC3 did.
-* CVC4 allows datatypes to hold complex types that contain self-
+* cvc5 allows datatypes to hold complex types that contain self-
or mutual references. For example,
DATATYPE tree = node(children:ARRAY INT OF tree) | leaf(data:INT) END;
- is permissible in CVC4 but not in CVC3.
+ is permissible in cvc5 but not in CVC3.
-* CVC4 supports parameterized types in datatype definitions, e.g.
+* cvc5 supports parameterized types in datatype definitions, e.g.
DATATYPE list[T] = cons(car:T) | nil END;
You can then declare "x : list[INT];" or "x : list[list[INT]];",
for example.
-* CVC4 supports type ascriptions, e.g.
+* cvc5 supports type ascriptions, e.g.
U : TYPE;
f : INT -> U;
DATATYPE Item = Carrots | Butter | Milk | Bread END;
groceries : list[Item] = cons(Butter, cons(Bread, nil:list[INT]));
-* CVC4 supports stronger distinction between type and variable names.
- This means that CVC4 may allow you to declare things that CVC3 does
+* cvc5 supports stronger distinction between type and variable names.
+ This means that cvc5 may allow you to declare things that CVC3 does
not:
a : TYPE;
a : INT; % CVC3 complains
- a : a; % CVC4 complains, `a' cannot both be INT and `a'
+ a : a; % cvc5 complains, `a' cannot both be INT and `a'
b : a; % No problem, `a' is both the type of `b', and an INT
-* CVC4 supports a command-level LET syntax, e.g.:
+* cvc5 supports a command-level LET syntax, e.g.:
LET double = LAMBDA(x:INT) : 2*x IN
QUERY double(5) = 10;
*/
void checkFunctionLike(api::Term fun);
- /** Create a new CVC4 variable expression of the given type.
+ /** Create a new cvc5 variable expression of the given type.
*
* It is inserted at context level zero in the symbol table if levelZero is
* true, or if we are using global declarations.
bool doOverload = false);
/**
- * Create a set of new CVC4 variable expressions of the given type.
+ * Create a set of new cvc5 variable expressions of the given type.
*
* It is inserted at context level zero in the symbol table if levelZero is
* true, or if we are using global declarations.
bool doOverload = false);
/**
- * Create a new CVC4 bound variable expression of the given type. This binds
+ * Create a new cvc5 bound variable expression of the given type. This binds
* the symbol name to that variable in the current scope.
*/
api::Term bindBoundVar(const std::string& name, const api::Sort& type);
/**
- * Create a new CVC4 bound variable expressions of the given names and types.
+ * Create a new cvc5 bound variable expressions of the given names and types.
* Like the method above, this binds these names to those variables in the
* current scope.
*/
std::vector<std::pair<std::string, api::Sort> >& sortedVarNames);
/**
- * Create a set of new CVC4 bound variable expressions of the given type.
+ * Create a set of new cvc5 bound variable expressions of the given type.
*
* For each name, if a symbol with name already exists,
* then if doOverload is true, we create overloaded operators.
- * else if doOverload is false, the existing expression is shadowed by the new expression.
+ * else if doOverload is false, the existing expression is shadowed by the
+ * new expression.
*/
std::vector<api::Term> bindBoundVars(const std::vector<std::string> names,
const api::Sort& type);
* parse would otherwise be an incorrect parse tree and the error
* would go undetected. This is specifically for circumstances
* where the parser is ahead of the functionality present elsewhere
- * in CVC4 (such as quantifiers, subtypes, records, etc. in the CVC
+ * in cvc5 (such as quantifiers, subtypes, records, etc. in the CVC
* language parser).
*/
ParserBuilder& withParseOnly(bool flag = true);
// defaultErrorHandler = false;
// Only lookahead of <= k requested (disable for LL* parsing)
- // Note that CVC4's BoundedTokenBuffer requires a fixed k !
+ // Note that cvc5's BoundedTokenBuffer requires a fixed k !
// If you change this k, change it also in smt2_input.cpp !
k = 2;
}/* options */
class Sort;
}
-}/* CVC4 namespace */
+}/* cvc5 namespace */
}/* @parser::includes */
/* New SMT-LIB 2.5 command set */
| smt25Command[cmd]
- /* CVC4-extended SMT-LIB commands */
+ /* cvc5-extended SMT-LIB commands */
| extendedCommand[cmd]
{ if(PARSER_STATE->strictModeEnabled()) {
PARSER_STATE->parseError(
<< "2.0 format requires a predeclaration of the non-terminal "
<< "symbols of the grammar to be given prior to the definition "
<< "of the grammar. See https://sygus.org/language/ for details "
- << "and examples. CVC4 versions past 1.8 do not support SyGuS "
+ << "and examples. cvc5 versions past 1.8 do not support SyGuS "
<< "version 1.0.";
}
else
else
{
warning("No set-logic command was given before this point.");
- warning("CVC4 will make all theories available.");
+ warning("cvc5 will make all theories available.");
warning(
"Consider setting a stricter logic for (likely) better "
"performance.");
// defaultErrorHandler = false;
// Only lookahead of <= k requested (disable for LL* parsing)
- // Note that CVC4's BoundedTokenBuffer requires a fixed k !
+ // Note that cvc5's BoundedTokenBuffer requires a fixed k !
// If you change this k, change it also in tptp_input.cpp !
k = 2;
}/* options */
if (!d_unconstrained.empty())
{
processUnconstrained();
- // d_substitutions.print(CVC4Message.getStream());
+ // d_substitutions.print(CVC5Message.getStream());
for (size_t i = 0, asize = assertions.size(); i < asize; ++i)
{
Node a = assertions[i];
}
toStreamNode(out, n[i], -1, false, lbind);
out << ":";
- n[i].getType().toStream(out, language::output::LANG_CVC4);
+ n[i].getType().toStream(out, language::output::LANG_CVC);
}
out << ')';
return;
case LANG_TPTP:
return unique_ptr<Printer>(new printer::tptp::TptpPrinter());
- case LANG_CVC4:
- return unique_ptr<Printer>(new printer::cvc::CvcPrinter());
+ case LANG_CVC: return unique_ptr<Printer>(new printer::cvc::CvcPrinter());
case LANG_SYGUS_V2:
// sygus version 2.0 does not have discrepancies with smt2, hence we use
The code has been modified to put everything in the cvc5::MiniSat
namespace. The build process has been modified. Other parts have
-been modified to serve CVC4's purposes.
+been modified to serve cvc5's purposes.
-- Morgan Deters <mdeters@cs.nyu.edu> Sun, 07 Nov 2010 22:27:09 -0500
#endif
} /* cvc5::BVMinisat namespace */
-} /* CVC4 namespace */
+} /* cvc5 namespace */
*
* Wrapper for CaDiCaL SAT Solver.
*
- * Implementation of the CaDiCaL SAT solver for CVC4 (bit-vectors).
+ * Implementation of the CaDiCaL SAT solver for cvc5 (bit-vectors).
*/
#include "prop/cadical.h"
*
* Wrapper for CaDiCaL SAT Solver.
*
- * Implementation of the CaDiCaL SAT solver for CVC4 (bit-vectors).
+ * Implementation of the CaDiCaL SAT solver for cvc5 (bit-vectors).
*/
#include "cvc5_private.h"
================ CHANGES TO THE ORIGINAL CODE ==================================
-The only CVC4 connections passed to minisat are the proxy (defined in sat.h) and
+The only cvc5 connections passed to minisat are the proxy (defined in sat.h) and
the context. The context is obtained from the SmtEngine, and the proxy is an
intermediary class that has all-access to the SatSolver so as to simplify the
interface to (possible) other sat solvers. These two are passed to minisat at
now modified to pop the context the appropriate number of times.
Minisat pushes the scope in the newDecisionLevel() method where we appropriately
-also push the CVC4 context.
+also push the cvc5 context.
* Phase caching
trail_ok.push(ok);
assigns_lim.push(assigns.size());
- d_context->push(); // SAT context for CVC4
+ d_context->push(); // SAT context for cvc5
Debug("minisat") << "MINISAT PUSH assertionLevel is " << assertionLevel << ", trail.size is " << trail.size() << std::endl;
}
removeClausesAboveLevel(clauses_removable, assertionLevel);
Debug("minisat") << cvc5::pop;
// Pop the SAT context to notify everyone
- d_context->pop(); // SAT context for CVC4
+ d_context->pop(); // SAT context for cvc5
Debug("minisat") << "MINISAT POP assertionLevel is " << assertionLevel
<< ", trail.size is " << trail.size() << "\n";
// Solver -- the main class:
class Solver {
-
- /** The only two CVC4 entry points to the private solver data */
+ /** The only two cvc5 entry points to the private solver data */
friend class cvc5::prop::PropEngine;
friend class cvc5::prop::TheoryProxy;
friend class cvc5::prop::SatProofManager;
}
};
- // CVC4 context push/pop
- void push ();
- void pop ();
-
- /*
- * Reset the decisions in the DPLL(T) SAT solver at the current assertion
- * level.
- */
- void resetTrail();
- // addClause returns the ClauseId corresponding to the clause added in the
- // reference parameter id.
- bool addClause (const vec<Lit>& ps, bool removable, ClauseId& id); // Add a clause to the solver.
- bool addEmptyClause(bool removable); // Add the empty clause, making the solver contradictory.
- bool addClause (Lit p, bool removable, ClauseId& id); // Add a unit clause to the solver.
- bool addClause (Lit p, Lit q, bool removable, ClauseId& id); // Add a binary clause to the solver.
- bool addClause (Lit p, Lit q, Lit r, bool removable, ClauseId& id); // Add a ternary clause to the solver.
- bool addClause_( vec<Lit>& ps, bool removable, ClauseId& id); // Add a clause to the solver without making superflous internal copy. Will
- // change the passed vector 'ps'.
-
- // Solving:
- //
- bool simplify (); // Removes already satisfied clauses.
- lbool solve (const vec<Lit>& assumps); // Search for a model that respects a given set of assumptions.
- lbool solveLimited (const vec<Lit>& assumps); // Search for a model that respects a given set of assumptions (With resource constraints).
- lbool solve (); // Search without assumptions.
- lbool solve (Lit p); // Search for a model that respects a single assumption.
- lbool solve (Lit p, Lit q); // Search for a model that respects two assumptions.
- lbool solve (Lit p, Lit q, Lit r); // Search for a model that respects three assumptions.
- bool okay () const; // FALSE means solver is in a conflicting state
-
- void toDimacs();
- void toDimacs (FILE* f, const vec<Lit>& assumps); // Write CNF to file in DIMACS-format.
- void toDimacs (const char *file, const vec<Lit>& assumps);
- void toDimacs (FILE* f, Clause& c, vec<Var>& map, Var& max);
-
- // Convenience versions of 'toDimacs()':
- void toDimacs (const char* file);
- void toDimacs (const char* file, Lit p);
- void toDimacs (const char* file, Lit p, Lit q);
- void toDimacs (const char* file, Lit p, Lit q, Lit r);
-
- // Variable mode:
- //
- void setPolarity (Var v, bool b); // Declare which polarity the decision heuristic should use for a variable. Requires mode 'polarity_user'.
- void freezePolarity (Var v, bool b); // Declare which polarity the decision heuristic MUST ALWAYS use for a variable. Requires mode 'polarity_user'.
- void setDecisionVar (Var v, bool b); // Declare if a variable should be eligible for selection in the decision heuristic.
-
- // Read state:
- //
- lbool value (Var x) const; // The current value of a variable.
- lbool value (Lit p) const; // The current value of a literal.
- lbool modelValue (Var x) const; // The value of a variable in the last model. The last call to solve must have been satisfiable.
- lbool modelValue (Lit p) const; // The value of a literal in the last model. The last call to solve must have been satisfiable.
- int nAssigns () const; // The current number of assigned literals.
- int nClauses () const; // The current number of original clauses.
- int nLearnts () const; // The current number of learnt clauses.
- int nVars () const; // The current number of variables.
- int nFreeVars () const;
- bool isDecision (Var x) const; // is the given var a decision?
-
- // Debugging SMT explanations
- //
- bool properExplanation(Lit l, Lit expl) const; // returns true if expl can be used to explain l---i.e., both assigned and trail_index(expl) < trail_index(l)
-
- // Resource contraints:
- //
- void setConfBudget(int64_t x);
- void setPropBudget(int64_t x);
- void budgetOff();
- void interrupt(); // Trigger a (potentially asynchronous) interruption of the solver.
- void clearInterrupt(); // Clear interrupt indicator flag.
+ // cvc5 context push/pop
+ void push();
+ void pop();
+
+ /*
+ * Reset the decisions in the DPLL(T) SAT solver at the current assertion
+ * level.
+ */
+ void resetTrail();
+ // addClause returns the ClauseId corresponding to the clause added in the
+ // reference parameter id.
+ bool addClause(const vec<Lit>& ps,
+ bool removable,
+ ClauseId& id); // Add a clause to the solver.
+ bool addEmptyClause(
+ bool removable); // Add the empty clause, making the solver contradictory.
+ bool addClause(Lit p,
+ bool removable,
+ ClauseId& id); // Add a unit clause to the solver.
+ bool addClause(Lit p,
+ Lit q,
+ bool removable,
+ ClauseId& id); // Add a binary clause to the solver.
+ bool addClause(Lit p,
+ Lit q,
+ Lit r,
+ bool removable,
+ ClauseId& id); // Add a ternary clause to the solver.
+ bool addClause_(
+ vec<Lit>& ps,
+ bool removable,
+ ClauseId& id); // Add a clause to the solver without making superflous
+ // internal copy. Will change the passed vector 'ps'.
+
+ // Solving:
+ //
+ bool simplify(); // Removes already satisfied clauses.
+ lbool solve(const vec<Lit>& assumps); // Search for a model that respects a
+ // given set of assumptions.
+ lbool solveLimited(
+ const vec<Lit>& assumps); // Search for a model that respects a given set
+ // of assumptions (With resource constraints).
+ lbool solve(); // Search without assumptions.
+ lbool solve(Lit p); // Search for a model that respects a single assumption.
+ lbool solve(Lit p,
+ Lit q); // Search for a model that respects two assumptions.
+ lbool solve(Lit p,
+ Lit q,
+ Lit r); // Search for a model that respects three assumptions.
+ bool okay() const; // FALSE means solver is in a conflicting state
+
+ void toDimacs();
+ void toDimacs(FILE* f,
+ const vec<Lit>& assumps); // Write CNF to file in DIMACS-format.
+ void toDimacs(const char* file, const vec<Lit>& assumps);
+ void toDimacs(FILE* f, Clause& c, vec<Var>& map, Var& max);
+
+ // Convenience versions of 'toDimacs()':
+ void toDimacs(const char* file);
+ void toDimacs(const char* file, Lit p);
+ void toDimacs(const char* file, Lit p, Lit q);
+ void toDimacs(const char* file, Lit p, Lit q, Lit r);
+
+ // Variable mode:
+ //
+ void setPolarity(
+ Var v, bool b); // Declare which polarity the decision heuristic should
+ // use for a variable. Requires mode 'polarity_user'.
+ void freezePolarity(
+ Var v,
+ bool b); // Declare which polarity the decision heuristic MUST ALWAYS use
+ // for a variable. Requires mode 'polarity_user'.
+ void setDecisionVar(Var v,
+ bool b); // Declare if a variable should be eligible for
+ // selection in the decision heuristic.
+
+ // Read state:
+ //
+ lbool value(Var x) const; // The current value of a variable.
+ lbool value(Lit p) const; // The current value of a literal.
+ lbool modelValue(
+ Var x) const; // The value of a variable in the last model. The last call
+ // to solve must have been satisfiable.
+ lbool modelValue(
+ Lit p) const; // The value of a literal in the last model. The last call
+ // to solve must have been satisfiable.
+ int nAssigns() const; // The current number of assigned literals.
+ int nClauses() const; // The current number of original clauses.
+ int nLearnts() const; // The current number of learnt clauses.
+ int nVars() const; // The current number of variables.
+ int nFreeVars() const;
+ bool isDecision(Var x) const; // is the given var a decision?
+
+ // Debugging SMT explanations
+ //
+ bool properExplanation(Lit l, Lit expl)
+ const; // returns true if expl can be used to explain l---i.e., both
+ // assigned and trail_index(expl) < trail_index(l)
- // Memory managment:
- //
- virtual void garbageCollect();
- void checkGarbage(double gf);
- void checkGarbage();
+ // Resource contraints:
+ //
+ void setConfBudget(int64_t x);
+ void setPropBudget(int64_t x);
+ void budgetOff();
+ void interrupt(); // Trigger a (potentially asynchronous) interruption of the
+ // solver.
+ void clearInterrupt(); // Clear interrupt indicator flag.
+
+ // Memory managment:
+ //
+ virtual void garbageCollect();
+ void checkGarbage(double gf);
+ void checkGarbage();
- // Extra results: (read-only member variable)
- //
- vec<lbool> model; // If problem is satisfiable, this vector contains the model (if any).
- vec<Lit> d_conflict; // If problem is unsatisfiable (possibly under
- // assumptions), this vector represent the final
- // conflict clause expressed in the assumptions.
+ // Extra results: (read-only member variable)
+ //
+ vec<lbool> model; // If problem is satisfiable, this vector contains the model
+ // (if any).
+ vec<Lit> d_conflict; // If problem is unsatisfiable (possibly under
+ // assumptions), this vector represent the final
+ // conflict clause expressed in the assumptions.
- // Mode of operation:
- //
- int verbosity;
- double var_decay;
- double clause_decay;
- double random_var_freq;
- double random_seed;
- bool luby_restart;
- int ccmin_mode; // Controls conflict clause minimization (0=none, 1=basic, 2=deep).
- int phase_saving; // Controls the level of phase saving (0=none, 1=limited, 2=full).
- bool rnd_pol; // Use random polarities for branching heuristics.
- bool rnd_init_act; // Initialize variable activities with a small random value.
- double garbage_frac; // The fraction of wasted memory allowed before a garbage collection is triggered.
-
- int restart_first; // The initial restart limit. (default 100)
- double restart_inc; // The factor with which the restart limit is multiplied in each restart. (default 1.5)
- double learntsize_factor; // The intitial limit for learnt clauses is a factor of the original clauses. (default 1 / 3)
- double learntsize_inc; // The limit for learnt clauses is multiplied with this factor each restart. (default 1.1)
-
- int learntsize_adjust_start_confl;
- double learntsize_adjust_inc;
-
- // Statistics: (read-only member variable)
- //
- uint64_t solves, starts, decisions, rnd_decisions, propagations, conflicts, resources_consumed;
- uint64_t dec_vars, clauses_literals, learnts_literals, max_literals, tot_literals;
+ // Mode of operation:
+ //
+ int verbosity;
+ double var_decay;
+ double clause_decay;
+ double random_var_freq;
+ double random_seed;
+ bool luby_restart;
+ int ccmin_mode; // Controls conflict clause minimization (0=none, 1=basic,
+ // 2=deep).
+ int phase_saving; // Controls the level of phase saving (0=none, 1=limited,
+ // 2=full).
+ bool rnd_pol; // Use random polarities for branching heuristics.
+ bool
+ rnd_init_act; // Initialize variable activities with a small random value.
+ double garbage_frac; // The fraction of wasted memory allowed before a garbage
+ // collection is triggered.
+
+ int restart_first; // The initial restart limit. (default 100)
+ double restart_inc; // The factor with which the restart limit is multiplied
+ // in each restart. (default 1.5)
+ double
+ learntsize_factor; // The intitial limit for learnt clauses is a factor of
+ // the original clauses. (default 1 / 3)
+ double learntsize_inc; // The limit for learnt clauses is multiplied with this
+ // factor each restart. (default 1.1)
+
+ int learntsize_adjust_start_confl;
+ double learntsize_adjust_inc;
+
+ // Statistics: (read-only member variable)
+ //
+ uint64_t solves, starts, decisions, rnd_decisions, propagations, conflicts,
+ resources_consumed;
+ uint64_t dec_vars, clauses_literals, learnts_literals, max_literals,
+ tot_literals;
protected:
ClauseAllocator ca;
- // CVC4 Stuff
+ // cvc5 Stuff
/**
* A vector determining whether each variable represents a theory atom.
* More generally, this value is true for any literal that the theory proxy
// Like initialize() above, but called just before each search when in
// incremental mode
void MinisatSatSolver::setupOptions() {
- // Copy options from CVC4 options structure into minisat, as appropriate
+ // Copy options from cvc5 options structure into minisat, as appropriate
// Set up the verbosity
d_minisat->verbosity = (options::verbosity() > 0) ? 1 : -1;
res->init();
return res;
#else
- Unreachable() << "CVC4 was not compiled with Cryptominisat support.";
+ Unreachable() << "cvc5 was not compiled with Cryptominisat support.";
#endif
}
res->init();
return res;
#else
- Unreachable() << "CVC4 was not compiled with CaDiCaL support.";
+ Unreachable() << "cvc5 was not compiled with CaDiCaL support.";
#endif
}
res->init();
return res;
#else
- Unreachable() << "CVC4 was not compiled with Kissat support.";
+ Unreachable() << "cvc5 was not compiled with Kissat support.";
#endif
}
d_result = solver->mkTerm(api::SEXPR, result);
d_commandStatus = CommandSuccess::instance();
}
- catch (api::CVC4ApiRecoverableException& e)
+ catch (api::CVC5ApiRecoverableException& e)
{
d_commandStatus = new CommandRecoverableFailure(e.what());
}
d_result = solver->mkTerm(api::SEXPR, sexprs);
d_commandStatus = CommandSuccess::instance();
}
- catch (api::CVC4ApiRecoverableException& e)
+ catch (api::CVC5ApiRecoverableException& e)
{
d_commandStatus = new CommandRecoverableFailure(e.what());
}
solver->blockModel();
d_commandStatus = CommandSuccess::instance();
}
- catch (api::CVC4ApiRecoverableException& e)
+ catch (api::CVC5ApiRecoverableException& e)
{
d_commandStatus = new CommandRecoverableFailure(e.what());
}
solver->blockModelValues(d_terms);
d_commandStatus = CommandSuccess::instance();
}
- catch (api::CVC4ApiRecoverableException& e)
+ catch (api::CVC5ApiRecoverableException& e)
{
d_commandStatus = new CommandRecoverableFailure(e.what());
}
d_result = solver->getSmtEngine()->getProof();
d_commandStatus = CommandSuccess::instance();
}
- catch (api::CVC4ApiRecoverableException& e)
+ catch (api::CVC5ApiRecoverableException& e)
{
d_commandStatus = new CommandRecoverableFailure(e.what());
}
d_result = solver->getUnsatAssumptions();
d_commandStatus = CommandSuccess::instance();
}
- catch (api::CVC4ApiRecoverableException& e)
+ catch (api::CVC5ApiRecoverableException& e)
{
d_commandStatus = new CommandRecoverableFailure(e.what());
}
d_commandStatus = CommandSuccess::instance();
}
- catch (api::CVC4ApiRecoverableException& e)
+ catch (api::CVC5ApiRecoverableException& e)
{
d_commandStatus = new CommandRecoverableFailure(e.what());
}
solver->setInfo(d_flag, d_value);
d_commandStatus = CommandSuccess::instance();
}
- catch (api::CVC4ApiRecoverableException&)
+ catch (api::CVC5ApiRecoverableException&)
{
// As per SMT-LIB spec, silently accept unknown set-info keys
d_commandStatus = CommandSuccess::instance();
d_result = sexprToString(solver->mkTerm(api::SEXPR, v));
d_commandStatus = CommandSuccess::instance();
}
- catch (api::CVC4ApiRecoverableException& e)
+ catch (api::CVC5ApiRecoverableException& e)
{
d_commandStatus = new CommandRecoverableFailure(e.what());
}
solver->setOption(d_flag, d_value);
d_commandStatus = CommandSuccess::instance();
}
- catch (api::CVC4ApiRecoverableException&)
+ catch (api::CVC5ApiRecoverableException&)
{
d_commandStatus = new CommandUnsupported();
}
d_result = solver->getOption(d_flag);
d_commandStatus = CommandSuccess::instance();
}
- catch (api::CVC4ApiRecoverableException&)
+ catch (api::CVC5ApiRecoverableException&)
{
d_commandStatus = new CommandUnsupported();
}
#if defined(CVC5_DUMPING) && !defined(CVC5_MUZZLE)
-CVC4dumpstream& CVC4dumpstream::operator<<(const Command& c)
+CVC5dumpstream& CVC5dumpstream::operator<<(const Command& c)
{
if (d_os != nullptr)
{
return *this;
}
-CVC4dumpstream& CVC4dumpstream::operator<<(const NodeCommand& nc)
+CVC5dumpstream& CVC5dumpstream::operator<<(const NodeCommand& nc)
{
if (d_os != nullptr)
{
#else
-CVC4dumpstream& CVC4dumpstream::operator<<(const Command& c) { return *this; }
-CVC4dumpstream& CVC4dumpstream::operator<<(const NodeCommand& nc)
+CVC5dumpstream& CVC5dumpstream::operator<<(const Command& c) { return *this; }
+CVC5dumpstream& CVC5dumpstream::operator<<(const NodeCommand& nc)
{
return *this;
}
else
{
throw OptionException(
- "The dumping feature was disabled in this build of CVC4.");
+ "The dumping feature was disabled in this build of cvc5.");
}
}
implementations.\n\
\n\
The --output-language option controls the language used for dumping, and\n\
-this allows you to connect CVC4 to another solver implementation via a UNIX\n\
+this allows you to connect cvc5 to another solver implementation via a UNIX\n\
pipe to perform on-line checking. The --dump-to option can be used to dump\n\
to a file.\n\
";
#if defined(CVC5_DUMPING) && !defined(CVC5_MUZZLE)
-class CVC4dumpstream
+class CVC5dumpstream
{
public:
- CVC4dumpstream() : d_os(nullptr) {}
- CVC4dumpstream(std::ostream& os) : d_os(&os) {}
+ CVC5dumpstream() : d_os(nullptr) {}
+ CVC5dumpstream(std::ostream& os) : d_os(&os) {}
- CVC4dumpstream& operator<<(const Command& c);
+ CVC5dumpstream& operator<<(const Command& c);
/** A convenience function for dumping internal commands.
*
* Since Commands are now part of the public API, internal code should use
* NodeCommands and this function (instead of the one above) to dump them.
*/
- CVC4dumpstream& operator<<(const NodeCommand& nc);
+ CVC5dumpstream& operator<<(const NodeCommand& nc);
private:
std::ostream* d_os;
-}; /* class CVC4dumpstream */
+}; /* class CVC5dumpstream */
#else
* Dummy implementation of the dump stream when dumping is disabled or the
* build is muzzled.
*/
-class CVC4dumpstream
+class CVC5dumpstream
{
public:
- CVC4dumpstream() {}
- CVC4dumpstream(std::ostream& os) {}
- CVC4dumpstream& operator<<(const Command& c);
- CVC4dumpstream& operator<<(const NodeCommand& nc);
-}; /* class CVC4dumpstream */
+ CVC5dumpstream() {}
+ CVC5dumpstream(std::ostream& os) {}
+ CVC5dumpstream& operator<<(const Command& c);
+ CVC5dumpstream& operator<<(const NodeCommand& nc);
+}; /* class CVC5dumpstream */
#endif /* CVC5_DUMPING && !CVC5_MUZZLE */
class DumpC
{
public:
- CVC4dumpstream operator()(const char* tag) {
+ CVC5dumpstream operator()(const char* tag)
+ {
if(!d_tags.empty() && d_tags.find(std::string(tag)) != d_tags.end()) {
- return CVC4dumpstream(getStream());
+ return CVC5dumpstream(getStream());
} else {
- return CVC4dumpstream();
+ return CVC5dumpstream();
}
}
- CVC4dumpstream operator()(std::string tag) {
+ CVC5dumpstream operator()(std::string tag)
+ {
if(!d_tags.empty() && d_tags.find(tag) != d_tags.end()) {
- return CVC4dumpstream(getStream());
+ return CVC5dumpstream(getStream());
} else {
- return CVC4dumpstream();
+ return CVC5dumpstream();
}
}
* ****************************************************************************
*
* An exception that is thrown when a feature is used outside
- * the logic that CVC4 is currently using (for example, a quantifier
+ * the logic that cvc5 is currently using (for example, a quantifier
* is used while running in a quantifier-free logic).
*/
dumpGetStream.apply(outStream);
#else /* CVC5_DUMPING */
throw OptionException(
- "The dumping feature was disabled in this build of CVC4.");
+ "The dumping feature was disabled in this build of cvc5.");
#endif /* CVC5_DUMPING */
}
if(Warning.getStreamPointer() == getManagedOstream()){
Warning.setStream(&null_os);
}
- if (CVC4Message.getStreamPointer() == getManagedOstream())
+ if (CVC5Message.getStreamPointer() == getManagedOstream())
{
- CVC4Message.setStream(&null_os);
+ CVC5Message.setStream(&null_os);
}
if(Notice.getStreamPointer() == getManagedOstream()){
Notice.setStream(&null_os);
std::string getInputName() const { return d_inputName; }
/**
* Returns true if this model is guaranteed to be a model of the input
- * formula. Notice that when CVC4 answers "unknown", it may have a model
+ * formula. Notice that when cvc5 answers "unknown", it may have a model
* available for which this method returns false. In this case, this model is
* only a candidate solution.
*/
Trace.getStream() << expr::ExprSetDepth(depth);
Notice.getStream() << expr::ExprSetDepth(depth);
Chat.getStream() << expr::ExprSetDepth(depth);
- CVC4Message.getStream() << expr::ExprSetDepth(depth);
+ CVC5Message.getStream() << expr::ExprSetDepth(depth);
Warning.getStream() << expr::ExprSetDepth(depth);
// intentionally exclude Dump stream from this list
}
Trace.getStream() << expr::ExprDag(dag);
Notice.getStream() << expr::ExprDag(dag);
Chat.getStream() << expr::ExprDag(dag);
- CVC4Message.getStream() << expr::ExprDag(dag);
+ CVC5Message.getStream() << expr::ExprDag(dag);
Warning.getStream() << expr::ExprDag(dag);
Dump.getStream() << expr::ExprDag(dag);
}
Trace.getStream() << Command::printsuccess(value);
Notice.getStream() << Command::printsuccess(value);
Chat.getStream() << Command::printsuccess(value);
- CVC4Message.getStream() << Command::printsuccess(value);
+ CVC5Message.getStream() << Command::printsuccess(value);
Warning.getStream() << Command::printsuccess(value);
*options::out() << Command::printsuccess(value);
}
everything.lock();
getPrinter().toStreamCmdComment(
getOutputManager().getDumpOut(),
- "CVC4 always dumps the most general, all-supported logic (below), as "
+ "cvc5 always dumps the most general, all-supported logic (below), as "
"some internals might require the use of a logic more general than "
"the input.");
getPrinter().toStreamCmdSetBenchmarkLogic(getOutputManager().getDumpOut(),
// destroy the environment
d_env.reset(nullptr);
} catch(Exception& e) {
- Warning() << "CVC4 threw an exception during cleanup." << endl
- << e << endl;
+ Warning() << "cvc5 threw an exception during cleanup." << endl << e << endl;
}
}
* block-models option is set to a mode other than "none".
*
* This adds an assertion to the assertion stack that blocks the current
- * model based on the current options configured by CVC4.
+ * model based on the current options configured by cvc5.
*
* The return value has the same meaning as that of assertFormula.
*/
/**
* Get an unsatisfiable core (only if immediately preceded by an UNSAT or
- * ENTAILED query). Only permitted if CVC4 was built with unsat-core support
+ * ENTAILED query). Only permitted if cvc5 was built with unsat-core support
* and produce-unsat-cores is on.
*/
UnsatCore getUnsatCore();
/**
* Get a refutation proof (only if immediately preceded by an UNSAT or
- * ENTAILED query). Only permitted if CVC4 was built with proof support and
+ * ENTAILED query). Only permitted if cvc5 was built with proof support and
* the proof option is on. */
std::string getProof();
* limit, but it's deterministic so that reproducible results can be
* obtained. Currently, it's based on the number of conflicts.
* However, please note that the definition may change between different
- * versions of CVC4 (as may the number of conflicts required, anyway),
+ * versions of cvc5 (as may the number of conflicts required, anyway),
* and it might even be different between instances of the same version
- * of CVC4 on different platforms.
+ * of cvc5 on different platforms.
*
* A cumulative and non-cumulative (per-call) resource limit can be
* set at the same time. A call to setResourceLimit() with
/**
* Internal method to get an unsatisfiable core (only if immediately preceded
- * by an UNSAT or ENTAILED query). Only permitted if CVC4 was built with
+ * by an UNSAT or ENTAILED query). Only permitted if cvc5 was built with
* unsat-core support and produce-unsat-cores is on. Does not dump the
* command.
*/
* return nullptr.
*
* This ensures that the underlying theory model of the SmtSolver maintained
- * by this class is currently available, which means that CVC4 is producing
+ * by this class is currently available, which means that cvc5 is producing
* models, and is in "SAT mode", otherwise a recoverable exception is thrown.
*
* @param c used for giving an error message to indicate the context
class MessageOstreamUpdate : public OstreamUpdate {
public:
- std::ostream& get() override { return CVC4Message.getStream(); }
- void set(std::ostream* setTo) override { CVC4Message.setStream(setTo); }
+ std::ostream& get() override { return CVC5Message.getStream(); }
+ void set(std::ostream* setTo) override { CVC5Message.setStream(setTo); }
}; /* class MessageOstreamUpdate */
class NoticeOstreamUpdate : public OstreamUpdate {
if (s_verbosity >= 2)
{
- // CVC4Message() << v << " ";
- // d_vars.printModel(v, CVC4Message());
+ // CVC5Message() << v << " ";
+ // d_vars.printModel(v, CVC5Message());
}
int type;
if (s_verbosity >= 2)
{
- CVC4Message() << v << " ";
- d_vars.printModel(v, CVC4Message());
+ CVC5Message() << v << " ";
+ d_vars.printModel(v, CVC5Message());
}
int type;
if(len >= rowLengthReq){
if (s_verbosity >= 1)
{
- CVC4Message() << "high row " << r << " " << len << " " << avgRowLength
+ CVC5Message() << "high row " << r << " " << len << " " << avgRowLength
<< " " << dir << endl;
- d_vars.printModel(r, CVC4Message());
+ d_vars.printModel(r, CVC5Message());
}
ret.push_back(ArithRatPair(r, Rational(dir)));
}
if(ubScore >= .9 || lbScore >= .9){
if (s_verbosity >= 1)
{
- CVC4Message() << "high col " << c << " " << bc << " " << ubScore
+ CVC5Message() << "high col " << c << " " << bc << " " << ubScore
<< " " << lbScore << " " << dir << endl;
- d_vars.printModel(c, CVC4Message());
+ d_vars.printModel(c, CVC5Message());
}
ret.push_back(ArithRatPair(c, Rational(c)));
}
: glp_get_col_stat(prob, glpk_index);
if (s_verbosity >= 2)
{
- CVC4Message() << "assignment " << vi << endl;
+ CVC5Message() << "assignment " << vi << endl;
}
bool useDefaultAssignment = false;
switch(status){
case GLP_BS:
- // CVC4Message() << "basic" << endl;
+ // CVC5Message() << "basic" << endl;
newBasis.add(vi);
useDefaultAssignment = true;
break;
if(!mip){
if (s_verbosity >= 2)
{
- CVC4Message() << "non-basic lb" << endl;
+ CVC5Message() << "non-basic lb" << endl;
}
newValues.set(vi, d_vars.getLowerBound(vi));
}else{// intentionally fall through otherwise
if(!mip){
if (s_verbosity >= 2)
{
- CVC4Message() << "non-basic ub" << endl;
+ CVC5Message() << "non-basic ub" << endl;
}
newValues.set(vi, d_vars.getUpperBound(vi));
}else {// intentionally fall through otherwise
if(useDefaultAssignment){
if (s_verbosity >= 2)
{
- CVC4Message() << "non-basic other" << endl;
+ CVC5Message() << "non-basic other" << endl;
}
double newAssign;
&& roughlyEqual(newAssign,
d_vars.getLowerBound(vi).approx(SMALL_FIXED_DELTA)))
{
- // CVC4Message() << " to lb" << endl;
+ // CVC5Message() << " to lb" << endl;
newValues.set(vi, d_vars.getLowerBound(vi));
}
d_vars.getUpperBound(vi).approx(SMALL_FIXED_DELTA)))
{
newValues.set(vi, d_vars.getUpperBound(vi));
- // CVC4Message() << " to ub" << endl;
+ // CVC5Message() << " to ub" << endl;
}
else
{
double rounded = round(newAssign);
if (roughlyEqual(newAssign, rounded))
{
- // CVC4Message() << "roughly equal " << rounded << " " << newAssign <<
+ // CVC5Message() << "roughly equal " << rounded << " " << newAssign <<
// " " << oldAssign << endl;
newAssign = rounded;
}
else
{
- // CVC4Message() << "not roughly equal " << rounded << " " <<
+ // CVC5Message() << "not roughly equal " << rounded << " " <<
// newAssign << " " << oldAssign << endl;
}
if (roughlyEqual(newAssign, oldAssign.approx(SMALL_FIXED_DELTA)))
{
- // CVC4Message() << " to prev value" << newAssign << " " << oldAssign
+ // CVC5Message() << " to prev value" << newAssign << " " << oldAssign
// << endl;
proposal = d_vars.getAssignment(vi);
}
if (d_vars.strictlyLessThanLowerBound(vi, proposal))
{
- // CVC4Message() << " round to lb " << d_vars.getLowerBound(vi) <<
+ // CVC5Message() << " round to lb " << d_vars.getLowerBound(vi) <<
// endl;
proposal = d_vars.getLowerBound(vi);
}
else if (d_vars.strictlyGreaterThanUpperBound(vi, proposal))
{
- // CVC4Message() << " round to ub " << d_vars.getUpperBound(vi) <<
+ // CVC5Message() << " round to ub " << d_vars.getUpperBound(vi) <<
// endl;
proposal = d_vars.getUpperBound(vi);
}
else
{
- // CVC4Message() << " use proposal" << proposal << " " << oldAssign
+ // CVC5Message() << " use proposal" << proposal << " " << oldAssign
// << endl;
}
newValues.set(vi, proposal);
Assert(toAdd != ARITHVAR_SENTINEL);
Trace("arith::forceNewBasis") << toRemove << " " << toAdd << endl;
- // CVC4Message() << toRemove << " " << toAdd << endl;
+ // CVC5Message() << toRemove << " " << toAdd << endl;
d_linEq.pivotAndUpdate(toRemove, toAdd, newValues[toRemove]);
Trace("arith::forceNewBasis") << needsToBeAdded.size() << "to go" << endl;
- // CVC4Message() << needsToBeAdded.size() << "to go" << endl;
+ // CVC5Message() << needsToBeAdded.size() << "to go" << endl;
needsToBeAdded.remove(toAdd);
bool conflict = processSignals();
return o;
}
-void Constraint::debugPrint() const { CVC4Message() << *this << endl; }
+void Constraint::debugPrint() const { CVC5Message() << *this << endl; }
ValueCollection::ValueCollection()
: d_lowerBound(NullConstraint),
const SumPair& eq = d_trail[i].d_eq;
const Polynomial& proof = d_trail[i].d_proof;
- CVC4Message() << "d_trail[" << i << "].d_eq = " << eq.getNode() << endl;
- CVC4Message() << "d_trail[" << i << "].d_proof = " << proof.getNode() << endl;
+ CVC5Message() << "d_trail[" << i << "].d_eq = " << eq.getNode() << endl;
+ CVC5Message() << "d_trail[" << i << "].d_proof = " << proof.getNode() << endl;
}
void DioSolver::subAndReduceCurrentFByIndex(DioSolver::SubIndex subIndex){
{
if (result == Result::UNSAT)
{
- CVC4Message() << "diff order found unsat" << endl;
+ CVC5Message() << "diff order found unsat" << endl;
}
else if (d_errorSet.errorEmpty())
{
- CVC4Message() << "diff order found model" << endl;
+ CVC5Message() << "diff order found model" << endl;
}
else
{
- CVC4Message() << "diff order missed" << endl;
+ CVC5Message() << "diff order missed" << endl;
}
}
}
{
if (result == Result::UNSAT)
{
- CVC4Message() << "restricted var order found unsat" << endl;
+ CVC5Message() << "restricted var order found unsat" << endl;
}
else if (d_errorSet.errorEmpty())
{
- CVC4Message() << "restricted var order found model" << endl;
+ CVC5Message() << "restricted var order found model" << endl;
}
else
{
- CVC4Message() << "restricted var order missed" << endl;
+ CVC5Message() << "restricted var order missed" << endl;
}
}
}
if(d_errorSet.errorEmpty() && !d_errorSet.moreSignals()){
Debug("arith::findModel") << "fcFindModel("<< instance <<") trivial" << endl;
Assert(d_conflictVariables.empty());
- //if (verbose)
+ // if (verbose)
//{
- // CVC4Message() << "fcFindModel(" << instance << ") trivial" << endl;
+ // CVC5Message() << "fcFindModel(" << instance << ") trivial" << endl;
//}
return Result::SAT;
}
d_conflictVariables.purge();
if (verbose)
{
- CVC4Message() << "fcFindModel(" << instance << ") early conflict" << endl;
+ CVC5Message() << "fcFindModel(" << instance << ") early conflict" << endl;
}
Debug("arith::findModel") << "fcFindModel("<< instance <<") early conflict" << endl;
Assert(d_conflictVariables.empty());
return Result::UNSAT;
}else if(d_errorSet.errorEmpty()){
- //if (verbose)
+ // if (verbose)
//{
- // CVC4Message() << "fcFindModel(" << instance << ") fixed itself" << endl;
+ // CVC5Message() << "fcFindModel(" << instance << ") fixed itself" << endl;
//}
Debug("arith::findModel") << "fcFindModel("<< instance <<") fixed itself" << endl;
if (verbose) Assert(!d_errorSet.moreSignals());
++(d_statistics.d_fcFoundUnsat);
if (verbose)
{
- CVC4Message() << "fc found unsat";
+ CVC5Message() << "fc found unsat";
}
}else if(d_errorSet.errorEmpty()){
++(d_statistics.d_fcFoundSat);
if (verbose)
{
- CVC4Message() << "fc found model";
+ CVC5Message() << "fc found model";
}
}else{
++(d_statistics.d_fcMissed);
if (verbose)
{
- CVC4Message() << "fc missed";
+ CVC5Message() << "fc missed";
}
}
}
if (verbose)
{
- CVC4Message() << "(" << instance << ") pivots " << d_pivots << endl;
+ CVC5Message() << "(" << instance << ") pivots " << d_pivots << endl;
}
Assert(!d_errorSet.moreSignals());
}
if(degenerate(w) && selected.describesPivot()){
ArithVar leaving = selected.leaving();
- CVC4Message() << "degenerate " << leaving << ", atBounds "
+ CVC5Message() << "degenerate " << leaving << ", atBounds "
<< d_linEq.basicsAtBounds(selected) << ", len "
<< d_tableau.basicRowLength(leaving) << ", bc "
<< d_linEq.debugBasicAtBoundCount(leaving) << endl;
if (verbose)
{
- CVC4Message() << "conflict variable " << selected << endl;
- CVC4Message() << ss.str();
+ CVC5Message() << "conflict variable " << selected << endl;
+ CVC5Message() << ss.str();
}
if(Debug.isOn("error")){ d_errorSet.debugPrint(Debug("error")); }
if (verbose)
{
- debugDualLike(w, CVC4Message(), instance, prevFocusSize, prevErrorSize);
+ debugDualLike(w, CVC5Message(), instance, prevFocusSize, prevErrorSize);
}
Assert(debugDualLike(
w, Debug("dualLike"), instance, prevFocusSize, prevErrorSize));
operator IS_INTEGER 1 "term-is-integer predicate (parameter is a real-sorted term)"
operator TO_INTEGER 1 "convert term to integer by the floor function (parameter is a real-sorted term)"
-operator TO_REAL 1 "cast term to real (parameter is an integer-sorted term; this is a no-op in CVC4, as integer is a subtype of real)"
+operator TO_REAL 1 "cast term to real (parameter is an integer-sorted term; this is a no-op in cvc5, as integer is a subtype of real)"
# CAST_TO_REAL is added to distinguish between integers casted to reals internally, and
# integers casted to reals or using the API \
Assert(toAdd != ARITHVAR_SENTINEL);
Trace("arith::forceNewBasis") << toRemove << " " << toAdd << endl;
- CVC4Message() << toRemove << " " << toAdd << endl;
+ CVC5Message() << toRemove << " " << toAdd << endl;
d_tableau.pivot(toRemove, toAdd, d_trackCallback);
d_basicVariableUpdates(toAdd);
Trace("arith::forceNewBasis") << needsToBeAdded.size() << "to go" << endl;
- CVC4Message() << needsToBeAdded.size() << "to go" << endl;
+ CVC5Message() << needsToBeAdded.size() << "to go" << endl;
needsToBeAdded.remove(toAdd);
}
}
ConstraintVector d_constraints;
/**
- * A mapping from CVC4 variables to poly variables.
+ * A mapping from cvc5 variables to poly variables.
*/
VariableMapper d_varMapper;
* @param zero A node representing Rational(0)
* @param k The index of the root (starting with 1)
* @param poly The polynomial whose root shall be considered
- * @param vm A variable mapper from CVC4 to libpoly variables
+ * @param vm A variable mapper from cvc5 to libpoly variables
*/
Node mkIRP(const Node& var,
Kind rel,
* and the origin of this is constraint.
*
* @param var The variable for which the interval is excluded
- * @param vm A variable mapper between CVC4 and libpoly variables
+ * @param vm A variable mapper between cvc5 and libpoly variables
* @param p The polynomial of the constraint
* @param a The current partial assignment
* @param sc The sign condition of the constraint
* @param i The concrete interval that is excluded
* @param a The current partial assignment
* @param s The sample point that is refuted for var
- * @param vm A variable mapper between CVC4 and libpoly variables
+ * @param vm A variable mapper between cvc5 and libpoly variables
*/
std::vector<Node> constructCell(Node var,
const CACInterval& i,
void ICPSolver::reset(const std::vector<Node>& assertions)
{
- Unimplemented() << "ICPSolver requires CVC4 to be configured with LibPoly";
+ Unimplemented() << "ICPSolver requires cvc5 to be configured with LibPoly";
}
void ICPSolver::check()
{
- Unimplemented() << "ICPSolver requires CVC4 to be configured with LibPoly";
+ Unimplemented() << "ICPSolver requires cvc5 to be configured with LibPoly";
}
#endif /* CVC5_POLY_IMP */
{
CollectMonomialData(VariableMapper& v) : d_vm(v) {}
- /** Mapper from poly variables to CVC4 variables */
+ /** Mapper from poly variables to cvc5 variables */
VariableMapper& d_vm;
/** Collections of the monomial terms */
std::vector<Node> d_terms;
namespace nl {
-/** Bijective mapping between CVC4 variables and poly variables. */
+/** Bijective mapping between cvc5 variables and poly variables. */
struct VariableMapper
{
- /** A mapping from CVC4 variables to poly variables. */
+ /** A mapping from cvc5 variables to poly variables. */
std::map<cvc5::Node, poly::Variable> mVarCVCpoly;
- /** A mapping from poly variables to CVC4 variables. */
+ /** A mapping from poly variables to cvc5 variables. */
std::map<poly::Variable, cvc5::Node> mVarpolyCVC;
/** Retrieves the according poly variable. */
poly::Variable operator()(const cvc5::Node& n);
- /** Retrieves the according CVC4 variable. */
+ /** Retrieves the according cvc5 variable. */
cvc5::Node operator()(const poly::Variable& n);
};
d_conflictVariables.purge();
if (verbose)
{
- CVC4Message() << "fcFindModel(" << instance << ") early conflict" << endl;
+ CVC5Message() << "fcFindModel(" << instance << ") early conflict" << endl;
}
Debug("soi::findModel") << "fcFindModel("<< instance <<") early conflict" << endl;
Assert(d_conflictVariables.empty());
++(d_statistics.d_soiFoundUnsat);
if (verbose)
{
- CVC4Message() << "fc found unsat";
+ CVC5Message() << "fc found unsat";
}
}else if(d_errorSet.errorEmpty()){
++(d_statistics.d_soiFoundSat);
if (verbose)
{
- CVC4Message() << "fc found model";
+ CVC5Message() << "fc found model";
}
}else{
++(d_statistics.d_soiMissed);
if (verbose)
{
- CVC4Message() << "fc missed";
+ CVC5Message() << "fc missed";
}
}
}
if (verbose)
{
- CVC4Message() << "(" << instance << ") pivots " << d_pivots << endl;
+ CVC5Message() << "(" << instance << ") pivots " << d_pivots << endl;
}
Assert(!d_errorSet.moreSignals());
}
if(degenerate(w) && selected.describesPivot()){
ArithVar leaving = selected.leaving();
- CVC4Message() << "degenerate " << leaving << ", atBounds "
+ CVC5Message() << "degenerate " << leaving << ", atBounds "
<< d_linEq.basicsAtBounds(selected) << ", len "
<< d_tableau.basicRowLength(leaving) << ", bc "
<< d_linEq.debugBasicAtBoundCount(leaving) << endl;
if (verbose)
{
- CVC4Message() << "conflict variable " << selected << endl;
- CVC4Message() << ss.str();
+ CVC5Message() << "conflict variable " << selected << endl;
+ CVC5Message() << ss.str();
}
if(Debug.isOn("error")){ d_errorSet.debugPrint(Debug("error")); }
if (verbose)
{
- debugSOI(w, CVC4Message(), instance);
+ debugSOI(w, CVC5Message(), instance);
}
Assert(debugSOI(w, Debug("dualLike"), instance));
}
// mipRes = approxSolver->solveMIP(true);
// }
// d_errorSet.reduceToSignals();
-// //CVC4Message() << "here" << endl;
+// //CVC5Message() << "here" << endl;
// if(mipRes == ApproximateSimplex::ApproxSat){
// mipSolution = approxSolver->extractMIP();
// d_qflraStatus = d_attemptSolSimplex.attempt(mipSolution);
// options::arithStandardCheckVarOrderPivots.set(pass2Limit);
// if(d_qflraStatus != Result::UNSAT){ d_qflraStatus =
// simplex.findModel(false); }
-// //CVC4Message() << "done" << endl;
+// //CVC5Message() << "done" << endl;
// }
// break;
// case ApproximateSimplex::ApproxUnsat:
// }else{
// if(d_qflraStatus == Result::SAT_UNKNOWN){
-// //CVC4Message() << "got sat unknown" << endl;
+// //CVC5Message() << "got sat unknown" << endl;
// vector<ArithVar> toCut = cutAllBounded();
// if(toCut.size() > 0){
// //branchVector(toCut);
// emmittedConflictOrSplit = true;
// }else{
-// //CVC4Message() << "splitting" << endl;
+// //CVC5Message() << "splitting" << endl;
// d_qflraStatus = simplex.findModel(noPivotLimit);
// }
# kinds [for builtin theory] -*- sh -*-
#
# This "kinds" file is written in a domain-specific language for
-# declaring CVC4 kinds. Comments are marked with #, as this line is.
+# declaring cvc5 kinds. Comments are marked with #, as this line is.
#
# The first non-blank, non-comment line in this file must be a theory
# declaration:
* Stream := cons( head : Int, tail : Stream )
* The stream 1,0,1,0,1,0... when written in mu-notation is the term:
* mu x. cons( 1, mu y. cons( 0, x ) )
- * This is represented in CVC4 by the Node:
+ * This is represented in cvc5 by the Node:
* cons( 1, cons( 0, c[1] ) )
* where c[1] is a uninterpreted constant datatype with Debruijn index 1,
* indicating that c[1] is nested underneath 1 level on the path to the
}
/*** Type conversion ***/
-// CVC4 nodes make no distinction between signed and unsigned, thus ...
+// cvc5 nodes make no distinction between signed and unsigned, thus ...
template <bool isSigned>
symbolicBitVector<true> symbolicBitVector<isSigned>::toSigned(void) const
{
#endif
#ifdef CVC5_SYM_SYMBOLIC_EVAL
-// This allows debugging of the CVC4 symbolic back-end.
+// This allows debugging of the cvc5 symbolic back-end.
// By enabling this and disabling constant folding in the rewriter,
// SMT files that have operations on constants will be evaluated
// during the encoding step, which means that the expressions
* This is a symfpu symbolic "back-end". It allows the library to be used to
* construct bit-vector expressions that compute floating-point operations.
* This is effectively the glue between symfpu's notion of "signed bit-vector"
- * and CVC4's node.
+ * and cvc5's node.
*/
namespace symfpuSymbolic {
class nodeWrapper : public Node
{
protected:
-/* CVC5_SYM_SYMBOLIC_EVAL is for debugging CVC4 symbolic back-end issues.
+/* CVC5_SYM_SYMBOLIC_EVAL is for debugging cvc5 symbolic back-end issues.
* Enable this and disabling constant folding will mean that operations
* that are input with constant args are 'folded' using the symbolic encoding
* allowing them to be traced via GDB.
symbolicProposition operator>(const symbolicBitVector<isSigned> &op) const;
/*** Type conversion ***/
- // CVC4 nodes make no distinction between signed and unsigned, thus these are
+ // cvc5 nodes make no distinction between signed and unsigned, thus these are
// trivial
symbolicBitVector<true> toSigned(void) const;
symbolicBitVector<false> toUnsigned(void) const;
namespace theory {
/**
- * Reasons for incompleteness in CVC4.
+ * Reasons for incompleteness in cvc5.
*/
enum class IncompleteId
{
* Theory, the Theory should rethrow the same exception (via "throw;"
* in the exception block) rather than return, as the Interrupted
* instance might contain additional information needed for the
- * proper management of CVC4 components.
+ * proper management of cvc5 components.
*/
#include "cvc5_private.h"
/**
* A LogicInfo instance describes a collection of theory modules and some
* basic configuration about them. Conceptually, it provides a background
- * context for all operations in CVC4. Typically, when CVC4's SmtEngine
+ * context for all operations in cvc5. Typically, when cvc5's SmtEngine
* is created, it is issued a setLogic() command indicating features of the
* assertions and queries to follow---for example, whether quantifiers are
* used, whether integers or reals (or both) will be used, etc.
*
- * Most places in CVC4 will only ever need to access a const reference to an
+ * Most places in cvc5 will only ever need to access a const reference to an
* instance of this class. Such an instance is generally set by the SmtEngine
* when setLogic() is called. However, mutating member functions are also
* provided by this class so that it can be used as a more general mechanism
#!/usr/bin/env bash
#
# mkrewriter
-# Morgan Deters <mdeters@cs.nyu.edu> for CVC4
-# Copyright (c) 2010-2013 The CVC4 Project
+# Morgan Deters <mdeters@cs.nyu.edu> for cvc5
+# Copyright (c) 2010-2013 The cvc5 Project
#
# The purpose of this script is to create rewriter_tables.h from a template
# and a list of theory kinds.
#!/usr/bin/env bash
#
# mktheorytraits
-# Morgan Deters <mdeters@cs.nyu.edu> for CVC4
-# Copyright (c) 2010-2013 The CVC4 Project
+# Morgan Deters <mdeters@cs.nyu.edu> for cvc5
+# Copyright (c) 2010-2013 The cvc5 Project
#
# The purpose of this script is to create theory_traits.h from a template
# and a list of theory kinds.
class CandidateGenerator;
/** InstMatchGenerator class
-*
-* This is the default generator class for non-simple single triggers, that is,
-* triggers composed of a single term with nested term applications.
-* For example, { f( y, f( x, a ) ) } and { f( g( x ), a ) } are non-simple
-* triggers.
-*
-* Handling non-simple triggers is done by constructing a linked list of
-* InstMatchGenerator classes (see mkInstMatchGenerator), where each
-* InstMatchGenerator has a "d_next" pointer. If d_next is NULL,
-* then this is the end of the InstMatchGenerator and the last
-* InstMatchGenerator is responsible for finalizing the instantiation.
-*
-* For (EX1), for the trigger f( y, f( x, a ) ), we construct the linked list:
-*
-* [ f( y, f( x, a ) ) ] -> [ f( x, a ) ] -> NULL
-*
-* In a call to getNextMatch,
-* if we match against a ground term f( b, c ), then the first InstMatchGenerator
-* in this list binds y to b, and tells the InstMatchGenerator [ f( x, a ) ] to
-* match f-applications in the equivalence class of c.
-*
-* CVC4 employs techniques that ensure that the number of instantiations
-* is worst-case polynomial wrt the number of ground terms.
-* Consider the axiom/pattern/context (EX2) :
-*
-* axiom : forall x1 x2 x3 x4. F[ x1...x4 ]
-*
-* trigger : P( f( x1 ), f( x2 ), f( x3 ), f( x4 ) )
-*
-* ground context : ~P( a, a, a, a ), a = f( c_1 ) = ... = f( c_100 )
-*
-* If E-matching were applied exhaustively, then x1, x2, x3, x4 would be
-* instantiated with all combinations of c_1, ... c_100, giving 100^4
-* instantiations.
-*
-* Instead, we enforce that at most 1 instantiation is produced for a
-* ( pattern, ground term ) pair per round. Meaning, only one instantiation is
-* generated when matching P( a, a, a, a ) against the generator
-* [P( f( x1 ), f( x2 ), f( x3 ), f( x4 ) )]. For details, see Section 3 of
-* Reynolds, Vampire 2016.
-*
-* To enforce these policies, we use a flag "d_active_add" which dictates the
-* behavior of the last element in the linked list. If d_active_add is
-* true -> a call to getNextMatch(...) returns 1 only if adding the
-* instantiation via a call to IMGenerator::sendInstantiation(...)
-* successfully enqueues a lemma via a call to
-* Instantiate::addInstantiation(...). This call may fail e.g. if we
-* have already added the instantiation, or the instantiation is
-* entailed.
-* false -> a call to getNextMatch(...) returns 1 whenever an m is
-* constructed, where typically the caller would use m.
-* This is important since a return value >0 signals that the current matched
-* terms should be flushed. Consider the above example (EX1), where
-* [ f(y,f(x,a)) ] is being matched against f(b,c),
-* [ f(x,a) ] is being matched against f(d,a) where c=f(d,a)
-* A successfully added instantiation { x->d, y->b } here signals we should
-* not produce further instantiations that match f(y,f(x,a)) with f(b,c).
-*
-* A number of special cases of triggers are covered by this generator (see
-* implementation of initialize), including :
-* Literal triggers, e.g. x >= a, ~x = y
-* Selector triggers, e.g. head( x )
-* Triggers with invertible subterms, e.g. f( x+1 )
-* Variable triggers, e.g. x
-*
-* All triggers above can be in the context of an equality, e.g.
-* { f( y, f( x, a ) ) = b } is a trigger that matches f( y, f( x, a ) ) to
-* ground terms in the equivalence class of b.
-* { ~f( y, f( x, a ) ) = b } is a trigger that matches f( y, f( x, a ) ) to any
-* ground terms not in the equivalence class of b.
-*/
+ *
+ * This is the default generator class for non-simple single triggers, that is,
+ * triggers composed of a single term with nested term applications.
+ * For example, { f( y, f( x, a ) ) } and { f( g( x ), a ) } are non-simple
+ * triggers.
+ *
+ * Handling non-simple triggers is done by constructing a linked list of
+ * InstMatchGenerator classes (see mkInstMatchGenerator), where each
+ * InstMatchGenerator has a "d_next" pointer. If d_next is NULL,
+ * then this is the end of the InstMatchGenerator and the last
+ * InstMatchGenerator is responsible for finalizing the instantiation.
+ *
+ * For (EX1), for the trigger f( y, f( x, a ) ), we construct the linked list:
+ *
+ * [ f( y, f( x, a ) ) ] -> [ f( x, a ) ] -> NULL
+ *
+ * In a call to getNextMatch,
+ * if we match against a ground term f( b, c ), then the first
+ * InstMatchGenerator in this list binds y to b, and tells the
+ * InstMatchGenerator [ f( x, a ) ] to match f-applications in the equivalence
+ * class of c.
+ *
+ * cvc5 employs techniques that ensure that the number of instantiations
+ * is worst-case polynomial wrt the number of ground terms.
+ * Consider the axiom/pattern/context (EX2) :
+ *
+ * axiom : forall x1 x2 x3 x4. F[ x1...x4 ]
+ *
+ * trigger : P( f( x1 ), f( x2 ), f( x3 ), f( x4 ) )
+ *
+ * ground context : ~P( a, a, a, a ), a = f( c_1 ) = ... = f( c_100 )
+ *
+ * If E-matching were applied exhaustively, then x1, x2, x3, x4 would be
+ * instantiated with all combinations of c_1, ... c_100, giving 100^4
+ * instantiations.
+ *
+ * Instead, we enforce that at most 1 instantiation is produced for a
+ * ( pattern, ground term ) pair per round. Meaning, only one instantiation is
+ * generated when matching P( a, a, a, a ) against the generator
+ * [P( f( x1 ), f( x2 ), f( x3 ), f( x4 ) )]. For details, see Section 3 of
+ * Reynolds, Vampire 2016.
+ *
+ * To enforce these policies, we use a flag "d_active_add" which dictates the
+ * behavior of the last element in the linked list. If d_active_add is
+ * true -> a call to getNextMatch(...) returns 1 only if adding the
+ * instantiation via a call to IMGenerator::sendInstantiation(...)
+ * successfully enqueues a lemma via a call to
+ * Instantiate::addInstantiation(...). This call may fail e.g. if we
+ * have already added the instantiation, or the instantiation is
+ * entailed.
+ * false -> a call to getNextMatch(...) returns 1 whenever an m is
+ * constructed, where typically the caller would use m.
+ * This is important since a return value >0 signals that the current matched
+ * terms should be flushed. Consider the above example (EX1), where
+ * [ f(y,f(x,a)) ] is being matched against f(b,c),
+ * [ f(x,a) ] is being matched against f(d,a) where c=f(d,a)
+ * A successfully added instantiation { x->d, y->b } here signals we should
+ * not produce further instantiations that match f(y,f(x,a)) with f(b,c).
+ *
+ * A number of special cases of triggers are covered by this generator (see
+ * implementation of initialize), including :
+ * Literal triggers, e.g. x >= a, ~x = y
+ * Selector triggers, e.g. head( x )
+ * Triggers with invertible subterms, e.g. f( x+1 )
+ * Variable triggers, e.g. x
+ *
+ * All triggers above can be in the context of an equality, e.g.
+ * { f( y, f( x, a ) ) = b } is a trigger that matches f( y, f( x, a ) ) to
+ * ground terms in the equivalence class of b.
+ * { ~f( y, f( x, a ) ) = b } is a trigger that matches f( y, f( x, a ) ) to any
+ * ground terms not in the equivalence class of b.
+ */
class InstMatchGenerator : public IMGenerator {
public:
/** destructor */
* InstMatchGeneratorMultiLinear at the head and a list of trailing
* InstMatchGenerators.
*
- * CVC4 employs techniques that ensure that the number of instantiations
+ * cvc5 employs techniques that ensure that the number of instantiations
* is worst-case polynomial wrt the number of ground terms, where this class
* lifts this policy to multi-triggers. In particular consider
*
class IMGenerator;
class InstMatchGenerator;
/** A collection of nodes representing a trigger.
-*
-* This class encapsulates all implementations of E-matching in CVC4.
-* Its primary use is as a utility of the quantifiers module InstantiationEngine
-* (see theory/quantifiers/ematching/instantiation_engine.h) which uses Trigger to make
-* appropriate calls to Instantiate::addInstantiation(...)
-* (see theory/instantiate.h) for the instantiate utility of the quantifiers
-* engine (d_quantEngine) associated with this trigger. These calls
-* queue instantiation lemmas to the output channel of TheoryQuantifiers during
-* a full effort check.
-*
-* Concretely, a Trigger* t is used in the following way during a full effort
-* check. Assume that t is associated with quantified formula q (see field d_f).
-* We call :
-*
-* // setup initial information
-* t->resetInstantiationRound();
-* // will produce instantiations based on matching with all terms
-* t->reset( Node::null() );
-* // add all instantiations based on E-matching with this trigger and the
-* // current context
-* t->addInstantiations();
-*
-* This will result in (a set of) calls to
-* Instantiate::addInstantiation(q, m1)...Instantiate::addInstantiation(q, mn),
-* where m1...mn are InstMatch objects. These calls add the corresponding
-* instantiation lemma for (q,mi) on the output channel associated with
-* d_quantEngine.
-*
-* The Trigger class is wrapper around an underlying IMGenerator class, which
-* implements various forms of E-matching for its set of nodes (d_nodes), which
-* is refered to in the literature as a "trigger". A trigger is a set of terms
-* whose free variables are the bound variables of a quantified formula q,
-* and that is used to guide instantiations for q (for example, see "Efficient
-* E-Matching for SMT Solvers" by de Moura et al).
-*
-* For example of an instantiation lemma produced by E-matching :
-*
-* quantified formula : forall x. P( x )
-* trigger : P( x )
-* ground context : ~P( a )
-*
-* Then E-matching matches P( x ) and P( a ), resulting in the match { x -> a }
-* which is used to generate the instantiation lemma :
-* (forall x. P( x )) => P( a )
-*
-* Terms that are provided as input to a Trigger class via mkTrigger
-* should be in "instantiation constant form", see TermUtil::getInstConstantNode.
-* Say we have quantified formula q whose AST is the Node
-* (FORALL
-* (BOUND_VAR_LIST x)
-* (NOT (P x))
-* (INST_PATTERN_LIST (INST_PATTERN (P x))))
-* then TermUtil::getInstConstantNode( q, (P x) ) = (P IC) where
-* IC = TermUtil::getInstantiationConstant( q, i ).
-* Trigger expects as input (P IC) to represent the Trigger (P x). This form
-* ensures that references to bound variables are unique to quantified formulas,
-* which is required to ensure the correctness of instantiation lemmas we
-* generate.
-*
-*/
+ *
+ * This class encapsulates all implementations of E-matching in cvc5.
+ * Its primary use is as a utility of the quantifiers module InstantiationEngine
+ * (see theory/quantifiers/ematching/instantiation_engine.h) which uses Trigger
+ * to make appropriate calls to Instantiate::addInstantiation(...) (see
+ * theory/instantiate.h) for the instantiate utility of the quantifiers engine
+ * (d_quantEngine) associated with this trigger. These calls queue
+ * instantiation lemmas to the output channel of TheoryQuantifiers during a full
+ * effort check.
+ *
+ * Concretely, a Trigger* t is used in the following way during a full effort
+ * check. Assume that t is associated with quantified formula q (see field d_f).
+ * We call :
+ *
+ * // setup initial information
+ * t->resetInstantiationRound();
+ * // will produce instantiations based on matching with all terms
+ * t->reset( Node::null() );
+ * // add all instantiations based on E-matching with this trigger and the
+ * // current context
+ * t->addInstantiations();
+ *
+ * This will result in (a set of) calls to
+ * Instantiate::addInstantiation(q, m1)...Instantiate::addInstantiation(q, mn),
+ * where m1...mn are InstMatch objects. These calls add the corresponding
+ * instantiation lemma for (q,mi) on the output channel associated with
+ * d_quantEngine.
+ *
+ * The Trigger class is wrapper around an underlying IMGenerator class, which
+ * implements various forms of E-matching for its set of nodes (d_nodes), which
+ * is refered to in the literature as a "trigger". A trigger is a set of terms
+ * whose free variables are the bound variables of a quantified formula q,
+ * and that is used to guide instantiations for q (for example, see "Efficient
+ * E-Matching for SMT Solvers" by de Moura et al).
+ *
+ * For example of an instantiation lemma produced by E-matching :
+ *
+ * quantified formula : forall x. P( x )
+ * trigger : P( x )
+ * ground context : ~P( a )
+ *
+ * Then E-matching matches P( x ) and P( a ), resulting in the match { x -> a }
+ * which is used to generate the instantiation lemma :
+ * (forall x. P( x )) => P( a )
+ *
+ * Terms that are provided as input to a Trigger class via mkTrigger
+ * should be in "instantiation constant form", see
+ * TermUtil::getInstConstantNode. Say we have quantified formula q whose AST is
+ * the Node (FORALL (BOUND_VAR_LIST x) (NOT (P x)) (INST_PATTERN_LIST
+ * (INST_PATTERN (P x)))) then TermUtil::getInstConstantNode( q, (P x) ) = (P
+ * IC) where IC = TermUtil::getInstantiationConstant( q, i ). Trigger expects as
+ * input (P IC) to represent the Trigger (P x). This form ensures that
+ * references to bound variables are unique to quantified formulas, which is
+ * required to ensure the correctness of instantiation lemmas we generate.
+ *
+ */
class Trigger {
friend class IMGenerator;
Node ev = d_quant_models[f].evaluate(fmfmc, inst);
if (ev == d_true)
{
- CVC4Message() << "WARNING: instantiation was true! " << f << " "
+ CVC5Message() << "WARNING: instantiation was true! " << f << " "
<< mcond[i] << std::endl;
AlwaysAssert(false);
}
if( addedLemmas==0 ){
Trace("model-engine-debug") << "No lemmas added, incomplete = " << ( d_incomplete_check || !d_incomplete_quants.empty() ) << std::endl;
- //CVC4 will answer SAT or unknown
+ // cvc5 will answer SAT or unknown
if( Trace.isOn("fmf-consistent") ){
Trace("fmf-consistent") << std::endl;
debugPrint("fmf-consistent");
{
Node f = qa.d_fundef_f;
if( d_fun_defs.find( f )!=d_fun_defs.end() ){
- CVC4Message() << "Cannot define function " << f << " more than once."
+ CVC5Message() << "Cannot define function " << f << " more than once."
<< std::endl;
AlwaysAssert(false);
}
if (r.asSatisfiabilityResult().isSat() == Result::UNSAT)
{
std::stringstream ss;
- ss << "--sygus-rr-query-gen detected unsoundness in CVC4 on input " << qy
+ ss << "--sygus-rr-query-gen detected unsoundness in cvc5 on input " << qy
<< "!" << std::endl;
ss << "This query has a model : " << std::endl;
std::vector<Node> pt;
{
ss << " " << d_vars[i] << " -> " << pt[i] << std::endl;
}
- ss << "but CVC4 answered unsat!" << std::endl;
+ ss << "but cvc5 answered unsat!" << std::endl;
AlwaysAssert(false) << ss.str();
}
if (options::sygusQueryGenDumpFiles()
namespace cvc5 {
template <typename T>
-static CVC4ostream& operator<<(CVC4ostream& out, const std::vector<T>& v)
+static CVC5ostream& operator<<(CVC5ostream& out, const std::vector<T>& v)
{
out << "[ ";
std::copy(v.begin(), v.end(), std::ostream_iterator<T>(out, " "));
# forall y. ( exists x1...xn. P[x1...xn] ^ t[x1...xn] = y ) <=> (member y C)
# where y ranges over the element type of the (set) type of the comprehension.
# Notice that since all sets must be interpreted as finite, this means that
-# CVC4 will not be able to construct a model for any set comprehension such
+# cvc5 will not be able to construct a model for any set comprehension such
# that there are infinitely many y that satisfy the left hand side of the
# equivalence above. The same limitation occurs more generally when combining
# finite sets with quantified formulas.
* This class implements inference schemes described in Meng et al. CADE 2017
* for handling quantifier-free constraints in the theory of relations.
*
- * In CVC4, relations are represented as sets of tuples. The theory of
+ * In cvc5, relations are represented as sets of tuples. The theory of
* relations includes constraints over operators, e.g. TRANSPOSE, JOIN and so
* on, which apply to sets of tuples.
*
}
}
-void SubstitutionMap::debugPrint() const { print(CVC4Message.getStream()); }
+void SubstitutionMap::debugPrint() const { print(CVC5Message.getStream()); }
} // namespace theory
* This is essentially an abstraction for a collection of theories. A
* TheoryEngine provides services to a PropEngine, making various
* T-solvers look like a single unit to the propositional part of
- * CVC4.
+ * cvc5.
*/
class TheoryEngine {
}
if (ss == b_t)
{
- CVC4Message() << "Bad split " << s << std::endl;
+ CVC5Message() << "Bad split " << s << std::endl;
AlwaysAssert(false);
}
}
for( std::map< TypeNode, SortModel* >::iterator it = d_rep_model.begin(); it != d_rep_model.end(); ++it ){
if( !it->second->hasCardinalityAsserted() ){
Trace("uf-ss-warn") << "WARNING: Assert " << n << " as a decision before cardinality for " << it->first << "." << std::endl;
- // CVC4Message() << "Error: constraint asserted before cardinality
+ // CVC5Message() << "Error: constraint asserted before cardinality
// for " << it->first << std::endl; Unimplemented();
}
}
*
* Representation of cardinality.
*
- * Simple class to represent a cardinality; used by the CVC4 type system
+ * Simple class to represent a cardinality; used by the cvc5 type system
* give the cardinality of sorts.
*/
*
* This is a symfpu literal "back-end". It allows the library to be used as
* an arbitrary precision floating-point implementation. This is effectively
- * the glue between symfpu's notion of "signed bit-vector" and CVC4's
+ * the glue between symfpu's notion of "signed bit-vector" and cvc5's
* BitVector.
*/
return true;
case language::output::LANG_AST:
case language::output::LANG_CVC3:
- case language::output::LANG_CVC4:
+ case language::output::LANG_CVC:
default: return language::isOutputLang_smt2(language);
};
}
namespace cvc5 {
-/** The CVC4 string class
+/** The cvc5 string class
*
* This data structure is the domain of values for the string type. It can also
* be used as a generic utility for representing strings.
* directory for licensing information.
* ****************************************************************************
*
- * Some standard STL-related utility functions for CVC4.
+ * Some standard STL-related utility functions for cvc5.
*/
#include "util/utility.h"
* directory for licensing information.
* ****************************************************************************
*
- * Some standard STL-related utility functions for CVC4.
+ * Some standard STL-related utility functions for cvc5.
*/
#include "cvc5_private.h"
# directory for licensing information.
# #############################################################################
#
-# A simple test file to interact with CVC4 with line editing
+# A simple test file to interact with cvc5 with line editing
##
import sys
def check_iteractive_shell():
"""
- Interacts with CVC4's interactive shell and checks that things such a tab
+ Interacts with cvc5's interactive shell and checks that things such a tab
completion and "pressing up" works.
"""
- # Open CVC4
+ # Open cvc5
child = pexpect.spawnu("bin/cvc4", timeout=1)
- # We expect to see the CVC4 prompt
- child.expect("CVC4>")
+ # We expect to see the cvc5 prompt
+ child.expect("cvc5>")
# If we send a line with just 'BOOLE' ...
child.sendline("BOOLE")
# Send enter
child.sendcontrol("m")
- # We expect to see the CVC4 prompt
- child.expect("CVC4>")
+ # We expect to see the cvc5 prompt
+ child.expect("cvc5>")
# Now send an up key
child.send("\033[A")
{
return runTest();
}
- catch (api::CVC4ApiException& e)
+ catch (api::CVC5ApiException& e)
{
std::cerr << e.getMessage() << std::endl;
}
api::Solver solver;
InputLanguage ilang =
- input_language == "smt2" ? input::LANG_SMTLIB_V2 : input::LANG_CVC4;
+ input_language == "smt2" ? input::LANG_SMTLIB_V2 : input::LANG_CVC;
solver.setOption("input-language", input_language);
solver.setOption("output-language", output_language);
std::cout << "==============================================" << std::endl
<< "translating from "
<< (input_language == "smt2" ? input::LANG_SMTLIB_V2
- : input::LANG_CVC4)
+ : input::LANG_CVC)
<< " to "
<< (output_language == "smt2" ? output::LANG_SMTLIB_V2
- : output::LANG_CVC4)
+ : output::LANG_CVC)
<< " this string:" << std::endl
<< instr << std::endl;
std::string outstr = parse(instr, input_language, output_language);
<< outstr << std::endl
<< "reparsing as "
<< (output_language == "smt2" ? input::LANG_SMTLIB_V2
- : input::LANG_CVC4)
+ : input::LANG_CVC)
<< std::endl;
std::string poutstr = parse(outstr, output_language, output_language);
assert(outstr == poutstr);
{
Term heap_expr = slv.getSeparationHeap();
}
- catch (const CVC4ApiException& e)
+ catch (const CVC5ApiException& e)
{
caught_on_heap = true;
{
Term nil_expr = slv.getSeparationNilTerm();
}
- catch (const CVC4ApiException& e)
+ catch (const CVC5ApiException& e)
{
caught_on_nil = true;
## Regression Levels and Running Regression Tests
-CVC4's regression tests are divided into 5 levels (level 0 to 4). Higher
+cvc5's regression tests are divided into 5 levels (level 0 to 4). Higher
regression levels are reserved for longer running regressions.
For running regressions tests,
see the [INSTALL](https://github.com/CVC4/CVC4/blob/master/INSTALL.md#testing-cvc4) file.
-By default, each invocation of CVC4 is done with a 10 minute timeout. To use a
+By default, each invocation of cvc5 is done with a 10 minute timeout. To use a
different timeout, set the `TEST_TIMEOUT` environment variable:
```
- `*.smt`: An [SMT1.x](http://smtlib.cs.uiowa.edu/papers/format-v1.2-r06.08.30.pdf) benchmark
- `*.smt2`: An [SMT 2.x](http://smtlib.cs.uiowa.edu/papers/smt-lib-reference-v2.6-r2017-07-18.pdf) benchmark
-- `*.cvc`: A benchmark that uses [CVC4's native input language](https://github.com/CVC4/CVC4/wiki/CVC4-Native-Input-Language)
+- `*.cvc`: A benchmark that uses [cvc5's native input language](https://github.com/CVC4/CVC4/wiki/CVC4-Native-Input-Language)
- `*.sy`: A [SyGuS](http://sygus.seas.upenn.edu/files/SyGuS-IF.pdf) benchmark
- `*.p`: A [TPTP](http://www.cs.miami.edu/~tptp/TPTP/SyntaxBNF.html) benchmark
% EXIT: 0
```
-This example expects an exit status of 0 from CVC4, the single line "stderr" on
+This example expects an exit status of 0 from cvc5, the single line "stderr" on
stderr, and the single line "stdout" on stdout. You can repeat `EXPECT` and
`EXPECT-ERROR` lines as many times as you like, and at different points of the
file. This is useful for multiple queries:
QUERY FALSE;
% EXPECT: VALID
QUERY TRUE;
-% EXPECT-ERROR: CVC4 Error:
+% EXPECT-ERROR: cvc5 Error:
% EXPECT-ERROR: Parse Error: regress.cvc:7.13: Unexpected token: 'error'.
syntax error;
% EXIT: 1
file for example, the first character would be `;` instead of `%`.
Benchmark files can also specify the command line options to be used when
-executing CVC4, for example:
+executing cvc5, for example:
```
% COMMAND-LINE: --incremental
(e.g. there could be multiple non-linear facts and it is ok if any of them is
printed).
-Sometimes, certain benchmarks only apply to certain CVC4
+Sometimes, certain benchmarks only apply to certain cvc5
configurations. The `REQUIRES` directive can be used to only run
a given benchmark when a feature is supported. For example:
This benchmark is only run when symfpu has been configured. Multiple
`REQUIRES` directives are supported. For a list of features that can be listed
-as a requirement, refer to CVC4's `--show-config` output. Features can also be
+as a requirement, refer to cvc5's `--show-config` output. Features can also be
excluded by adding the `no-` prefix, e.g. `no-symfpu` means that the test is
not valid for builds that include symfpu support.
; REQUIRES: no-competition
; COMMAND-LINE: --sygus-out=status --lang=sygus2
; EXPECT-ERROR: no-logic.sy:8.10: No set-logic command was given before this point.
-; EXPECT-ERROR: no-logic.sy:8.10: CVC4 will make all theories available.
+; EXPECT-ERROR: no-logic.sy:8.10: cvc5 will make all theories available.
; EXPECT-ERROR: no-logic.sy:8.10: Consider setting a stricter logic for (likely) better performance.
; EXPECT-ERROR: no-logic.sy:8.10: To suppress this warning in the future use (set-logic ALL).
; EXPECT: unsat
return out, err, exit_status
-def get_cvc4_features(cvc4_binary):
- """Returns a list of features supported by the CVC4 binary `cvc4_binary`."""
+def get_cvc5_features(cvc5_binary):
+ """Returns a list of features supported by the cvc5 binary `cvc5_binary`."""
- output, _, _ = run_process([cvc4_binary, '--show-config'], None, None)
+ output, _, _ = run_process([cvc5_binary, '--show-config'], None, None)
if isinstance(output, bytes):
output = output.decode()
return features, disabled_features
-def run_benchmark(dump, wrapper, scrubber, error_scrubber, cvc4_binary,
+def run_benchmark(dump, wrapper, scrubber, error_scrubber, cvc5_binary,
command_line, benchmark_dir, benchmark_filename, timeout):
- """Runs CVC4 on the file `benchmark_filename` in the directory
- `benchmark_dir` using the binary `cvc4_binary` with the command line
+ """Runs cvc5 on the file `benchmark_filename` in the directory
+ `benchmark_dir` using the binary `cvc5_binary` with the command line
options `command_line`. The output is scrubbed using `scrubber` and
`error_scrubber` for stdout and stderr, respectively. If dump is true, the
- function first uses CVC4 to read in and dump the benchmark file and then
+ function first uses cvc5 to read in and dump the benchmark file and then
uses that as input."""
bin_args = wrapper[:]
- bin_args.append(cvc4_binary)
+ bin_args.append(cvc5_binary)
output = None
error = None
def run_regression(check_unsat_cores, check_proofs, dump, use_skip_return_code,
- skip_timeout, wrapper, cvc4_binary, benchmark_path,
+ skip_timeout, wrapper, cvc5_binary, benchmark_path,
timeout):
- """Determines the expected output for a benchmark, runs CVC4 on it and then
+ """Determines the expected output for a benchmark, runs cvc5 on it and then
checks whether the output corresponds to the expected output. Optionally
uses a wrapper `wrapper`, tests unsat cores (if check_unsat_cores is true),
checks proofs (if check_proofs is true), or dumps a benchmark and uses that as
the input (if dump is true). `use_skip_return_code` enables/disables
returning 77 when a test is skipped."""
- if not os.access(cvc4_binary, os.X_OK):
+ if not os.access(cvc5_binary, os.X_OK):
sys.exit(
- '"{}" does not exist or is not executable'.format(cvc4_binary))
+ '"{}" does not exist or is not executable'.format(cvc5_binary))
if not os.path.isfile(benchmark_path):
sys.exit('"{}" does not exist or is not a file'.format(benchmark_path))
- cvc4_features, cvc4_disabled_features = get_cvc4_features(cvc4_binary)
+ cvc5_features, cvc5_disabled_features = get_cvc5_features(cvc5_binary)
basic_command_line_args = []
if req_feature.startswith("no-"):
req_feature = req_feature[len("no-"):]
is_negative = True
- if req_feature not in (cvc4_features + cvc4_disabled_features):
+ if req_feature not in (cvc5_features + cvc5_disabled_features):
print(
'Illegal requirement in regression: {}\nAllowed requirements: {}'
.format(req_feature,
- ' '.join(cvc4_features + cvc4_disabled_features)))
+ ' '.join(cvc5_features + cvc5_disabled_features)))
return EXIT_FAILURE
if is_negative:
- if req_feature in cvc4_features:
+ if req_feature in cvc5_features:
print('1..0 # Skipped regression: not valid with {}'.format(
req_feature))
return (EXIT_SKIP if use_skip_return_code else EXIT_OK)
- elif req_feature not in cvc4_features:
+ elif req_feature not in cvc5_features:
print('1..0 # Skipped regression: {} not supported'.format(
req_feature))
return (EXIT_SKIP if use_skip_return_code else EXIT_OK)
for extra_arg in extra_command_line_args:
command_line_args_configs.append(all_args + [extra_arg])
- # Run CVC4 on the benchmark with the different option sets and check
+ # Run cvc5 on the benchmark with the different option sets and check
# whether the exit status, stdout output, stderr output are as expected.
print('1..{}'.format(len(command_line_args_configs)))
print('# Starting')
exit_code = EXIT_OK
for command_line_args in command_line_args_configs:
output, error, exit_status = run_benchmark(dump, wrapper, scrubber,
- error_scrubber, cvc4_binary,
+ error_scrubber, cvc5_binary,
command_line_args,
benchmark_dir,
benchmark_basename, timeout)
parser.add_argument('--no-check-proofs', dest='check_proofs',
action='store_false')
parser.add_argument('wrapper', nargs='*')
- parser.add_argument('cvc4_binary')
+ parser.add_argument('cvc5_binary')
parser.add_argument('benchmark')
argv = sys.argv[1:]
args = parser.parse_args(argv)
- cvc4_binary = os.path.abspath(args.cvc4_binary)
+ cvc5_binary = os.path.abspath(args.cvc5_binary)
wrapper = args.wrapper
if os.environ.get('VALGRIND') == '1' and not wrapper:
return run_regression(args.check_unsat_cores, args.check_proofs, args.dump,
args.use_skip_return_code, args.skip_timeout,
- wrapper, cvc4_binary, args.benchmark, timeout)
+ wrapper, cvc5_binary, args.benchmark, timeout)
if __name__ == "__main__":
Datatype d = listSort.getDatatype();
DatatypeConstructor consConstr = d[0];
DatatypeConstructor nilConstr = d[1];
- ASSERT_THROW(d[2], CVC4ApiException);
+ ASSERT_THROW(d[2], CVC5ApiException);
ASSERT_NO_THROW(consConstr.getConstructorTerm());
ASSERT_NO_THROW(nilConstr.getConstructorTerm());
}
std::vector<DatatypeDecl> dtdeclsBad;
DatatypeDecl emptyD = d_solver.mkDatatypeDecl("emptyD");
dtdeclsBad.push_back(emptyD);
- ASSERT_THROW(d_solver.mkDatatypeSorts(dtdeclsBad), CVC4ApiException);
+ ASSERT_THROW(d_solver.mkDatatypeSorts(dtdeclsBad), CVC5ApiException);
}
TEST_F(TestApiBlackDatatype, datatypeStructs)
cons.addSelector("head", intSort);
cons.addSelectorSelf("tail");
Sort nullSort;
- ASSERT_THROW(cons.addSelector("null", nullSort), CVC4ApiException);
+ ASSERT_THROW(cons.addSelector("null", nullSort), CVC5ApiException);
dtypeSpec.addConstructor(cons);
DatatypeConstructorDecl nil = d_solver.mkDatatypeConstructorDecl("nil");
dtypeSpec.addConstructor(nil);
ASSERT_EQ(dt.getName(), std::string("list"));
ASSERT_NO_THROW(dt.getConstructor("nil"));
ASSERT_NO_THROW(dt["cons"]);
- ASSERT_THROW(dt.getConstructor("head"), CVC4ApiException);
- ASSERT_THROW(dt.getConstructor(""), CVC4ApiException);
+ ASSERT_THROW(dt.getConstructor("head"), CVC5ApiException);
+ ASSERT_THROW(dt.getConstructor(""), CVC5ApiException);
DatatypeConstructor dcons = dt[0];
ASSERT_EQ(dcons.getName(), std::string("cons"));
ASSERT_NO_THROW(dcons.getSelector("head"));
ASSERT_NO_THROW(dcons["tail"]);
- ASSERT_THROW(dcons.getSelector("cons"), CVC4ApiException);
+ ASSERT_THROW(dcons.getSelector("cons"), CVC5ApiException);
// get selector
DatatypeSelector dselTail = dcons[1];
ASSERT_EQ(dselTail.getRangeSort(), dtypeSort);
// possible to construct null datatype declarations if not using solver
- ASSERT_THROW(DatatypeDecl().getName(), CVC4ApiException);
+ ASSERT_THROW(DatatypeDecl().getName(), CVC5ApiException);
}
TEST_F(TestApiBlackDatatype, parametricDatatype)
ASSERT_NO_THROW(testConsTerm = nilc.getSpecializedConstructorTerm(listInt));
ASSERT_NE(testConsTerm, nilc.getConstructorTerm());
// error to get the specialized constructor term for Int
- ASSERT_THROW(nilc.getSpecializedConstructorTerm(isort), CVC4ApiException);
+ ASSERT_THROW(nilc.getSpecializedConstructorTerm(isort), CVC5ApiException);
}
} // namespace test
} // namespace cvc5
ASSERT_NO_THROW(g.addRule(start, d_solver.mkBoolean(false)));
ASSERT_THROW(g.addRule(nullTerm, d_solver.mkBoolean(false)),
- CVC4ApiException);
- ASSERT_THROW(g.addRule(start, nullTerm), CVC4ApiException);
- ASSERT_THROW(g.addRule(nts, d_solver.mkBoolean(false)), CVC4ApiException);
- ASSERT_THROW(g.addRule(start, d_solver.mkInteger(0)), CVC4ApiException);
- ASSERT_THROW(g.addRule(start, nts), CVC4ApiException);
+ CVC5ApiException);
+ ASSERT_THROW(g.addRule(start, nullTerm), CVC5ApiException);
+ ASSERT_THROW(g.addRule(nts, d_solver.mkBoolean(false)), CVC5ApiException);
+ ASSERT_THROW(g.addRule(start, d_solver.mkInteger(0)), CVC5ApiException);
+ ASSERT_THROW(g.addRule(start, nts), CVC5ApiException);
d_solver.synthFun("f", {}, boolean, g);
- ASSERT_THROW(g.addRule(start, d_solver.mkBoolean(false)), CVC4ApiException);
+ ASSERT_THROW(g.addRule(start, d_solver.mkBoolean(false)), CVC5ApiException);
}
TEST_F(TestApiBlackGrammar, addRules)
ASSERT_NO_THROW(g.addRules(start, {d_solver.mkBoolean(false)}));
ASSERT_THROW(g.addRules(nullTerm, {d_solver.mkBoolean(false)}),
- CVC4ApiException);
- ASSERT_THROW(g.addRules(start, {nullTerm}), CVC4ApiException);
- ASSERT_THROW(g.addRules(nts, {d_solver.mkBoolean(false)}), CVC4ApiException);
- ASSERT_THROW(g.addRules(start, {d_solver.mkInteger(0)}), CVC4ApiException);
- ASSERT_THROW(g.addRules(start, {nts}), CVC4ApiException);
+ CVC5ApiException);
+ ASSERT_THROW(g.addRules(start, {nullTerm}), CVC5ApiException);
+ ASSERT_THROW(g.addRules(nts, {d_solver.mkBoolean(false)}), CVC5ApiException);
+ ASSERT_THROW(g.addRules(start, {d_solver.mkInteger(0)}), CVC5ApiException);
+ ASSERT_THROW(g.addRules(start, {nts}), CVC5ApiException);
d_solver.synthFun("f", {}, boolean, g);
ASSERT_THROW(g.addRules(start, {d_solver.mkBoolean(false)}),
- CVC4ApiException);
+ CVC5ApiException);
}
TEST_F(TestApiBlackGrammar, addAnyConstant)
ASSERT_NO_THROW(g.addAnyConstant(start));
ASSERT_NO_THROW(g.addAnyConstant(start));
- ASSERT_THROW(g.addAnyConstant(nullTerm), CVC4ApiException);
- ASSERT_THROW(g.addAnyConstant(nts), CVC4ApiException);
+ ASSERT_THROW(g.addAnyConstant(nullTerm), CVC5ApiException);
+ ASSERT_THROW(g.addAnyConstant(nts), CVC5ApiException);
d_solver.synthFun("f", {}, boolean, g);
- ASSERT_THROW(g.addAnyConstant(start), CVC4ApiException);
+ ASSERT_THROW(g.addAnyConstant(start), CVC5ApiException);
}
TEST_F(TestApiBlackGrammar, addAnyVariable)
ASSERT_NO_THROW(g1.addAnyVariable(start));
ASSERT_NO_THROW(g2.addAnyVariable(start));
- ASSERT_THROW(g1.addAnyVariable(nullTerm), CVC4ApiException);
- ASSERT_THROW(g1.addAnyVariable(nts), CVC4ApiException);
+ ASSERT_THROW(g1.addAnyVariable(nullTerm), CVC5ApiException);
+ ASSERT_THROW(g1.addAnyVariable(nts), CVC5ApiException);
d_solver.synthFun("f", {}, boolean, g1);
- ASSERT_THROW(g1.addAnyVariable(start), CVC4ApiException);
+ ASSERT_THROW(g1.addAnyVariable(start), CVC5ApiException);
}
} // namespace test
} // namespace cvc5
TEST_F(TestApiBlackOp, opFromKind)
{
ASSERT_NO_THROW(d_solver.mkOp(PLUS));
- ASSERT_THROW(d_solver.mkOp(BITVECTOR_EXTRACT), CVC4ApiException);
+ ASSERT_THROW(d_solver.mkOp(BITVECTOR_EXTRACT), CVC5ApiException);
}
TEST_F(TestApiBlackOp, getIndicesString)
{
Op x;
- ASSERT_THROW(x.getIndices<std::string>(), CVC4ApiException);
+ ASSERT_THROW(x.getIndices<std::string>(), CVC5ApiException);
Op divisible_ot = d_solver.mkOp(DIVISIBLE, 4);
ASSERT_TRUE(divisible_ot.isIndexed());
Op record_update_ot = d_solver.mkOp(RECORD_UPDATE, "test");
std::string record_update_idx = record_update_ot.getIndices<std::string>();
ASSERT_EQ(record_update_idx, "test");
- ASSERT_THROW(record_update_ot.getIndices<uint32_t>(), CVC4ApiException);
+ ASSERT_THROW(record_update_ot.getIndices<uint32_t>(), CVC5ApiException);
}
TEST_F(TestApiBlackOp, getIndicesUint)
ASSERT_EQ(bitvector_repeat_idx, 5);
ASSERT_THROW(
(bitvector_repeat_ot.getIndices<std::pair<uint32_t, uint32_t>>()),
- CVC4ApiException);
+ CVC5ApiException);
Op bitvector_zero_extend_ot = d_solver.mkOp(BITVECTOR_ZERO_EXTEND, 6);
uint32_t bitvector_zero_extend_idx =
Op tuple_update_ot = d_solver.mkOp(TUPLE_UPDATE, 5);
uint32_t tuple_update_idx = tuple_update_ot.getIndices<uint32_t>();
ASSERT_EQ(tuple_update_idx, 5);
- ASSERT_THROW(tuple_update_ot.getIndices<std::string>(), CVC4ApiException);
+ ASSERT_THROW(tuple_update_ot.getIndices<std::string>(), CVC5ApiException);
}
TEST_F(TestApiBlackOp, getIndicesPairUint)
ASSERT_TRUE((floatingpoint_to_fp_generic_indices
== std::pair<uint32_t, uint32_t>{4, 25}));
ASSERT_THROW(floatingpoint_to_fp_generic_ot.getIndices<std::string>(),
- CVC4ApiException);
+ CVC5ApiException);
}
TEST_F(TestApiBlackOp, opScopingToString)
{
Op plus(&d_solver, PLUS);
ASSERT_FALSE(plus.isIndexed());
- ASSERT_THROW(plus.getIndices<uint32_t>(), CVC4ApiException);
+ ASSERT_THROW(plus.getIndices<uint32_t>(), CVC5ApiException);
ASSERT_EQ(plus, d_solver.mkOp(PLUS));
}
} // namespace test
d_solver.setOption("produce-models", "true");
Term x = d_solver.mkConst(d_solver.getBooleanSort(), "x");
d_solver.assertFormula(x.eqTerm(x).notTerm());
- ASSERT_THROW(d_solver.getValue(x), CVC4ApiRecoverableException);
+ ASSERT_THROW(d_solver.getValue(x), CVC5ApiRecoverableException);
}
TEST_F(TestApiBlackSolver, supportsFloatingPoint)
else
{
ASSERT_THROW(d_solver.mkRoundingMode(ROUND_NEAREST_TIES_TO_EVEN),
- CVC4ApiException);
+ CVC5ApiException);
}
}
}
else
{
- ASSERT_THROW(d_solver.getRoundingModeSort(), CVC4ApiException);
+ ASSERT_THROW(d_solver.getRoundingModeSort(), CVC5ApiException);
}
}
}
Solver slv;
- ASSERT_THROW(slv.mkArraySort(boolSort, boolSort), CVC4ApiException);
+ ASSERT_THROW(slv.mkArraySort(boolSort, boolSort), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, mkBitVectorSort)
{
ASSERT_NO_THROW(d_solver.mkBitVectorSort(32));
- ASSERT_THROW(d_solver.mkBitVectorSort(0), CVC4ApiException);
+ ASSERT_THROW(d_solver.mkBitVectorSort(0), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, mkFloatingPointSort)
if (d_solver.supportsFloatingPoint())
{
ASSERT_NO_THROW(d_solver.mkFloatingPointSort(4, 8));
- ASSERT_THROW(d_solver.mkFloatingPointSort(0, 8), CVC4ApiException);
- ASSERT_THROW(d_solver.mkFloatingPointSort(4, 0), CVC4ApiException);
+ ASSERT_THROW(d_solver.mkFloatingPointSort(0, 8), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkFloatingPointSort(4, 0), CVC5ApiException);
}
else
{
- ASSERT_THROW(d_solver.mkFloatingPointSort(4, 8), CVC4ApiException);
+ ASSERT_THROW(d_solver.mkFloatingPointSort(4, 8), CVC5ApiException);
}
}
ASSERT_NO_THROW(d_solver.mkDatatypeSort(dtypeSpec));
Solver slv;
- ASSERT_THROW(slv.mkDatatypeSort(dtypeSpec), CVC4ApiException);
+ ASSERT_THROW(slv.mkDatatypeSort(dtypeSpec), CVC5ApiException);
DatatypeDecl throwsDtypeSpec = d_solver.mkDatatypeDecl("list");
- ASSERT_THROW(d_solver.mkDatatypeSort(throwsDtypeSpec), CVC4ApiException);
+ ASSERT_THROW(d_solver.mkDatatypeSort(throwsDtypeSpec), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, mkDatatypeSorts)
std::vector<DatatypeDecl> decls = {dtypeSpec1, dtypeSpec2};
ASSERT_NO_THROW(d_solver.mkDatatypeSorts(decls));
- ASSERT_THROW(slv.mkDatatypeSorts(decls), CVC4ApiException);
+ ASSERT_THROW(slv.mkDatatypeSorts(decls), CVC5ApiException);
DatatypeDecl throwsDtypeSpec = d_solver.mkDatatypeDecl("list");
std::vector<DatatypeDecl> throwsDecls = {throwsDtypeSpec};
- ASSERT_THROW(d_solver.mkDatatypeSorts(throwsDecls), CVC4ApiException);
+ ASSERT_THROW(d_solver.mkDatatypeSorts(throwsDecls), CVC5ApiException);
/* with unresolved sorts */
Sort unresList = d_solver.mkUninterpretedSort("ulist");
std::vector<DatatypeDecl> udecls = {ulist};
ASSERT_NO_THROW(d_solver.mkDatatypeSorts(udecls, unresSorts));
- ASSERT_THROW(slv.mkDatatypeSorts(udecls, unresSorts), CVC4ApiException);
+ ASSERT_THROW(slv.mkDatatypeSorts(udecls, unresSorts), CVC5ApiException);
/* Note: More tests are in datatype_api_black. */
}
// non-first-class arguments are not allowed
Sort reSort = d_solver.getRegExpSort();
ASSERT_THROW(d_solver.mkFunctionSort(reSort, d_solver.getIntegerSort()),
- CVC4ApiException);
+ CVC5ApiException);
ASSERT_THROW(d_solver.mkFunctionSort(d_solver.getIntegerSort(), funSort),
- CVC4ApiException);
+ CVC5ApiException);
ASSERT_NO_THROW(d_solver.mkFunctionSort(
{d_solver.mkUninterpretedSort("u"), d_solver.getIntegerSort()},
d_solver.getIntegerSort()));
ASSERT_THROW(d_solver.mkFunctionSort({d_solver.getIntegerSort(),
d_solver.mkUninterpretedSort("u")},
funSort2),
- CVC4ApiException);
+ CVC5ApiException);
Solver slv;
ASSERT_THROW(slv.mkFunctionSort(d_solver.mkUninterpretedSort("u"),
d_solver.getIntegerSort()),
- CVC4ApiException);
+ CVC5ApiException);
ASSERT_THROW(slv.mkFunctionSort(slv.mkUninterpretedSort("u"),
d_solver.getIntegerSort()),
- CVC4ApiException);
+ CVC5ApiException);
std::vector<Sort> sorts1 = {d_solver.getBooleanSort(),
slv.getIntegerSort(),
d_solver.getIntegerSort()};
std::vector<Sort> sorts2 = {slv.getBooleanSort(), slv.getIntegerSort()};
ASSERT_NO_THROW(slv.mkFunctionSort(sorts2, slv.getIntegerSort()));
ASSERT_THROW(slv.mkFunctionSort(sorts1, slv.getIntegerSort()),
- CVC4ApiException);
+ CVC5ApiException);
ASSERT_THROW(slv.mkFunctionSort(sorts2, d_solver.getIntegerSort()),
- CVC4ApiException);
+ CVC5ApiException);
}
TEST_F(TestApiBlackSolver, mkParamSort)
TEST_F(TestApiBlackSolver, mkPredicateSort)
{
ASSERT_NO_THROW(d_solver.mkPredicateSort({d_solver.getIntegerSort()}));
- ASSERT_THROW(d_solver.mkPredicateSort({}), CVC4ApiException);
+ ASSERT_THROW(d_solver.mkPredicateSort({}), CVC5ApiException);
Sort funSort = d_solver.mkFunctionSort(d_solver.mkUninterpretedSort("u"),
d_solver.getIntegerSort());
// functions as arguments are allowed
Solver slv;
ASSERT_THROW(slv.mkPredicateSort({d_solver.getIntegerSort()}),
- CVC4ApiException);
+ CVC5ApiException);
}
TEST_F(TestApiBlackSolver, mkRecordSort)
ASSERT_NO_THROW(recSort.getDatatype());
Solver slv;
- ASSERT_THROW(slv.mkRecordSort(fields), CVC4ApiException);
+ ASSERT_THROW(slv.mkRecordSort(fields), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, mkSetSort)
ASSERT_NO_THROW(d_solver.mkSetSort(d_solver.getIntegerSort()));
ASSERT_NO_THROW(d_solver.mkSetSort(d_solver.mkBitVectorSort(4)));
Solver slv;
- ASSERT_THROW(slv.mkSetSort(d_solver.mkBitVectorSort(4)), CVC4ApiException);
+ ASSERT_THROW(slv.mkSetSort(d_solver.mkBitVectorSort(4)), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, mkBagSort)
ASSERT_NO_THROW(d_solver.mkBagSort(d_solver.getIntegerSort()));
ASSERT_NO_THROW(d_solver.mkBagSort(d_solver.mkBitVectorSort(4)));
Solver slv;
- ASSERT_THROW(slv.mkBagSort(d_solver.mkBitVectorSort(4)), CVC4ApiException);
+ ASSERT_THROW(slv.mkBagSort(d_solver.mkBitVectorSort(4)), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, mkSequenceSort)
ASSERT_NO_THROW(d_solver.mkSequenceSort(
d_solver.mkSequenceSort(d_solver.getIntegerSort())));
Solver slv;
- ASSERT_THROW(slv.mkSequenceSort(d_solver.getIntegerSort()), CVC4ApiException);
+ ASSERT_THROW(slv.mkSequenceSort(d_solver.getIntegerSort()), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, mkUninterpretedSort)
{
ASSERT_NO_THROW(d_solver.mkSortConstructorSort("s", 2));
ASSERT_NO_THROW(d_solver.mkSortConstructorSort("", 2));
- ASSERT_THROW(d_solver.mkSortConstructorSort("", 0), CVC4ApiException);
+ ASSERT_THROW(d_solver.mkSortConstructorSort("", 0), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, mkTupleSort)
Sort funSort = d_solver.mkFunctionSort(d_solver.mkUninterpretedSort("u"),
d_solver.getIntegerSort());
ASSERT_THROW(d_solver.mkTupleSort({d_solver.getIntegerSort(), funSort}),
- CVC4ApiException);
+ CVC5ApiException);
Solver slv;
- ASSERT_THROW(slv.mkTupleSort({d_solver.getIntegerSort()}), CVC4ApiException);
+ ASSERT_THROW(slv.mkTupleSort({d_solver.getIntegerSort()}), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, mkBitVector)
ASSERT_NO_THROW(d_solver.mkBitVector("1010", 16));
ASSERT_NO_THROW(d_solver.mkBitVector("a09f", 16));
ASSERT_NO_THROW(d_solver.mkBitVector(8, "-127", 10));
- ASSERT_THROW(d_solver.mkBitVector(size0, val1), CVC4ApiException);
- ASSERT_THROW(d_solver.mkBitVector(size0, val2), CVC4ApiException);
- ASSERT_THROW(d_solver.mkBitVector("", 2), CVC4ApiException);
- ASSERT_THROW(d_solver.mkBitVector("10", 3), CVC4ApiException);
- ASSERT_THROW(d_solver.mkBitVector("20", 2), CVC4ApiException);
- ASSERT_THROW(d_solver.mkBitVector(8, "101010101", 2), CVC4ApiException);
- ASSERT_THROW(d_solver.mkBitVector(8, "-256", 10), CVC4ApiException);
+ ASSERT_THROW(d_solver.mkBitVector(size0, val1), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkBitVector(size0, val2), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkBitVector("", 2), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkBitVector("10", 3), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkBitVector("20", 2), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkBitVector(8, "101010101", 2), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkBitVector(8, "-256", 10), CVC5ApiException);
ASSERT_EQ(d_solver.mkBitVector("1010", 2), d_solver.mkBitVector("10", 10));
ASSERT_EQ(d_solver.mkBitVector("1010", 2), d_solver.mkBitVector("a", 16));
ASSERT_EQ(d_solver.mkBitVector(8, "01010101", 2).toString(), "#b01010101");
ASSERT_NO_THROW(d_solver.mkVar(funSort));
ASSERT_NO_THROW(d_solver.mkVar(boolSort, std::string("b")));
ASSERT_NO_THROW(d_solver.mkVar(funSort, ""));
- ASSERT_THROW(d_solver.mkVar(Sort()), CVC4ApiException);
- ASSERT_THROW(d_solver.mkVar(Sort(), "a"), CVC4ApiException);
+ ASSERT_THROW(d_solver.mkVar(Sort()), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkVar(Sort(), "a"), CVC5ApiException);
Solver slv;
- ASSERT_THROW(slv.mkVar(boolSort, "x"), CVC4ApiException);
+ ASSERT_THROW(slv.mkVar(boolSort, "x"), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, mkBoolean)
else
{
ASSERT_THROW(d_solver.mkRoundingMode(RoundingMode::ROUND_TOWARD_ZERO),
- CVC4ApiException);
+ CVC5ApiException);
}
}
TEST_F(TestApiBlackSolver, mkUninterpretedConst)
{
ASSERT_NO_THROW(d_solver.mkUninterpretedConst(d_solver.getBooleanSort(), 1));
- ASSERT_THROW(d_solver.mkUninterpretedConst(Sort(), 1), CVC4ApiException);
+ ASSERT_THROW(d_solver.mkUninterpretedConst(Sort(), 1), CVC5ApiException);
Solver slv;
ASSERT_THROW(slv.mkUninterpretedConst(d_solver.getBooleanSort(), 1),
- CVC4ApiException);
+ CVC5ApiException);
}
TEST_F(TestApiBlackSolver, mkAbstractValue)
{
ASSERT_NO_THROW(d_solver.mkAbstractValue(std::string("1")));
- ASSERT_THROW(d_solver.mkAbstractValue(std::string("0")), CVC4ApiException);
- ASSERT_THROW(d_solver.mkAbstractValue(std::string("-1")), CVC4ApiException);
- ASSERT_THROW(d_solver.mkAbstractValue(std::string("1.2")), CVC4ApiException);
- ASSERT_THROW(d_solver.mkAbstractValue("1/2"), CVC4ApiException);
- ASSERT_THROW(d_solver.mkAbstractValue("asdf"), CVC4ApiException);
+ ASSERT_THROW(d_solver.mkAbstractValue(std::string("0")), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkAbstractValue(std::string("-1")), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkAbstractValue(std::string("1.2")), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkAbstractValue("1/2"), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkAbstractValue("asdf"), CVC5ApiException);
ASSERT_NO_THROW(d_solver.mkAbstractValue((uint32_t)1));
ASSERT_NO_THROW(d_solver.mkAbstractValue((int32_t)1));
ASSERT_NO_THROW(d_solver.mkAbstractValue((int64_t)1));
ASSERT_NO_THROW(d_solver.mkAbstractValue((int32_t)-1));
ASSERT_NO_THROW(d_solver.mkAbstractValue((int64_t)-1));
- ASSERT_THROW(d_solver.mkAbstractValue(0), CVC4ApiException);
+ ASSERT_THROW(d_solver.mkAbstractValue(0), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, mkFloatingPoint)
}
else
{
- ASSERT_THROW(d_solver.mkFloatingPoint(3, 5, t1), CVC4ApiException);
+ ASSERT_THROW(d_solver.mkFloatingPoint(3, 5, t1), CVC5ApiException);
}
- ASSERT_THROW(d_solver.mkFloatingPoint(0, 5, Term()), CVC4ApiException);
- ASSERT_THROW(d_solver.mkFloatingPoint(0, 5, t1), CVC4ApiException);
- ASSERT_THROW(d_solver.mkFloatingPoint(3, 0, t1), CVC4ApiException);
- ASSERT_THROW(d_solver.mkFloatingPoint(3, 5, t2), CVC4ApiException);
- ASSERT_THROW(d_solver.mkFloatingPoint(3, 5, t2), CVC4ApiException);
+ ASSERT_THROW(d_solver.mkFloatingPoint(0, 5, Term()), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkFloatingPoint(0, 5, t1), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkFloatingPoint(3, 0, t1), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkFloatingPoint(3, 5, t2), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkFloatingPoint(3, 5, t2), CVC5ApiException);
if (d_solver.supportsFloatingPoint())
{
Solver slv;
- ASSERT_THROW(slv.mkFloatingPoint(3, 5, t1), CVC4ApiException);
+ ASSERT_THROW(slv.mkFloatingPoint(3, 5, t1), CVC5ApiException);
}
}
ASSERT_NO_THROW(d_solver.mkEmptySet(Sort()));
ASSERT_NO_THROW(d_solver.mkEmptySet(s));
ASSERT_THROW(d_solver.mkEmptySet(d_solver.getBooleanSort()),
- CVC4ApiException);
- ASSERT_THROW(slv.mkEmptySet(s), CVC4ApiException);
+ CVC5ApiException);
+ ASSERT_THROW(slv.mkEmptySet(s), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, mkEmptyBag)
ASSERT_NO_THROW(d_solver.mkEmptyBag(Sort()));
ASSERT_NO_THROW(d_solver.mkEmptyBag(s));
ASSERT_THROW(d_solver.mkEmptyBag(d_solver.getBooleanSort()),
- CVC4ApiException);
- ASSERT_THROW(slv.mkEmptyBag(s), CVC4ApiException);
+ CVC5ApiException);
+ ASSERT_THROW(slv.mkEmptyBag(s), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, mkEmptySequence)
Sort s = d_solver.mkSequenceSort(d_solver.getBooleanSort());
ASSERT_NO_THROW(d_solver.mkEmptySequence(s));
ASSERT_NO_THROW(d_solver.mkEmptySequence(d_solver.getBooleanSort()));
- ASSERT_THROW(slv.mkEmptySequence(s), CVC4ApiException);
+ ASSERT_THROW(slv.mkEmptySequence(s), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, mkFalse)
}
else
{
- ASSERT_THROW(d_solver.mkNaN(3, 5), CVC4ApiException);
+ ASSERT_THROW(d_solver.mkNaN(3, 5), CVC5ApiException);
}
}
}
else
{
- ASSERT_THROW(d_solver.mkNegZero(3, 5), CVC4ApiException);
+ ASSERT_THROW(d_solver.mkNegZero(3, 5), CVC5ApiException);
}
}
}
else
{
- ASSERT_THROW(d_solver.mkNegInf(3, 5), CVC4ApiException);
+ ASSERT_THROW(d_solver.mkNegInf(3, 5), CVC5ApiException);
}
}
}
else
{
- ASSERT_THROW(d_solver.mkPosInf(3, 5), CVC4ApiException);
+ ASSERT_THROW(d_solver.mkPosInf(3, 5), CVC5ApiException);
}
}
}
else
{
- ASSERT_THROW(d_solver.mkPosZero(3, 5), CVC4ApiException);
+ ASSERT_THROW(d_solver.mkPosZero(3, 5), CVC5ApiException);
}
}
TEST_F(TestApiBlackSolver, mkOp)
{
// mkOp(Kind kind, Kind k)
- ASSERT_THROW(d_solver.mkOp(BITVECTOR_EXTRACT, EQUAL), CVC4ApiException);
+ ASSERT_THROW(d_solver.mkOp(BITVECTOR_EXTRACT, EQUAL), CVC5ApiException);
// mkOp(Kind kind, const std::string& arg)
ASSERT_NO_THROW(d_solver.mkOp(RECORD_UPDATE, "asdf"));
ASSERT_NO_THROW(d_solver.mkOp(DIVISIBLE, "2147483648"));
- ASSERT_THROW(d_solver.mkOp(BITVECTOR_EXTRACT, "asdf"), CVC4ApiException);
+ ASSERT_THROW(d_solver.mkOp(BITVECTOR_EXTRACT, "asdf"), CVC5ApiException);
// mkOp(Kind kind, uint32_t arg)
ASSERT_NO_THROW(d_solver.mkOp(DIVISIBLE, 1));
ASSERT_NO_THROW(d_solver.mkOp(BITVECTOR_ROTATE_LEFT, 1));
ASSERT_NO_THROW(d_solver.mkOp(BITVECTOR_ROTATE_RIGHT, 1));
- ASSERT_THROW(d_solver.mkOp(BITVECTOR_EXTRACT, 1), CVC4ApiException);
+ ASSERT_THROW(d_solver.mkOp(BITVECTOR_EXTRACT, 1), CVC5ApiException);
// mkOp(Kind kind, uint32_t arg1, uint32_t arg2)
ASSERT_NO_THROW(d_solver.mkOp(BITVECTOR_EXTRACT, 1, 1));
- ASSERT_THROW(d_solver.mkOp(DIVISIBLE, 1, 2), CVC4ApiException);
+ ASSERT_THROW(d_solver.mkOp(DIVISIBLE, 1, 2), CVC5ApiException);
// mkOp(Kind kind, std::vector<uint32_t> args)
std::vector<uint32_t> args = {1, 2, 2};
TEST_F(TestApiBlackSolver, mkInteger)
{
ASSERT_NO_THROW(d_solver.mkInteger("123"));
- ASSERT_THROW(d_solver.mkInteger("1.23"), CVC4ApiException);
- ASSERT_THROW(d_solver.mkInteger("1/23"), CVC4ApiException);
- ASSERT_THROW(d_solver.mkInteger("12/3"), CVC4ApiException);
- ASSERT_THROW(d_solver.mkInteger(".2"), CVC4ApiException);
- ASSERT_THROW(d_solver.mkInteger("2."), CVC4ApiException);
- ASSERT_THROW(d_solver.mkInteger(""), CVC4ApiException);
- ASSERT_THROW(d_solver.mkInteger("asdf"), CVC4ApiException);
- ASSERT_THROW(d_solver.mkInteger("1.2/3"), CVC4ApiException);
- ASSERT_THROW(d_solver.mkInteger("."), CVC4ApiException);
- ASSERT_THROW(d_solver.mkInteger("/"), CVC4ApiException);
- ASSERT_THROW(d_solver.mkInteger("2/"), CVC4ApiException);
- ASSERT_THROW(d_solver.mkInteger("/2"), CVC4ApiException);
+ ASSERT_THROW(d_solver.mkInteger("1.23"), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkInteger("1/23"), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkInteger("12/3"), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkInteger(".2"), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkInteger("2."), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkInteger(""), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkInteger("asdf"), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkInteger("1.2/3"), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkInteger("."), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkInteger("/"), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkInteger("2/"), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkInteger("/2"), CVC5ApiException);
ASSERT_NO_THROW(d_solver.mkReal(std::string("123")));
- ASSERT_THROW(d_solver.mkInteger(std::string("1.23")), CVC4ApiException);
- ASSERT_THROW(d_solver.mkInteger(std::string("1/23")), CVC4ApiException);
- ASSERT_THROW(d_solver.mkInteger(std::string("12/3")), CVC4ApiException);
- ASSERT_THROW(d_solver.mkInteger(std::string(".2")), CVC4ApiException);
- ASSERT_THROW(d_solver.mkInteger(std::string("2.")), CVC4ApiException);
- ASSERT_THROW(d_solver.mkInteger(std::string("")), CVC4ApiException);
- ASSERT_THROW(d_solver.mkInteger(std::string("asdf")), CVC4ApiException);
- ASSERT_THROW(d_solver.mkInteger(std::string("1.2/3")), CVC4ApiException);
- ASSERT_THROW(d_solver.mkInteger(std::string(".")), CVC4ApiException);
- ASSERT_THROW(d_solver.mkInteger(std::string("/")), CVC4ApiException);
- ASSERT_THROW(d_solver.mkInteger(std::string("2/")), CVC4ApiException);
- ASSERT_THROW(d_solver.mkInteger(std::string("/2")), CVC4ApiException);
+ ASSERT_THROW(d_solver.mkInteger(std::string("1.23")), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkInteger(std::string("1/23")), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkInteger(std::string("12/3")), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkInteger(std::string(".2")), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkInteger(std::string("2.")), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkInteger(std::string("")), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkInteger(std::string("asdf")), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkInteger(std::string("1.2/3")), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkInteger(std::string(".")), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkInteger(std::string("/")), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkInteger(std::string("2/")), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkInteger(std::string("/2")), CVC5ApiException);
int32_t val1 = 1;
int64_t val2 = -1;
ASSERT_NO_THROW(d_solver.mkReal("12/3"));
ASSERT_NO_THROW(d_solver.mkReal(".2"));
ASSERT_NO_THROW(d_solver.mkReal("2."));
- ASSERT_THROW(d_solver.mkReal(""), CVC4ApiException);
- ASSERT_THROW(d_solver.mkReal("asdf"), CVC4ApiException);
- ASSERT_THROW(d_solver.mkReal("1.2/3"), CVC4ApiException);
- ASSERT_THROW(d_solver.mkReal("."), CVC4ApiException);
- ASSERT_THROW(d_solver.mkReal("/"), CVC4ApiException);
- ASSERT_THROW(d_solver.mkReal("2/"), CVC4ApiException);
- ASSERT_THROW(d_solver.mkReal("/2"), CVC4ApiException);
+ ASSERT_THROW(d_solver.mkReal(""), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkReal("asdf"), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkReal("1.2/3"), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkReal("."), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkReal("/"), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkReal("2/"), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkReal("/2"), CVC5ApiException);
ASSERT_NO_THROW(d_solver.mkReal(std::string("123")));
ASSERT_NO_THROW(d_solver.mkReal(std::string("1.23")));
ASSERT_NO_THROW(d_solver.mkReal(std::string("12/3")));
ASSERT_NO_THROW(d_solver.mkReal(std::string(".2")));
ASSERT_NO_THROW(d_solver.mkReal(std::string("2.")));
- ASSERT_THROW(d_solver.mkReal(std::string("")), CVC4ApiException);
- ASSERT_THROW(d_solver.mkReal(std::string("asdf")), CVC4ApiException);
- ASSERT_THROW(d_solver.mkReal(std::string("1.2/3")), CVC4ApiException);
- ASSERT_THROW(d_solver.mkReal(std::string(".")), CVC4ApiException);
- ASSERT_THROW(d_solver.mkReal(std::string("/")), CVC4ApiException);
- ASSERT_THROW(d_solver.mkReal(std::string("2/")), CVC4ApiException);
- ASSERT_THROW(d_solver.mkReal(std::string("/2")), CVC4ApiException);
+ ASSERT_THROW(d_solver.mkReal(std::string("")), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkReal(std::string("asdf")), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkReal(std::string("1.2/3")), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkReal(std::string(".")), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkReal(std::string("/")), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkReal(std::string("2/")), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkReal(std::string("/2")), CVC5ApiException);
int32_t val1 = 1;
int64_t val2 = -1;
TEST_F(TestApiBlackSolver, mkSepNil)
{
ASSERT_NO_THROW(d_solver.mkSepNil(d_solver.getBooleanSort()));
- ASSERT_THROW(d_solver.mkSepNil(Sort()), CVC4ApiException);
+ ASSERT_THROW(d_solver.mkSepNil(Sort()), CVC5ApiException);
Solver slv;
- ASSERT_THROW(slv.mkSepNil(d_solver.getIntegerSort()), CVC4ApiException);
+ ASSERT_THROW(slv.mkSepNil(d_solver.getIntegerSort()), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, mkString)
{
ASSERT_NO_THROW(d_solver.mkChar(std::string("0123")));
ASSERT_NO_THROW(d_solver.mkChar("aA"));
- ASSERT_THROW(d_solver.mkChar(""), CVC4ApiException);
- ASSERT_THROW(d_solver.mkChar("0g0"), CVC4ApiException);
- ASSERT_THROW(d_solver.mkChar("100000"), CVC4ApiException);
+ ASSERT_THROW(d_solver.mkChar(""), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkChar("0g0"), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkChar("100000"), CVC5ApiException);
ASSERT_EQ(d_solver.mkChar("abc"), d_solver.mkChar("ABC"));
}
ASSERT_NO_THROW(d_solver.mkTerm(PI));
ASSERT_NO_THROW(d_solver.mkTerm(REGEXP_EMPTY));
ASSERT_NO_THROW(d_solver.mkTerm(REGEXP_SIGMA));
- ASSERT_THROW(d_solver.mkTerm(CONST_BITVECTOR), CVC4ApiException);
+ ASSERT_THROW(d_solver.mkTerm(CONST_BITVECTOR), CVC5ApiException);
// mkTerm(Kind kind, Term child) const
ASSERT_NO_THROW(d_solver.mkTerm(NOT, d_solver.mkTrue()));
- ASSERT_THROW(d_solver.mkTerm(NOT, Term()), CVC4ApiException);
- ASSERT_THROW(d_solver.mkTerm(NOT, a), CVC4ApiException);
- ASSERT_THROW(slv.mkTerm(NOT, d_solver.mkTrue()), CVC4ApiException);
+ ASSERT_THROW(d_solver.mkTerm(NOT, Term()), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkTerm(NOT, a), CVC5ApiException);
+ ASSERT_THROW(slv.mkTerm(NOT, d_solver.mkTrue()), CVC5ApiException);
// mkTerm(Kind kind, Term child1, Term child2) const
ASSERT_NO_THROW(d_solver.mkTerm(EQUAL, a, b));
- ASSERT_THROW(d_solver.mkTerm(EQUAL, Term(), b), CVC4ApiException);
- ASSERT_THROW(d_solver.mkTerm(EQUAL, a, Term()), CVC4ApiException);
- ASSERT_THROW(d_solver.mkTerm(EQUAL, a, d_solver.mkTrue()), CVC4ApiException);
- ASSERT_THROW(slv.mkTerm(EQUAL, a, b), CVC4ApiException);
+ ASSERT_THROW(d_solver.mkTerm(EQUAL, Term(), b), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkTerm(EQUAL, a, Term()), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkTerm(EQUAL, a, d_solver.mkTrue()), CVC5ApiException);
+ ASSERT_THROW(slv.mkTerm(EQUAL, a, b), CVC5ApiException);
// mkTerm(Kind kind, Term child1, Term child2, Term child3) const
ASSERT_NO_THROW(d_solver.mkTerm(
ITE, d_solver.mkTrue(), d_solver.mkTrue(), d_solver.mkTrue()));
ASSERT_THROW(
d_solver.mkTerm(ITE, Term(), d_solver.mkTrue(), d_solver.mkTrue()),
- CVC4ApiException);
+ CVC5ApiException);
ASSERT_THROW(
d_solver.mkTerm(ITE, d_solver.mkTrue(), Term(), d_solver.mkTrue()),
- CVC4ApiException);
+ CVC5ApiException);
ASSERT_THROW(
d_solver.mkTerm(ITE, d_solver.mkTrue(), d_solver.mkTrue(), Term()),
- CVC4ApiException);
+ CVC5ApiException);
ASSERT_THROW(d_solver.mkTerm(ITE, d_solver.mkTrue(), d_solver.mkTrue(), b),
- CVC4ApiException);
+ CVC5ApiException);
ASSERT_THROW(
slv.mkTerm(ITE, d_solver.mkTrue(), d_solver.mkTrue(), d_solver.mkTrue()),
- CVC4ApiException);
+ CVC5ApiException);
// mkTerm(Kind kind, const std::vector<Term>& children) const
ASSERT_NO_THROW(d_solver.mkTerm(EQUAL, v1));
- ASSERT_THROW(d_solver.mkTerm(EQUAL, v2), CVC4ApiException);
- ASSERT_THROW(d_solver.mkTerm(EQUAL, v3), CVC4ApiException);
- ASSERT_THROW(d_solver.mkTerm(DISTINCT, v6), CVC4ApiException);
+ ASSERT_THROW(d_solver.mkTerm(EQUAL, v2), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkTerm(EQUAL, v3), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkTerm(DISTINCT, v6), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, mkTermFromOp)
// mkTerm(Op op, Term term) const
ASSERT_NO_THROW(d_solver.mkTerm(APPLY_CONSTRUCTOR, nilTerm1));
ASSERT_NO_THROW(d_solver.mkTerm(APPLY_CONSTRUCTOR, nilTerm2));
- ASSERT_THROW(d_solver.mkTerm(APPLY_SELECTOR, nilTerm1), CVC4ApiException);
- ASSERT_THROW(d_solver.mkTerm(APPLY_SELECTOR, consTerm1), CVC4ApiException);
- ASSERT_THROW(d_solver.mkTerm(APPLY_CONSTRUCTOR, consTerm2), CVC4ApiException);
- ASSERT_THROW(d_solver.mkTerm(opterm1), CVC4ApiException);
- ASSERT_THROW(d_solver.mkTerm(APPLY_SELECTOR, headTerm1), CVC4ApiException);
- ASSERT_THROW(d_solver.mkTerm(opterm1), CVC4ApiException);
- ASSERT_THROW(slv.mkTerm(APPLY_CONSTRUCTOR, nilTerm1), CVC4ApiException);
+ ASSERT_THROW(d_solver.mkTerm(APPLY_SELECTOR, nilTerm1), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkTerm(APPLY_SELECTOR, consTerm1), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkTerm(APPLY_CONSTRUCTOR, consTerm2), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkTerm(opterm1), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkTerm(APPLY_SELECTOR, headTerm1), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkTerm(opterm1), CVC5ApiException);
+ ASSERT_THROW(slv.mkTerm(APPLY_CONSTRUCTOR, nilTerm1), CVC5ApiException);
// mkTerm(Op op, Term child) const
ASSERT_NO_THROW(d_solver.mkTerm(opterm1, a));
ASSERT_NO_THROW(d_solver.mkTerm(opterm2, d_solver.mkInteger(1)));
ASSERT_NO_THROW(d_solver.mkTerm(APPLY_SELECTOR, headTerm1, c));
ASSERT_NO_THROW(d_solver.mkTerm(APPLY_SELECTOR, tailTerm2, c));
- ASSERT_THROW(d_solver.mkTerm(opterm2, a), CVC4ApiException);
- ASSERT_THROW(d_solver.mkTerm(opterm1, Term()), CVC4ApiException);
+ ASSERT_THROW(d_solver.mkTerm(opterm2, a), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkTerm(opterm1, Term()), CVC5ApiException);
ASSERT_THROW(
d_solver.mkTerm(APPLY_CONSTRUCTOR, consTerm1, d_solver.mkInteger(0)),
- CVC4ApiException);
- ASSERT_THROW(slv.mkTerm(opterm1, a), CVC4ApiException);
+ CVC5ApiException);
+ ASSERT_THROW(slv.mkTerm(opterm1, a), CVC5ApiException);
// mkTerm(Op op, Term child1, Term child2) const
ASSERT_NO_THROW(
d_solver.mkTerm(APPLY_CONSTRUCTOR, nilTerm1)));
ASSERT_THROW(
d_solver.mkTerm(opterm2, d_solver.mkInteger(1), d_solver.mkInteger(2)),
- CVC4ApiException);
- ASSERT_THROW(d_solver.mkTerm(opterm1, a, b), CVC4ApiException);
+ CVC5ApiException);
+ ASSERT_THROW(d_solver.mkTerm(opterm1, a, b), CVC5ApiException);
ASSERT_THROW(d_solver.mkTerm(opterm2, d_solver.mkInteger(1), Term()),
- CVC4ApiException);
+ CVC5ApiException);
ASSERT_THROW(d_solver.mkTerm(opterm2, Term(), d_solver.mkInteger(1)),
- CVC4ApiException);
+ CVC5ApiException);
ASSERT_THROW(slv.mkTerm(APPLY_CONSTRUCTOR,
consTerm1,
d_solver.mkInteger(0),
d_solver.mkTerm(APPLY_CONSTRUCTOR, nilTerm1)),
- CVC4ApiException);
+ CVC5ApiException);
// mkTerm(Op op, Term child1, Term child2, Term child3) const
- ASSERT_THROW(d_solver.mkTerm(opterm1, a, b, a), CVC4ApiException);
+ ASSERT_THROW(d_solver.mkTerm(opterm1, a, b, a), CVC5ApiException);
ASSERT_THROW(
d_solver.mkTerm(
opterm2, d_solver.mkInteger(1), d_solver.mkInteger(1), Term()),
- CVC4ApiException);
+ CVC5ApiException);
// mkTerm(Op op, const std::vector<Term>& children) const
ASSERT_NO_THROW(d_solver.mkTerm(opterm2, v4));
- ASSERT_THROW(d_solver.mkTerm(opterm2, v1), CVC4ApiException);
- ASSERT_THROW(d_solver.mkTerm(opterm2, v2), CVC4ApiException);
- ASSERT_THROW(d_solver.mkTerm(opterm2, v3), CVC4ApiException);
- ASSERT_THROW(slv.mkTerm(opterm2, v4), CVC4ApiException);
+ ASSERT_THROW(d_solver.mkTerm(opterm2, v1), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkTerm(opterm2, v2), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkTerm(opterm2, v3), CVC5ApiException);
+ ASSERT_THROW(slv.mkTerm(opterm2, v4), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, mkTrue)
d_solver.mkTuple({d_solver.getRealSort()}, {d_solver.mkInteger("5")}));
ASSERT_THROW(d_solver.mkTuple({}, {d_solver.mkBitVector("101", 2)}),
- CVC4ApiException);
+ CVC5ApiException);
ASSERT_THROW(d_solver.mkTuple({d_solver.mkBitVectorSort(4)},
{d_solver.mkBitVector("101", 2)}),
- CVC4ApiException);
+ CVC5ApiException);
ASSERT_THROW(
d_solver.mkTuple({d_solver.getIntegerSort()}, {d_solver.mkReal("5.3")}),
- CVC4ApiException);
+ CVC5ApiException);
Solver slv;
ASSERT_THROW(
slv.mkTuple({d_solver.mkBitVectorSort(3)}, {slv.mkBitVector("101", 2)}),
- CVC4ApiException);
+ CVC5ApiException);
ASSERT_THROW(
slv.mkTuple({slv.mkBitVectorSort(3)}, {d_solver.mkBitVector("101", 2)}),
- CVC4ApiException);
+ CVC5ApiException);
}
TEST_F(TestApiBlackSolver, mkUniverseSet)
{
ASSERT_NO_THROW(d_solver.mkUniverseSet(d_solver.getBooleanSort()));
- ASSERT_THROW(d_solver.mkUniverseSet(Sort()), CVC4ApiException);
+ ASSERT_THROW(d_solver.mkUniverseSet(Sort()), CVC5ApiException);
Solver slv;
- ASSERT_THROW(slv.mkUniverseSet(d_solver.getBooleanSort()), CVC4ApiException);
+ ASSERT_THROW(slv.mkUniverseSet(d_solver.getBooleanSort()), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, mkConst)
ASSERT_NO_THROW(d_solver.mkConst(intSort, std::string("i")));
ASSERT_NO_THROW(d_solver.mkConst(funSort, "f"));
ASSERT_NO_THROW(d_solver.mkConst(funSort, ""));
- ASSERT_THROW(d_solver.mkConst(Sort()), CVC4ApiException);
- ASSERT_THROW(d_solver.mkConst(Sort(), "a"), CVC4ApiException);
+ ASSERT_THROW(d_solver.mkConst(Sort()), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkConst(Sort(), "a"), CVC5ApiException);
Solver slv;
- ASSERT_THROW(slv.mkConst(boolSort), CVC4ApiException);
+ ASSERT_THROW(slv.mkConst(boolSort), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, mkConstArray)
Term constArr = d_solver.mkConstArray(arrSort, zero);
ASSERT_NO_THROW(d_solver.mkConstArray(arrSort, zero));
- ASSERT_THROW(d_solver.mkConstArray(Sort(), zero), CVC4ApiException);
- ASSERT_THROW(d_solver.mkConstArray(arrSort, Term()), CVC4ApiException);
+ ASSERT_THROW(d_solver.mkConstArray(Sort(), zero), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkConstArray(arrSort, Term()), CVC5ApiException);
ASSERT_THROW(d_solver.mkConstArray(arrSort, d_solver.mkBitVector(1, 1)),
- CVC4ApiException);
- ASSERT_THROW(d_solver.mkConstArray(intSort, zero), CVC4ApiException);
+ CVC5ApiException);
+ ASSERT_THROW(d_solver.mkConstArray(intSort, zero), CVC5ApiException);
Solver slv;
Term zero2 = slv.mkInteger(0);
Sort arrSort2 = slv.mkArraySort(slv.getIntegerSort(), slv.getIntegerSort());
- ASSERT_THROW(slv.mkConstArray(arrSort2, zero), CVC4ApiException);
- ASSERT_THROW(slv.mkConstArray(arrSort, zero2), CVC4ApiException);
+ ASSERT_THROW(slv.mkConstArray(arrSort2, zero), CVC5ApiException);
+ ASSERT_THROW(slv.mkConstArray(arrSort, zero2), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, declareDatatype)
ASSERT_NO_THROW(d_solver.declareDatatype(std::string(""), ctors3));
std::vector<DatatypeConstructorDecl> ctors4;
ASSERT_THROW(d_solver.declareDatatype(std::string("c"), ctors4),
- CVC4ApiException);
+ CVC5ApiException);
ASSERT_THROW(d_solver.declareDatatype(std::string(""), ctors4),
- CVC4ApiException);
+ CVC5ApiException);
Solver slv;
- ASSERT_THROW(slv.declareDatatype(std::string("a"), ctors1), CVC4ApiException);
+ ASSERT_THROW(slv.declareDatatype(std::string("a"), ctors1), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, declareFun)
ASSERT_NO_THROW(d_solver.declareFun("f1", {}, bvSort));
ASSERT_NO_THROW(
d_solver.declareFun("f3", {bvSort, d_solver.getIntegerSort()}, bvSort));
- ASSERT_THROW(d_solver.declareFun("f2", {}, funSort), CVC4ApiException);
+ ASSERT_THROW(d_solver.declareFun("f2", {}, funSort), CVC5ApiException);
// functions as arguments is allowed
ASSERT_NO_THROW(d_solver.declareFun("f4", {bvSort, funSort}, bvSort));
ASSERT_THROW(d_solver.declareFun("f5", {bvSort, bvSort}, funSort),
- CVC4ApiException);
+ CVC5ApiException);
Solver slv;
- ASSERT_THROW(slv.declareFun("f1", {}, bvSort), CVC4ApiException);
+ ASSERT_THROW(slv.declareFun("f1", {}, bvSort), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, declareSort)
ASSERT_NO_THROW(d_solver.defineFun("ff", {b1, b2}, bvSort, v1));
ASSERT_NO_THROW(d_solver.defineFun(f1, {b1, b11}, v1));
ASSERT_THROW(d_solver.defineFun("ff", {v1, b2}, bvSort, v1),
- CVC4ApiException);
- ASSERT_THROW(d_solver.defineFun("fff", {b1}, bvSort, v3), CVC4ApiException);
+ CVC5ApiException);
+ ASSERT_THROW(d_solver.defineFun("fff", {b1}, bvSort, v3), CVC5ApiException);
ASSERT_THROW(d_solver.defineFun("ffff", {b1}, funSort2, v3),
- CVC4ApiException);
+ CVC5ApiException);
// b3 has function sort, which is allowed as an argument
ASSERT_NO_THROW(d_solver.defineFun("fffff", {b1, b3}, bvSort, v1));
- ASSERT_THROW(d_solver.defineFun(f1, {v1, b11}, v1), CVC4ApiException);
- ASSERT_THROW(d_solver.defineFun(f1, {b1}, v1), CVC4ApiException);
- ASSERT_THROW(d_solver.defineFun(f1, {b1, b11}, v2), CVC4ApiException);
- ASSERT_THROW(d_solver.defineFun(f1, {b1, b11}, v3), CVC4ApiException);
- ASSERT_THROW(d_solver.defineFun(f2, {b1}, v2), CVC4ApiException);
- ASSERT_THROW(d_solver.defineFun(f3, {b1}, v1), CVC4ApiException);
+ ASSERT_THROW(d_solver.defineFun(f1, {v1, b11}, v1), CVC5ApiException);
+ ASSERT_THROW(d_solver.defineFun(f1, {b1}, v1), CVC5ApiException);
+ ASSERT_THROW(d_solver.defineFun(f1, {b1, b11}, v2), CVC5ApiException);
+ ASSERT_THROW(d_solver.defineFun(f1, {b1, b11}, v3), CVC5ApiException);
+ ASSERT_THROW(d_solver.defineFun(f2, {b1}, v2), CVC5ApiException);
+ ASSERT_THROW(d_solver.defineFun(f3, {b1}, v1), CVC5ApiException);
Solver slv;
Sort bvSort2 = slv.mkBitVectorSort(32);
Term v12 = slv.mkConst(bvSort2, "v1");
Term b12 = slv.mkVar(bvSort2, "b1");
Term b22 = slv.mkVar(slv.getIntegerSort(), "b2");
- ASSERT_THROW(slv.defineFun("f", {}, bvSort, v12), CVC4ApiException);
- ASSERT_THROW(slv.defineFun("f", {}, bvSort2, v1), CVC4ApiException);
- ASSERT_THROW(slv.defineFun("ff", {b1, b22}, bvSort2, v12), CVC4ApiException);
- ASSERT_THROW(slv.defineFun("ff", {b12, b2}, bvSort2, v12), CVC4ApiException);
- ASSERT_THROW(slv.defineFun("ff", {b12, b22}, bvSort, v12), CVC4ApiException);
- ASSERT_THROW(slv.defineFun("ff", {b12, b22}, bvSort2, v1), CVC4ApiException);
+ ASSERT_THROW(slv.defineFun("f", {}, bvSort, v12), CVC5ApiException);
+ ASSERT_THROW(slv.defineFun("f", {}, bvSort2, v1), CVC5ApiException);
+ ASSERT_THROW(slv.defineFun("ff", {b1, b22}, bvSort2, v12), CVC5ApiException);
+ ASSERT_THROW(slv.defineFun("ff", {b12, b2}, bvSort2, v12), CVC5ApiException);
+ ASSERT_THROW(slv.defineFun("ff", {b12, b22}, bvSort, v12), CVC5ApiException);
+ ASSERT_THROW(slv.defineFun("ff", {b12, b22}, bvSort2, v1), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, defineFunGlobal)
ASSERT_NO_THROW(d_solver.defineFunRec("ff", {b1, b2}, bvSort, v1));
ASSERT_NO_THROW(d_solver.defineFunRec(f1, {b1, b11}, v1));
ASSERT_THROW(d_solver.defineFunRec("fff", {b1}, bvSort, v3),
- CVC4ApiException);
+ CVC5ApiException);
ASSERT_THROW(d_solver.defineFunRec("ff", {b1, v2}, bvSort, v1),
- CVC4ApiException);
+ CVC5ApiException);
ASSERT_THROW(d_solver.defineFunRec("ffff", {b1}, funSort2, v3),
- CVC4ApiException);
+ CVC5ApiException);
// b3 has function sort, which is allowed as an argument
ASSERT_NO_THROW(d_solver.defineFunRec("fffff", {b1, b3}, bvSort, v1));
- ASSERT_THROW(d_solver.defineFunRec(f1, {b1}, v1), CVC4ApiException);
- ASSERT_THROW(d_solver.defineFunRec(f1, {b1, b11}, v2), CVC4ApiException);
- ASSERT_THROW(d_solver.defineFunRec(f1, {b1, b11}, v3), CVC4ApiException);
- ASSERT_THROW(d_solver.defineFunRec(f2, {b1}, v2), CVC4ApiException);
- ASSERT_THROW(d_solver.defineFunRec(f3, {b1}, v1), CVC4ApiException);
+ ASSERT_THROW(d_solver.defineFunRec(f1, {b1}, v1), CVC5ApiException);
+ ASSERT_THROW(d_solver.defineFunRec(f1, {b1, b11}, v2), CVC5ApiException);
+ ASSERT_THROW(d_solver.defineFunRec(f1, {b1, b11}, v3), CVC5ApiException);
+ ASSERT_THROW(d_solver.defineFunRec(f2, {b1}, v2), CVC5ApiException);
+ ASSERT_THROW(d_solver.defineFunRec(f3, {b1}, v1), CVC5ApiException);
Solver slv;
Sort bvSort2 = slv.mkBitVectorSort(32);
Term b22 = slv.mkVar(slv.getIntegerSort(), "b2");
ASSERT_NO_THROW(slv.defineFunRec("f", {}, bvSort2, v12));
ASSERT_NO_THROW(slv.defineFunRec("ff", {b12, b22}, bvSort2, v12));
- ASSERT_THROW(slv.defineFunRec("f", {}, bvSort, v12), CVC4ApiException);
- ASSERT_THROW(slv.defineFunRec("f", {}, bvSort2, v1), CVC4ApiException);
+ ASSERT_THROW(slv.defineFunRec("f", {}, bvSort, v12), CVC5ApiException);
+ ASSERT_THROW(slv.defineFunRec("f", {}, bvSort2, v1), CVC5ApiException);
ASSERT_THROW(slv.defineFunRec("ff", {b1, b22}, bvSort2, v12),
- CVC4ApiException);
+ CVC5ApiException);
ASSERT_THROW(slv.defineFunRec("ff", {b12, b2}, bvSort2, v12),
- CVC4ApiException);
+ CVC5ApiException);
ASSERT_THROW(slv.defineFunRec("ff", {b12, b22}, bvSort, v12),
- CVC4ApiException);
+ CVC5ApiException);
ASSERT_THROW(slv.defineFunRec("ff", {b12, b22}, bvSort2, v1),
- CVC4ApiException);
+ CVC5ApiException);
}
TEST_F(TestApiBlackSolver, defineFunRecWrongLogic)
Term b = d_solver.mkVar(bvSort, "b");
Term v = d_solver.mkConst(bvSort, "v");
Term f = d_solver.mkConst(funSort, "f");
- ASSERT_THROW(d_solver.defineFunRec("f", {}, bvSort, v), CVC4ApiException);
- ASSERT_THROW(d_solver.defineFunRec(f, {b, b}, v), CVC4ApiException);
+ ASSERT_THROW(d_solver.defineFunRec("f", {}, bvSort, v), CVC5ApiException);
+ ASSERT_THROW(d_solver.defineFunRec(f, {b, b}, v), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, defineFunRecGlobal)
ASSERT_NO_THROW(
d_solver.defineFunsRec({f1, f2}, {{b1, b11}, {b4}}, {v1, v2}));
ASSERT_THROW(d_solver.defineFunsRec({f1, f2}, {{v1, b11}, {b4}}, {v1, v2}),
- CVC4ApiException);
+ CVC5ApiException);
ASSERT_THROW(d_solver.defineFunsRec({f1, f3}, {{b1, b11}, {b4}}, {v1, v2}),
- CVC4ApiException);
+ CVC5ApiException);
ASSERT_THROW(d_solver.defineFunsRec({f1, f2}, {{b1}, {b4}}, {v1, v2}),
- CVC4ApiException);
+ CVC5ApiException);
ASSERT_THROW(d_solver.defineFunsRec({f1, f2}, {{b1, b2}, {b4}}, {v1, v2}),
- CVC4ApiException);
+ CVC5ApiException);
ASSERT_THROW(d_solver.defineFunsRec({f1, f2}, {{b1, b11}, {b4}}, {v1, v4}),
- CVC4ApiException);
+ CVC5ApiException);
Solver slv;
Sort uSort2 = slv.mkUninterpretedSort("u");
ASSERT_NO_THROW(
slv.defineFunsRec({f12, f22}, {{b12, b112}, {b42}}, {v12, v22}));
ASSERT_THROW(slv.defineFunsRec({f1, f22}, {{b12, b112}, {b42}}, {v12, v22}),
- CVC4ApiException);
+ CVC5ApiException);
ASSERT_THROW(slv.defineFunsRec({f12, f2}, {{b12, b112}, {b42}}, {v12, v22}),
- CVC4ApiException);
+ CVC5ApiException);
ASSERT_THROW(slv.defineFunsRec({f12, f22}, {{b1, b112}, {b42}}, {v12, v22}),
- CVC4ApiException);
+ CVC5ApiException);
ASSERT_THROW(slv.defineFunsRec({f12, f22}, {{b12, b11}, {b42}}, {v12, v22}),
- CVC4ApiException);
+ CVC5ApiException);
ASSERT_THROW(slv.defineFunsRec({f12, f22}, {{b12, b112}, {b4}}, {v12, v22}),
- CVC4ApiException);
+ CVC5ApiException);
ASSERT_THROW(slv.defineFunsRec({f12, f22}, {{b12, b112}, {b42}}, {v1, v22}),
- CVC4ApiException);
+ CVC5ApiException);
ASSERT_THROW(slv.defineFunsRec({f12, f22}, {{b12, b112}, {b42}}, {v12, v2}),
- CVC4ApiException);
+ CVC5ApiException);
}
TEST_F(TestApiBlackSolver, defineFunsRecWrongLogic)
Term f1 = d_solver.mkConst(funSort1, "f1");
Term f2 = d_solver.mkConst(funSort2, "f2");
ASSERT_THROW(d_solver.defineFunsRec({f1, f2}, {{b, b}, {u}}, {v1, v2}),
- CVC4ApiException);
+ CVC5ApiException);
}
TEST_F(TestApiBlackSolver, defineFunsRecGlobal)
TEST_F(TestApiBlackSolver, getInfo)
{
ASSERT_NO_THROW(d_solver.getInfo("name"));
- ASSERT_THROW(d_solver.getInfo("asdf"), CVC4ApiException);
+ ASSERT_THROW(d_solver.getInfo("asdf"), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, getInterpolant)
Term exta = d_solver.mkTerm(ext, a);
ASSERT_FALSE(a.hasOp());
- ASSERT_THROW(a.getOp(), CVC4ApiException);
+ ASSERT_THROW(a.getOp(), CVC5ApiException);
ASSERT_TRUE(exta.hasOp());
ASSERT_EQ(exta.getOp(), ext);
TEST_F(TestApiBlackSolver, getOption)
{
ASSERT_NO_THROW(d_solver.getOption("incremental"));
- ASSERT_THROW(d_solver.getOption("asdf"), CVC4ApiException);
+ ASSERT_THROW(d_solver.getOption("asdf"), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, getUnsatAssumptions1)
{
d_solver.setOption("incremental", "false");
d_solver.checkSatAssuming(d_solver.mkFalse());
- ASSERT_THROW(d_solver.getUnsatAssumptions(), CVC4ApiException);
+ ASSERT_THROW(d_solver.getUnsatAssumptions(), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, getUnsatAssumptions2)
d_solver.setOption("incremental", "true");
d_solver.setOption("produce-unsat-assumptions", "false");
d_solver.checkSatAssuming(d_solver.mkFalse());
- ASSERT_THROW(d_solver.getUnsatAssumptions(), CVC4ApiException);
+ ASSERT_THROW(d_solver.getUnsatAssumptions(), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, getUnsatAssumptions3)
d_solver.checkSatAssuming(d_solver.mkFalse());
ASSERT_NO_THROW(d_solver.getUnsatAssumptions());
d_solver.checkSatAssuming(d_solver.mkTrue());
- ASSERT_THROW(d_solver.getUnsatAssumptions(), CVC4ApiException);
+ ASSERT_THROW(d_solver.getUnsatAssumptions(), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, getUnsatCore1)
d_solver.setOption("incremental", "false");
d_solver.assertFormula(d_solver.mkFalse());
d_solver.checkSat();
- ASSERT_THROW(d_solver.getUnsatCore(), CVC4ApiException);
+ ASSERT_THROW(d_solver.getUnsatCore(), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, getUnsatCore2)
d_solver.setOption("produce-unsat-cores", "false");
d_solver.assertFormula(d_solver.mkFalse());
d_solver.checkSat();
- ASSERT_THROW(d_solver.getUnsatCore(), CVC4ApiException);
+ ASSERT_THROW(d_solver.getUnsatCore(), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, getUnsatCore3)
Term t = d_solver.mkTrue();
d_solver.assertFormula(t);
d_solver.checkSat();
- ASSERT_THROW(d_solver.getValue(t), CVC4ApiException);
+ ASSERT_THROW(d_solver.getValue(t), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, getValue2)
Term t = d_solver.mkFalse();
d_solver.assertFormula(t);
d_solver.checkSat();
- ASSERT_THROW(d_solver.getValue(t), CVC4ApiException);
+ ASSERT_THROW(d_solver.getValue(t), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, getValue3)
ASSERT_NO_THROW(d_solver.getValue(p_f_y));
Solver slv;
- ASSERT_THROW(slv.getValue(x), CVC4ApiException);
+ ASSERT_THROW(slv.getValue(x), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, getQuantifierElimination)
d_solver.mkTerm(FORALL,
d_solver.mkTerm(BOUND_VAR_LIST, x),
d_solver.mkTerm(OR, x, d_solver.mkTerm(NOT, x)));
- ASSERT_THROW(d_solver.getQuantifierElimination(Term()), CVC4ApiException);
+ ASSERT_THROW(d_solver.getQuantifierElimination(Term()), CVC5ApiException);
ASSERT_THROW(d_solver.getQuantifierElimination(Solver().mkBoolean(false)),
- CVC4ApiException);
+ CVC5ApiException);
ASSERT_NO_THROW(d_solver.getQuantifierElimination(forall));
}
d_solver.mkTerm(BOUND_VAR_LIST, x),
d_solver.mkTerm(OR, x, d_solver.mkTerm(NOT, x)));
ASSERT_THROW(d_solver.getQuantifierEliminationDisjunct(Term()),
- CVC4ApiException);
+ CVC5ApiException);
ASSERT_THROW(
d_solver.getQuantifierEliminationDisjunct(Solver().mkBoolean(false)),
- CVC4ApiException);
+ CVC5ApiException);
ASSERT_NO_THROW(d_solver.getQuantifierEliminationDisjunct(forall));
}
ASSERT_NO_THROW(d_solver.declareSeparationHeap(integer, integer));
// cannot declare separation logic heap more than once
ASSERT_THROW(d_solver.declareSeparationHeap(integer, integer),
- CVC4ApiException);
+ CVC5ApiException);
}
namespace {
d_solver.setOption("produce-models", "true");
Term t = d_solver.mkTrue();
d_solver.assertFormula(t);
- ASSERT_THROW(d_solver.getSeparationHeap(), CVC4ApiException);
+ ASSERT_THROW(d_solver.getSeparationHeap(), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, getSeparationHeapTerm2)
d_solver.setOption("incremental", "false");
d_solver.setOption("produce-models", "false");
checkSimpleSeparationConstraints(&d_solver);
- ASSERT_THROW(d_solver.getSeparationHeap(), CVC4ApiException);
+ ASSERT_THROW(d_solver.getSeparationHeap(), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, getSeparationHeapTerm3)
Term t = d_solver.mkFalse();
d_solver.assertFormula(t);
d_solver.checkSat();
- ASSERT_THROW(d_solver.getSeparationHeap(), CVC4ApiException);
+ ASSERT_THROW(d_solver.getSeparationHeap(), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, getSeparationHeapTerm4)
Term t = d_solver.mkTrue();
d_solver.assertFormula(t);
d_solver.checkSat();
- ASSERT_THROW(d_solver.getSeparationHeap(), CVC4ApiException);
+ ASSERT_THROW(d_solver.getSeparationHeap(), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, getSeparationHeapTerm5)
d_solver.setOption("produce-models", "true");
Term t = d_solver.mkTrue();
d_solver.assertFormula(t);
- ASSERT_THROW(d_solver.getSeparationNilTerm(), CVC4ApiException);
+ ASSERT_THROW(d_solver.getSeparationNilTerm(), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, getSeparationNilTerm2)
d_solver.setOption("incremental", "false");
d_solver.setOption("produce-models", "false");
checkSimpleSeparationConstraints(&d_solver);
- ASSERT_THROW(d_solver.getSeparationNilTerm(), CVC4ApiException);
+ ASSERT_THROW(d_solver.getSeparationNilTerm(), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, getSeparationNilTerm3)
Term t = d_solver.mkFalse();
d_solver.assertFormula(t);
d_solver.checkSat();
- ASSERT_THROW(d_solver.getSeparationNilTerm(), CVC4ApiException);
+ ASSERT_THROW(d_solver.getSeparationNilTerm(), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, getSeparationNilTerm4)
Term t = d_solver.mkTrue();
d_solver.assertFormula(t);
d_solver.checkSat();
- ASSERT_THROW(d_solver.getSeparationNilTerm(), CVC4ApiException);
+ ASSERT_THROW(d_solver.getSeparationNilTerm(), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, getSeparationNilTerm5)
{
d_solver.setOption("incremental", "true");
ASSERT_NO_THROW(d_solver.push(1));
- ASSERT_THROW(d_solver.setOption("incremental", "false"), CVC4ApiException);
- ASSERT_THROW(d_solver.setOption("incremental", "true"), CVC4ApiException);
+ ASSERT_THROW(d_solver.setOption("incremental", "false"), CVC5ApiException);
+ ASSERT_THROW(d_solver.setOption("incremental", "true"), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, push2)
{
d_solver.setOption("incremental", "false");
- ASSERT_THROW(d_solver.push(1), CVC4ApiException);
+ ASSERT_THROW(d_solver.push(1), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, pop1)
{
d_solver.setOption("incremental", "false");
- ASSERT_THROW(d_solver.pop(1), CVC4ApiException);
+ ASSERT_THROW(d_solver.pop(1), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, pop2)
{
d_solver.setOption("incremental", "true");
- ASSERT_THROW(d_solver.pop(1), CVC4ApiException);
+ ASSERT_THROW(d_solver.pop(1), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, pop3)
d_solver.setOption("incremental", "true");
ASSERT_NO_THROW(d_solver.push(1));
ASSERT_NO_THROW(d_solver.pop(1));
- ASSERT_THROW(d_solver.pop(1), CVC4ApiException);
+ ASSERT_THROW(d_solver.pop(1), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, blockModel1)
Term x = d_solver.mkConst(d_solver.getBooleanSort(), "x");
d_solver.assertFormula(x.eqTerm(x));
d_solver.checkSat();
- ASSERT_THROW(d_solver.blockModel(), CVC4ApiException);
+ ASSERT_THROW(d_solver.blockModel(), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, blockModel2)
Term x = d_solver.mkConst(d_solver.getBooleanSort(), "x");
d_solver.assertFormula(x.eqTerm(x));
d_solver.checkSat();
- ASSERT_THROW(d_solver.blockModel(), CVC4ApiException);
+ ASSERT_THROW(d_solver.blockModel(), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, blockModel3)
d_solver.setOption("block-models", "literals");
Term x = d_solver.mkConst(d_solver.getBooleanSort(), "x");
d_solver.assertFormula(x.eqTerm(x));
- ASSERT_THROW(d_solver.blockModel(), CVC4ApiException);
+ ASSERT_THROW(d_solver.blockModel(), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, blockModel4)
Term x = d_solver.mkConst(d_solver.getBooleanSort(), "x");
d_solver.assertFormula(x.eqTerm(x));
d_solver.checkSat();
- ASSERT_THROW(d_solver.blockModelValues({}), CVC4ApiException);
- ASSERT_THROW(d_solver.blockModelValues({Term()}), CVC4ApiException);
+ ASSERT_THROW(d_solver.blockModelValues({}), CVC5ApiException);
+ ASSERT_THROW(d_solver.blockModelValues({Term()}), CVC5ApiException);
ASSERT_THROW(d_solver.blockModelValues({Solver().mkBoolean(false)}),
- CVC4ApiException);
+ CVC5ApiException);
}
TEST_F(TestApiBlackSolver, blockModelValues2)
Term x = d_solver.mkConst(d_solver.getBooleanSort(), "x");
d_solver.assertFormula(x.eqTerm(x));
d_solver.checkSat();
- ASSERT_THROW(d_solver.blockModelValues({x}), CVC4ApiException);
+ ASSERT_THROW(d_solver.blockModelValues({x}), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, blockModelValues3)
Term x = d_solver.mkConst(d_solver.getBooleanSort(), "x");
d_solver.assertFormula(x.eqTerm(x));
d_solver.checkSat();
- ASSERT_THROW(d_solver.blockModelValues({x}), CVC4ApiException);
+ ASSERT_THROW(d_solver.blockModelValues({x}), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, blockModelValues4)
d_solver.setOption("block-models", "literals");
Term x = d_solver.mkConst(d_solver.getBooleanSort(), "x");
d_solver.assertFormula(x.eqTerm(x));
- ASSERT_THROW(d_solver.blockModelValues({x}), CVC4ApiException);
+ ASSERT_THROW(d_solver.blockModelValues({x}), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, blockModelValues5)
TEST_F(TestApiBlackSolver, setInfo)
{
- ASSERT_THROW(d_solver.setInfo("cvc4-lagic", "QF_BV"), CVC4ApiException);
- ASSERT_THROW(d_solver.setInfo("cvc2-logic", "QF_BV"), CVC4ApiException);
- ASSERT_THROW(d_solver.setInfo("cvc4-logic", "asdf"), CVC4ApiException);
+ ASSERT_THROW(d_solver.setInfo("cvc4-lagic", "QF_BV"), CVC5ApiException);
+ ASSERT_THROW(d_solver.setInfo("cvc2-logic", "QF_BV"), CVC5ApiException);
+ ASSERT_THROW(d_solver.setInfo("cvc4-logic", "asdf"), CVC5ApiException);
ASSERT_NO_THROW(d_solver.setInfo("source", "asdf"));
ASSERT_NO_THROW(d_solver.setInfo("category", "asdf"));
ASSERT_NO_THROW(d_solver.setInfo("smt-lib-version", "2.0"));
ASSERT_NO_THROW(d_solver.setInfo("smt-lib-version", "2.5"));
ASSERT_NO_THROW(d_solver.setInfo("smt-lib-version", "2.6"));
- ASSERT_THROW(d_solver.setInfo("smt-lib-version", ".0"), CVC4ApiException);
+ ASSERT_THROW(d_solver.setInfo("smt-lib-version", ".0"), CVC5ApiException);
ASSERT_NO_THROW(d_solver.setInfo("status", "sat"));
ASSERT_NO_THROW(d_solver.setInfo("status", "unsat"));
ASSERT_NO_THROW(d_solver.setInfo("status", "unknown"));
- ASSERT_THROW(d_solver.setInfo("status", "asdf"), CVC4ApiException);
+ ASSERT_THROW(d_solver.setInfo("status", "asdf"), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, simplify)
{
- ASSERT_THROW(d_solver.simplify(Term()), CVC4ApiException);
+ ASSERT_THROW(d_solver.simplify(Term()), CVC5ApiException);
Sort bvSort = d_solver.mkBitVectorSort(32);
Sort uSort = d_solver.mkUninterpretedSort("u");
ASSERT_NE(d_solver.mkTrue(), x_eq_b);
ASSERT_NE(d_solver.mkTrue(), d_solver.simplify(x_eq_b));
Solver slv;
- ASSERT_THROW(slv.simplify(x), CVC4ApiException);
+ ASSERT_THROW(slv.simplify(x), CVC5ApiException);
Term i1 = d_solver.mkConst(d_solver.getIntegerSort(), "i1");
ASSERT_NO_THROW(d_solver.simplify(i1));
TEST_F(TestApiBlackSolver, assertFormula)
{
ASSERT_NO_THROW(d_solver.assertFormula(d_solver.mkTrue()));
- ASSERT_THROW(d_solver.assertFormula(Term()), CVC4ApiException);
+ ASSERT_THROW(d_solver.assertFormula(Term()), CVC5ApiException);
Solver slv;
- ASSERT_THROW(slv.assertFormula(d_solver.mkTrue()), CVC4ApiException);
+ ASSERT_THROW(slv.assertFormula(d_solver.mkTrue()), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, checkEntailed)
{
d_solver.setOption("incremental", "false");
ASSERT_NO_THROW(d_solver.checkEntailed(d_solver.mkTrue()));
- ASSERT_THROW(d_solver.checkEntailed(d_solver.mkTrue()), CVC4ApiException);
+ ASSERT_THROW(d_solver.checkEntailed(d_solver.mkTrue()), CVC5ApiException);
Solver slv;
- ASSERT_THROW(slv.checkEntailed(d_solver.mkTrue()), CVC4ApiException);
+ ASSERT_THROW(slv.checkEntailed(d_solver.mkTrue()), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, checkEntailed1)
Term z = d_solver.mkTerm(AND, x, y);
d_solver.setOption("incremental", "true");
ASSERT_NO_THROW(d_solver.checkEntailed(d_solver.mkTrue()));
- ASSERT_THROW(d_solver.checkEntailed(Term()), CVC4ApiException);
+ ASSERT_THROW(d_solver.checkEntailed(Term()), CVC5ApiException);
ASSERT_NO_THROW(d_solver.checkEntailed(d_solver.mkTrue()));
ASSERT_NO_THROW(d_solver.checkEntailed(z));
Solver slv;
- ASSERT_THROW(slv.checkEntailed(d_solver.mkTrue()), CVC4ApiException);
+ ASSERT_THROW(slv.checkEntailed(d_solver.mkTrue()), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, checkEntailed2)
ASSERT_NO_THROW(d_solver.checkEntailed(d_solver.mkTerm(DISTINCT, x, y)));
ASSERT_NO_THROW(d_solver.checkEntailed(
{d_solver.mkFalse(), d_solver.mkTerm(DISTINCT, x, y)}));
- ASSERT_THROW(d_solver.checkEntailed(n), CVC4ApiException);
+ ASSERT_THROW(d_solver.checkEntailed(n), CVC5ApiException);
ASSERT_THROW(d_solver.checkEntailed({n, d_solver.mkTerm(DISTINCT, x, y)}),
- CVC4ApiException);
+ CVC5ApiException);
Solver slv;
- ASSERT_THROW(slv.checkEntailed(d_solver.mkTrue()), CVC4ApiException);
+ ASSERT_THROW(slv.checkEntailed(d_solver.mkTrue()), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, checkSat)
{
d_solver.setOption("incremental", "false");
ASSERT_NO_THROW(d_solver.checkSat());
- ASSERT_THROW(d_solver.checkSat(), CVC4ApiException);
+ ASSERT_THROW(d_solver.checkSat(), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, checkSatAssuming)
{
d_solver.setOption("incremental", "false");
ASSERT_NO_THROW(d_solver.checkSatAssuming(d_solver.mkTrue()));
- ASSERT_THROW(d_solver.checkSatAssuming(d_solver.mkTrue()), CVC4ApiException);
+ ASSERT_THROW(d_solver.checkSatAssuming(d_solver.mkTrue()), CVC5ApiException);
Solver slv;
- ASSERT_THROW(slv.checkSatAssuming(d_solver.mkTrue()), CVC4ApiException);
+ ASSERT_THROW(slv.checkSatAssuming(d_solver.mkTrue()), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, checkSatAssuming1)
Term z = d_solver.mkTerm(AND, x, y);
d_solver.setOption("incremental", "true");
ASSERT_NO_THROW(d_solver.checkSatAssuming(d_solver.mkTrue()));
- ASSERT_THROW(d_solver.checkSatAssuming(Term()), CVC4ApiException);
+ ASSERT_THROW(d_solver.checkSatAssuming(Term()), CVC5ApiException);
ASSERT_NO_THROW(d_solver.checkSatAssuming(d_solver.mkTrue()));
ASSERT_NO_THROW(d_solver.checkSatAssuming(z));
Solver slv;
- ASSERT_THROW(slv.checkSatAssuming(d_solver.mkTrue()), CVC4ApiException);
+ ASSERT_THROW(slv.checkSatAssuming(d_solver.mkTrue()), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, checkSatAssuming2)
ASSERT_NO_THROW(d_solver.checkSatAssuming(d_solver.mkTerm(DISTINCT, x, y)));
ASSERT_NO_THROW(d_solver.checkSatAssuming(
{d_solver.mkFalse(), d_solver.mkTerm(DISTINCT, x, y)}));
- ASSERT_THROW(d_solver.checkSatAssuming(n), CVC4ApiException);
+ ASSERT_THROW(d_solver.checkSatAssuming(n), CVC5ApiException);
ASSERT_THROW(d_solver.checkSatAssuming({n, d_solver.mkTerm(DISTINCT, x, y)}),
- CVC4ApiException);
+ CVC5ApiException);
Solver slv;
- ASSERT_THROW(slv.checkSatAssuming(d_solver.mkTrue()), CVC4ApiException);
+ ASSERT_THROW(slv.checkSatAssuming(d_solver.mkTrue()), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, setLogic)
{
ASSERT_NO_THROW(d_solver.setLogic("AUFLIRA"));
- ASSERT_THROW(d_solver.setLogic("AF_BV"), CVC4ApiException);
+ ASSERT_THROW(d_solver.setLogic("AF_BV"), CVC5ApiException);
d_solver.assertFormula(d_solver.mkTrue());
- ASSERT_THROW(d_solver.setLogic("AUFLIRA"), CVC4ApiException);
+ ASSERT_THROW(d_solver.setLogic("AUFLIRA"), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, setOption)
{
ASSERT_NO_THROW(d_solver.setOption("bv-sat-solver", "minisat"));
- ASSERT_THROW(d_solver.setOption("bv-sat-solver", "1"), CVC4ApiException);
+ ASSERT_THROW(d_solver.setOption("bv-sat-solver", "1"), CVC5ApiException);
d_solver.assertFormula(d_solver.mkTrue());
ASSERT_THROW(d_solver.setOption("bv-sat-solver", "minisat"),
- CVC4ApiException);
+ CVC5ApiException);
}
TEST_F(TestApiBlackSolver, resetAssertions)
ASSERT_NO_THROW(d_solver.mkSygusVar(funSort));
ASSERT_NO_THROW(d_solver.mkSygusVar(boolSort, std::string("b")));
ASSERT_NO_THROW(d_solver.mkSygusVar(funSort, ""));
- ASSERT_THROW(d_solver.mkSygusVar(Sort()), CVC4ApiException);
+ ASSERT_THROW(d_solver.mkSygusVar(Sort()), CVC5ApiException);
ASSERT_THROW(d_solver.mkSygusVar(d_solver.getNullSort(), "a"),
- CVC4ApiException);
+ CVC5ApiException);
Solver slv;
- ASSERT_THROW(slv.mkSygusVar(boolSort), CVC4ApiException);
+ ASSERT_THROW(slv.mkSygusVar(boolSort), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, mkSygusGrammar)
ASSERT_NO_THROW(d_solver.mkSygusGrammar({}, {intVar}));
ASSERT_NO_THROW(d_solver.mkSygusGrammar({boolVar}, {intVar}));
- ASSERT_THROW(d_solver.mkSygusGrammar({}, {}), CVC4ApiException);
- ASSERT_THROW(d_solver.mkSygusGrammar({}, {nullTerm}), CVC4ApiException);
- ASSERT_THROW(d_solver.mkSygusGrammar({}, {boolTerm}), CVC4ApiException);
- ASSERT_THROW(d_solver.mkSygusGrammar({boolTerm}, {intVar}), CVC4ApiException);
+ ASSERT_THROW(d_solver.mkSygusGrammar({}, {}), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkSygusGrammar({}, {nullTerm}), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkSygusGrammar({}, {boolTerm}), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkSygusGrammar({boolTerm}, {intVar}), CVC5ApiException);
Solver slv;
Term boolVar2 = slv.mkVar(slv.getBooleanSort());
Term intVar2 = slv.mkVar(slv.getIntegerSort());
ASSERT_NO_THROW(slv.mkSygusGrammar({boolVar2}, {intVar2}));
- ASSERT_THROW(slv.mkSygusGrammar({boolVar}, {intVar2}), CVC4ApiException);
- ASSERT_THROW(slv.mkSygusGrammar({boolVar2}, {intVar}), CVC4ApiException);
+ ASSERT_THROW(slv.mkSygusGrammar({boolVar}, {intVar2}), CVC5ApiException);
+ ASSERT_THROW(slv.mkSygusGrammar({boolVar2}, {intVar}), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, synthFun)
ASSERT_NO_THROW(d_solver.synthFun("f1", {x}, boolean));
ASSERT_NO_THROW(d_solver.synthFun("f2", {x}, boolean, g1));
- ASSERT_THROW(d_solver.synthFun("f3", {nullTerm}, boolean), CVC4ApiException);
- ASSERT_THROW(d_solver.synthFun("f4", {}, null), CVC4ApiException);
- ASSERT_THROW(d_solver.synthFun("f6", {x}, boolean, g2), CVC4ApiException);
+ ASSERT_THROW(d_solver.synthFun("f3", {nullTerm}, boolean), CVC5ApiException);
+ ASSERT_THROW(d_solver.synthFun("f4", {}, null), CVC5ApiException);
+ ASSERT_THROW(d_solver.synthFun("f6", {x}, boolean, g2), CVC5ApiException);
Solver slv;
Term x2 = slv.mkVar(slv.getBooleanSort());
ASSERT_NO_THROW(slv.synthFun("f1", {x2}, slv.getBooleanSort()));
ASSERT_THROW(slv.synthFun("", {}, d_solver.getBooleanSort()),
- CVC4ApiException);
+ CVC5ApiException);
ASSERT_THROW(slv.synthFun("f1", {x}, d_solver.getBooleanSort()),
- CVC4ApiException);
+ CVC5ApiException);
}
TEST_F(TestApiBlackSolver, synthInv)
ASSERT_NO_THROW(d_solver.synthInv("i1", {x}));
ASSERT_NO_THROW(d_solver.synthInv("i2", {x}, g1));
- ASSERT_THROW(d_solver.synthInv("i3", {nullTerm}), CVC4ApiException);
- ASSERT_THROW(d_solver.synthInv("i4", {x}, g2), CVC4ApiException);
+ ASSERT_THROW(d_solver.synthInv("i3", {nullTerm}), CVC5ApiException);
+ ASSERT_THROW(d_solver.synthInv("i4", {x}, g2), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, addSygusConstraint)
Term intTerm = d_solver.mkInteger(1);
ASSERT_NO_THROW(d_solver.addSygusConstraint(boolTerm));
- ASSERT_THROW(d_solver.addSygusConstraint(nullTerm), CVC4ApiException);
- ASSERT_THROW(d_solver.addSygusConstraint(intTerm), CVC4ApiException);
+ ASSERT_THROW(d_solver.addSygusConstraint(nullTerm), CVC5ApiException);
+ ASSERT_THROW(d_solver.addSygusConstraint(intTerm), CVC5ApiException);
Solver slv;
- ASSERT_THROW(slv.addSygusConstraint(boolTerm), CVC4ApiException);
+ ASSERT_THROW(slv.addSygusConstraint(boolTerm), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, addSygusInvConstraint)
ASSERT_NO_THROW(d_solver.addSygusInvConstraint(inv, pre, trans, post));
ASSERT_THROW(d_solver.addSygusInvConstraint(nullTerm, pre, trans, post),
- CVC4ApiException);
+ CVC5ApiException);
ASSERT_THROW(d_solver.addSygusInvConstraint(inv, nullTerm, trans, post),
- CVC4ApiException);
+ CVC5ApiException);
ASSERT_THROW(d_solver.addSygusInvConstraint(inv, pre, nullTerm, post),
- CVC4ApiException);
+ CVC5ApiException);
ASSERT_THROW(d_solver.addSygusInvConstraint(inv, pre, trans, nullTerm),
- CVC4ApiException);
+ CVC5ApiException);
ASSERT_THROW(d_solver.addSygusInvConstraint(intTerm, pre, trans, post),
- CVC4ApiException);
+ CVC5ApiException);
ASSERT_THROW(d_solver.addSygusInvConstraint(inv1, pre, trans, post),
- CVC4ApiException);
+ CVC5ApiException);
ASSERT_THROW(d_solver.addSygusInvConstraint(inv, trans, trans, post),
- CVC4ApiException);
+ CVC5ApiException);
ASSERT_THROW(d_solver.addSygusInvConstraint(inv, pre, intTerm, post),
- CVC4ApiException);
+ CVC5ApiException);
ASSERT_THROW(d_solver.addSygusInvConstraint(inv, pre, pre, post),
- CVC4ApiException);
+ CVC5ApiException);
ASSERT_THROW(d_solver.addSygusInvConstraint(inv, pre, trans1, post),
- CVC4ApiException);
+ CVC5ApiException);
ASSERT_THROW(d_solver.addSygusInvConstraint(inv, pre, trans2, post),
- CVC4ApiException);
+ CVC5ApiException);
ASSERT_THROW(d_solver.addSygusInvConstraint(inv, pre, trans3, post),
- CVC4ApiException);
+ CVC5ApiException);
ASSERT_THROW(d_solver.addSygusInvConstraint(inv, pre, trans, trans),
- CVC4ApiException);
+ CVC5ApiException);
Solver slv;
Sort boolean2 = slv.getBooleanSort();
Sort real2 = slv.getRealSort();
Term post22 = slv.declareFun("post", {real2}, boolean2);
ASSERT_NO_THROW(slv.addSygusInvConstraint(inv22, pre22, trans22, post22));
ASSERT_THROW(slv.addSygusInvConstraint(inv, pre22, trans22, post22),
- CVC4ApiException);
+ CVC5ApiException);
ASSERT_THROW(slv.addSygusInvConstraint(inv22, pre, trans22, post22),
- CVC4ApiException);
+ CVC5ApiException);
ASSERT_THROW(slv.addSygusInvConstraint(inv22, pre22, trans, post22),
- CVC4ApiException);
+ CVC5ApiException);
ASSERT_THROW(slv.addSygusInvConstraint(inv22, pre22, trans22, post),
- CVC4ApiException);
+ CVC5ApiException);
}
TEST_F(TestApiBlackSolver, getSynthSolution)
Term x = d_solver.mkBoolean(false);
Term f = d_solver.synthFun("f", {}, d_solver.getBooleanSort());
- ASSERT_THROW(d_solver.getSynthSolution(f), CVC4ApiException);
+ ASSERT_THROW(d_solver.getSynthSolution(f), CVC5ApiException);
d_solver.checkSynth();
ASSERT_NO_THROW(d_solver.getSynthSolution(f));
ASSERT_NO_THROW(d_solver.getSynthSolution(f));
- ASSERT_THROW(d_solver.getSynthSolution(nullTerm), CVC4ApiException);
- ASSERT_THROW(d_solver.getSynthSolution(x), CVC4ApiException);
+ ASSERT_THROW(d_solver.getSynthSolution(nullTerm), CVC5ApiException);
+ ASSERT_THROW(d_solver.getSynthSolution(x), CVC5ApiException);
Solver slv;
- ASSERT_THROW(slv.getSynthSolution(f), CVC4ApiException);
+ ASSERT_THROW(slv.getSynthSolution(f), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, getSynthSolutions)
Term x = d_solver.mkBoolean(false);
Term f = d_solver.synthFun("f", {}, d_solver.getBooleanSort());
- ASSERT_THROW(d_solver.getSynthSolutions({}), CVC4ApiException);
- ASSERT_THROW(d_solver.getSynthSolutions({f}), CVC4ApiException);
+ ASSERT_THROW(d_solver.getSynthSolutions({}), CVC5ApiException);
+ ASSERT_THROW(d_solver.getSynthSolutions({f}), CVC5ApiException);
d_solver.checkSynth();
ASSERT_NO_THROW(d_solver.getSynthSolutions({f}));
ASSERT_NO_THROW(d_solver.getSynthSolutions({f, f}));
- ASSERT_THROW(d_solver.getSynthSolutions({}), CVC4ApiException);
- ASSERT_THROW(d_solver.getSynthSolutions({nullTerm}), CVC4ApiException);
- ASSERT_THROW(d_solver.getSynthSolutions({x}), CVC4ApiException);
+ ASSERT_THROW(d_solver.getSynthSolutions({}), CVC5ApiException);
+ ASSERT_THROW(d_solver.getSynthSolutions({nullTerm}), CVC5ApiException);
+ ASSERT_THROW(d_solver.getSynthSolutions({x}), CVC5ApiException);
Solver slv;
- ASSERT_THROW(slv.getSynthSolutions({x}), CVC4ApiException);
+ ASSERT_THROW(slv.getSynthSolutions({x}), CVC5ApiException);
}
TEST_F(TestApiBlackSolver, tupleProject)
d_solver.mkTerm(d_solver.mkOp(TUPLE_PROJECT, indices4), tuple));
ASSERT_THROW(d_solver.mkTerm(d_solver.mkOp(TUPLE_PROJECT, indices5), tuple),
- CVC4ApiException);
+ CVC5ApiException);
ASSERT_THROW(d_solver.mkTerm(d_solver.mkOp(TUPLE_PROJECT, indices6), tuple),
- CVC4ApiException);
+ CVC5ApiException);
std::vector<uint32_t> indices = {0, 3, 2, 0, 1, 2};
ASSERT_NO_THROW(dtypeSort.getDatatype());
// create bv sort, check should fail
Sort bvSort = d_solver.mkBitVectorSort(32);
- ASSERT_THROW(bvSort.getDatatype(), CVC4ApiException);
+ ASSERT_THROW(bvSort.getDatatype(), CVC5ApiException);
}
TEST_F(TestApiBlackSort, datatypeSorts)
Sort dtypeSort = create_datatype_sort();
Datatype dt = dtypeSort.getDatatype();
ASSERT_FALSE(dtypeSort.isConstructor());
- ASSERT_THROW(dtypeSort.getConstructorCodomainSort(), CVC4ApiException);
- ASSERT_THROW(dtypeSort.getConstructorDomainSorts(), CVC4ApiException);
- ASSERT_THROW(dtypeSort.getConstructorArity(), CVC4ApiException);
+ ASSERT_THROW(dtypeSort.getConstructorCodomainSort(), CVC5ApiException);
+ ASSERT_THROW(dtypeSort.getConstructorDomainSorts(), CVC5ApiException);
+ ASSERT_THROW(dtypeSort.getConstructorArity(), CVC5ApiException);
// get constructor
DatatypeConstructor dcons = dt[0];
ASSERT_EQ(isConsTerm.getSort().getTesterDomainSort(), dtypeSort);
Sort booleanSort = d_solver.getBooleanSort();
ASSERT_EQ(isConsTerm.getSort().getTesterCodomainSort(), booleanSort);
- ASSERT_THROW(booleanSort.getTesterDomainSort(), CVC4ApiException);
- ASSERT_THROW(booleanSort.getTesterCodomainSort(), CVC4ApiException);
+ ASSERT_THROW(booleanSort.getTesterDomainSort(), CVC5ApiException);
+ ASSERT_THROW(booleanSort.getTesterCodomainSort(), CVC5ApiException);
// get selector
DatatypeSelector dselTail = dcons[1];
ASSERT_TRUE(tailTerm.getSort().isSelector());
ASSERT_EQ(tailTerm.getSort().getSelectorDomainSort(), dtypeSort);
ASSERT_EQ(tailTerm.getSort().getSelectorCodomainSort(), dtypeSort);
- ASSERT_THROW(booleanSort.getSelectorDomainSort(), CVC4ApiException);
- ASSERT_THROW(booleanSort.getSelectorCodomainSort(), CVC4ApiException);
+ ASSERT_THROW(booleanSort.getSelectorDomainSort(), CVC5ApiException);
+ ASSERT_THROW(booleanSort.getSelectorCodomainSort(), CVC5ApiException);
}
TEST_F(TestApiBlackSort, instantiate)
Sort dtypeSort = d_solver.mkDatatypeSort(dtypeSpec);
ASSERT_THROW(
dtypeSort.instantiate(std::vector<Sort>{d_solver.getIntegerSort()}),
- CVC4ApiException);
+ CVC5ApiException);
}
TEST_F(TestApiBlackSort, getFunctionArity)
d_solver.getIntegerSort());
ASSERT_NO_THROW(funSort.getFunctionArity());
Sort bvSort = d_solver.mkBitVectorSort(32);
- ASSERT_THROW(bvSort.getFunctionArity(), CVC4ApiException);
+ ASSERT_THROW(bvSort.getFunctionArity(), CVC5ApiException);
}
TEST_F(TestApiBlackSort, getFunctionDomainSorts)
d_solver.getIntegerSort());
ASSERT_NO_THROW(funSort.getFunctionDomainSorts());
Sort bvSort = d_solver.mkBitVectorSort(32);
- ASSERT_THROW(bvSort.getFunctionDomainSorts(), CVC4ApiException);
+ ASSERT_THROW(bvSort.getFunctionDomainSorts(), CVC5ApiException);
}
TEST_F(TestApiBlackSort, getFunctionCodomainSort)
d_solver.getIntegerSort());
ASSERT_NO_THROW(funSort.getFunctionCodomainSort());
Sort bvSort = d_solver.mkBitVectorSort(32);
- ASSERT_THROW(bvSort.getFunctionCodomainSort(), CVC4ApiException);
+ ASSERT_THROW(bvSort.getFunctionCodomainSort(), CVC5ApiException);
}
TEST_F(TestApiBlackSort, getArrayIndexSort)
Sort indexSort = d_solver.mkBitVectorSort(32);
Sort arraySort = d_solver.mkArraySort(indexSort, elementSort);
ASSERT_NO_THROW(arraySort.getArrayIndexSort());
- ASSERT_THROW(indexSort.getArrayIndexSort(), CVC4ApiException);
+ ASSERT_THROW(indexSort.getArrayIndexSort(), CVC5ApiException);
}
TEST_F(TestApiBlackSort, getArrayElementSort)
Sort indexSort = d_solver.mkBitVectorSort(32);
Sort arraySort = d_solver.mkArraySort(indexSort, elementSort);
ASSERT_NO_THROW(arraySort.getArrayElementSort());
- ASSERT_THROW(indexSort.getArrayElementSort(), CVC4ApiException);
+ ASSERT_THROW(indexSort.getArrayElementSort(), CVC5ApiException);
}
TEST_F(TestApiBlackSort, getSetElementSort)
Sort elementSort = setSort.getSetElementSort();
ASSERT_EQ(elementSort, d_solver.getIntegerSort());
Sort bvSort = d_solver.mkBitVectorSort(32);
- ASSERT_THROW(bvSort.getSetElementSort(), CVC4ApiException);
+ ASSERT_THROW(bvSort.getSetElementSort(), CVC5ApiException);
}
TEST_F(TestApiBlackSort, getBagElementSort)
Sort elementSort = bagSort.getBagElementSort();
ASSERT_EQ(elementSort, d_solver.getIntegerSort());
Sort bvSort = d_solver.mkBitVectorSort(32);
- ASSERT_THROW(bvSort.getBagElementSort(), CVC4ApiException);
+ ASSERT_THROW(bvSort.getBagElementSort(), CVC5ApiException);
}
TEST_F(TestApiBlackSort, getSequenceElementSort)
ASSERT_NO_THROW(seqSort.getSequenceElementSort());
Sort bvSort = d_solver.mkBitVectorSort(32);
ASSERT_FALSE(bvSort.isSequence());
- ASSERT_THROW(bvSort.getSequenceElementSort(), CVC4ApiException);
+ ASSERT_THROW(bvSort.getSequenceElementSort(), CVC5ApiException);
}
TEST_F(TestApiBlackSort, getUninterpretedSortName)
Sort uSort = d_solver.mkUninterpretedSort("u");
ASSERT_NO_THROW(uSort.getUninterpretedSortName());
Sort bvSort = d_solver.mkBitVectorSort(32);
- ASSERT_THROW(bvSort.getUninterpretedSortName(), CVC4ApiException);
+ ASSERT_THROW(bvSort.getUninterpretedSortName(), CVC5ApiException);
}
TEST_F(TestApiBlackSort, isUninterpretedSortParameterized)
Sort siSort = sSort.instantiate({uSort});
ASSERT_TRUE(siSort.isUninterpretedSortParameterized());
Sort bvSort = d_solver.mkBitVectorSort(32);
- ASSERT_THROW(bvSort.isUninterpretedSortParameterized(), CVC4ApiException);
+ ASSERT_THROW(bvSort.isUninterpretedSortParameterized(), CVC5ApiException);
}
TEST_F(TestApiBlackSort, getUninterpretedSortParamSorts)
Sort siSort = sSort.instantiate({uSort, uSort});
ASSERT_EQ(siSort.getUninterpretedSortParamSorts().size(), 2);
Sort bvSort = d_solver.mkBitVectorSort(32);
- ASSERT_THROW(bvSort.getUninterpretedSortParamSorts(), CVC4ApiException);
+ ASSERT_THROW(bvSort.getUninterpretedSortParamSorts(), CVC5ApiException);
}
TEST_F(TestApiBlackSort, getUninterpretedSortConstructorName)
Sort sSort = d_solver.mkSortConstructorSort("s", 2);
ASSERT_NO_THROW(sSort.getSortConstructorName());
Sort bvSort = d_solver.mkBitVectorSort(32);
- ASSERT_THROW(bvSort.getSortConstructorName(), CVC4ApiException);
+ ASSERT_THROW(bvSort.getSortConstructorName(), CVC5ApiException);
}
TEST_F(TestApiBlackSort, getUninterpretedSortConstructorArity)
Sort sSort = d_solver.mkSortConstructorSort("s", 2);
ASSERT_NO_THROW(sSort.getSortConstructorArity());
Sort bvSort = d_solver.mkBitVectorSort(32);
- ASSERT_THROW(bvSort.getSortConstructorArity(), CVC4ApiException);
+ ASSERT_THROW(bvSort.getSortConstructorArity(), CVC5ApiException);
}
TEST_F(TestApiBlackSort, getBVSize)
Sort bvSort = d_solver.mkBitVectorSort(32);
ASSERT_NO_THROW(bvSort.getBVSize());
Sort setSort = d_solver.mkSetSort(d_solver.getIntegerSort());
- ASSERT_THROW(setSort.getBVSize(), CVC4ApiException);
+ ASSERT_THROW(setSort.getBVSize(), CVC5ApiException);
}
TEST_F(TestApiBlackSort, getFPExponentSize)
Sort fpSort = d_solver.mkFloatingPointSort(4, 8);
ASSERT_NO_THROW(fpSort.getFPExponentSize());
Sort setSort = d_solver.mkSetSort(d_solver.getIntegerSort());
- ASSERT_THROW(setSort.getFPExponentSize(), CVC4ApiException);
+ ASSERT_THROW(setSort.getFPExponentSize(), CVC5ApiException);
}
}
Sort fpSort = d_solver.mkFloatingPointSort(4, 8);
ASSERT_NO_THROW(fpSort.getFPSignificandSize());
Sort setSort = d_solver.mkSetSort(d_solver.getIntegerSort());
- ASSERT_THROW(setSort.getFPSignificandSize(), CVC4ApiException);
+ ASSERT_THROW(setSort.getFPSignificandSize(), CVC5ApiException);
}
}
DatatypeConstructorDecl nil = d_solver.mkDatatypeConstructorDecl("nil");
dtypeSpec.addConstructor(nil);
Sort dtypeSort = d_solver.mkDatatypeSort(dtypeSpec);
- ASSERT_THROW(dtypeSort.getDatatypeParamSorts(), CVC4ApiException);
+ ASSERT_THROW(dtypeSort.getDatatypeParamSorts(), CVC5ApiException);
}
TEST_F(TestApiBlackSort, getDatatypeArity)
ASSERT_NO_THROW(dtypeSort.getDatatypeArity());
// create bv sort, check should fail
Sort bvSort = d_solver.mkBitVectorSort(32);
- ASSERT_THROW(bvSort.getDatatypeArity(), CVC4ApiException);
+ ASSERT_THROW(bvSort.getDatatypeArity(), CVC5ApiException);
}
TEST_F(TestApiBlackSort, getTupleLength)
{d_solver.getIntegerSort(), d_solver.getIntegerSort()});
ASSERT_NO_THROW(tupleSort.getTupleLength());
Sort bvSort = d_solver.mkBitVectorSort(32);
- ASSERT_THROW(bvSort.getTupleLength(), CVC4ApiException);
+ ASSERT_THROW(bvSort.getTupleLength(), CVC5ApiException);
}
TEST_F(TestApiBlackSort, getTupleSorts)
{d_solver.getIntegerSort(), d_solver.getIntegerSort()});
ASSERT_NO_THROW(tupleSort.getTupleSorts());
Sort bvSort = d_solver.mkBitVectorSort(32);
- ASSERT_THROW(bvSort.getTupleSorts(), CVC4ApiException);
+ ASSERT_THROW(bvSort.getTupleSorts(), CVC5ApiException);
}
TEST_F(TestApiBlackSort, sortCompare)
TEST_F(TestApiBlackTerm, getId)
{
Term n;
- ASSERT_THROW(n.getId(), CVC4ApiException);
+ ASSERT_THROW(n.getId(), CVC5ApiException);
Term x = d_solver.mkVar(d_solver.getIntegerSort(), "x");
ASSERT_NO_THROW(x.getId());
Term y = x;
Sort funSort2 = d_solver.mkFunctionSort(intSort, boolSort);
Term n;
- ASSERT_THROW(n.getKind(), CVC4ApiException);
+ ASSERT_THROW(n.getKind(), CVC5ApiException);
Term x = d_solver.mkVar(uSort, "x");
ASSERT_NO_THROW(x.getKind());
Term y = d_solver.mkVar(uSort, "y");
Sort funSort2 = d_solver.mkFunctionSort(intSort, boolSort);
Term n;
- ASSERT_THROW(n.getSort(), CVC4ApiException);
+ ASSERT_THROW(n.getSort(), CVC5ApiException);
Term x = d_solver.mkVar(bvSort, "x");
ASSERT_NO_THROW(x.getSort());
ASSERT_EQ(x.getSort(), bvSort);
Term b = d_solver.mkConst(bvsort, "b");
ASSERT_FALSE(x.hasOp());
- ASSERT_THROW(x.getOp(), CVC4ApiException);
+ ASSERT_THROW(x.getOp(), CVC5ApiException);
Term ab = d_solver.mkTerm(SELECT, a, b);
Op ext = d_solver.mkOp(BITVECTOR_EXTRACT, 4, 0);
Term fx = d_solver.mkTerm(APPLY_UF, f, x);
ASSERT_FALSE(f.hasOp());
- ASSERT_THROW(f.getOp(), CVC4ApiException);
+ ASSERT_THROW(f.getOp(), CVC5ApiException);
ASSERT_TRUE(fx.hasOp());
std::vector<Term> children(fx.begin(), fx.end());
// testing rebuild from op and children
Sort funSort1 = d_solver.mkFunctionSort(bvSort, intSort);
Sort funSort2 = d_solver.mkFunctionSort(intSort, boolSort);
- ASSERT_THROW(Term().notTerm(), CVC4ApiException);
+ ASSERT_THROW(Term().notTerm(), CVC5ApiException);
Term b = d_solver.mkTrue();
ASSERT_NO_THROW(b.notTerm());
Term x = d_solver.mkVar(d_solver.mkBitVectorSort(8), "x");
- ASSERT_THROW(x.notTerm(), CVC4ApiException);
+ ASSERT_THROW(x.notTerm(), CVC5ApiException);
Term f = d_solver.mkVar(funSort1, "f");
- ASSERT_THROW(f.notTerm(), CVC4ApiException);
+ ASSERT_THROW(f.notTerm(), CVC5ApiException);
Term p = d_solver.mkVar(funSort2, "p");
- ASSERT_THROW(p.notTerm(), CVC4ApiException);
+ ASSERT_THROW(p.notTerm(), CVC5ApiException);
Term zero = d_solver.mkInteger(0);
- ASSERT_THROW(zero.notTerm(), CVC4ApiException);
+ ASSERT_THROW(zero.notTerm(), CVC5ApiException);
Term f_x = d_solver.mkTerm(APPLY_UF, f, x);
- ASSERT_THROW(f_x.notTerm(), CVC4ApiException);
+ ASSERT_THROW(f_x.notTerm(), CVC5ApiException);
Term sum = d_solver.mkTerm(PLUS, f_x, f_x);
- ASSERT_THROW(sum.notTerm(), CVC4ApiException);
+ ASSERT_THROW(sum.notTerm(), CVC5ApiException);
Term p_0 = d_solver.mkTerm(APPLY_UF, p, zero);
ASSERT_NO_THROW(p_0.notTerm());
Term p_f_x = d_solver.mkTerm(APPLY_UF, p, f_x);
Sort funSort2 = d_solver.mkFunctionSort(intSort, boolSort);
Term b = d_solver.mkTrue();
- ASSERT_THROW(Term().andTerm(b), CVC4ApiException);
- ASSERT_THROW(b.andTerm(Term()), CVC4ApiException);
+ ASSERT_THROW(Term().andTerm(b), CVC5ApiException);
+ ASSERT_THROW(b.andTerm(Term()), CVC5ApiException);
ASSERT_NO_THROW(b.andTerm(b));
Term x = d_solver.mkVar(d_solver.mkBitVectorSort(8), "x");
- ASSERT_THROW(x.andTerm(b), CVC4ApiException);
- ASSERT_THROW(x.andTerm(x), CVC4ApiException);
+ ASSERT_THROW(x.andTerm(b), CVC5ApiException);
+ ASSERT_THROW(x.andTerm(x), CVC5ApiException);
Term f = d_solver.mkVar(funSort1, "f");
- ASSERT_THROW(f.andTerm(b), CVC4ApiException);
- ASSERT_THROW(f.andTerm(x), CVC4ApiException);
- ASSERT_THROW(f.andTerm(f), CVC4ApiException);
+ ASSERT_THROW(f.andTerm(b), CVC5ApiException);
+ ASSERT_THROW(f.andTerm(x), CVC5ApiException);
+ ASSERT_THROW(f.andTerm(f), CVC5ApiException);
Term p = d_solver.mkVar(funSort2, "p");
- ASSERT_THROW(p.andTerm(b), CVC4ApiException);
- ASSERT_THROW(p.andTerm(x), CVC4ApiException);
- ASSERT_THROW(p.andTerm(f), CVC4ApiException);
- ASSERT_THROW(p.andTerm(p), CVC4ApiException);
+ ASSERT_THROW(p.andTerm(b), CVC5ApiException);
+ ASSERT_THROW(p.andTerm(x), CVC5ApiException);
+ ASSERT_THROW(p.andTerm(f), CVC5ApiException);
+ ASSERT_THROW(p.andTerm(p), CVC5ApiException);
Term zero = d_solver.mkInteger(0);
- ASSERT_THROW(zero.andTerm(b), CVC4ApiException);
- ASSERT_THROW(zero.andTerm(x), CVC4ApiException);
- ASSERT_THROW(zero.andTerm(f), CVC4ApiException);
- ASSERT_THROW(zero.andTerm(p), CVC4ApiException);
- ASSERT_THROW(zero.andTerm(zero), CVC4ApiException);
+ ASSERT_THROW(zero.andTerm(b), CVC5ApiException);
+ ASSERT_THROW(zero.andTerm(x), CVC5ApiException);
+ ASSERT_THROW(zero.andTerm(f), CVC5ApiException);
+ ASSERT_THROW(zero.andTerm(p), CVC5ApiException);
+ ASSERT_THROW(zero.andTerm(zero), CVC5ApiException);
Term f_x = d_solver.mkTerm(APPLY_UF, f, x);
- ASSERT_THROW(f_x.andTerm(b), CVC4ApiException);
- ASSERT_THROW(f_x.andTerm(x), CVC4ApiException);
- ASSERT_THROW(f_x.andTerm(f), CVC4ApiException);
- ASSERT_THROW(f_x.andTerm(p), CVC4ApiException);
- ASSERT_THROW(f_x.andTerm(zero), CVC4ApiException);
- ASSERT_THROW(f_x.andTerm(f_x), CVC4ApiException);
+ ASSERT_THROW(f_x.andTerm(b), CVC5ApiException);
+ ASSERT_THROW(f_x.andTerm(x), CVC5ApiException);
+ ASSERT_THROW(f_x.andTerm(f), CVC5ApiException);
+ ASSERT_THROW(f_x.andTerm(p), CVC5ApiException);
+ ASSERT_THROW(f_x.andTerm(zero), CVC5ApiException);
+ ASSERT_THROW(f_x.andTerm(f_x), CVC5ApiException);
Term sum = d_solver.mkTerm(PLUS, f_x, f_x);
- ASSERT_THROW(sum.andTerm(b), CVC4ApiException);
- ASSERT_THROW(sum.andTerm(x), CVC4ApiException);
- ASSERT_THROW(sum.andTerm(f), CVC4ApiException);
- ASSERT_THROW(sum.andTerm(p), CVC4ApiException);
- ASSERT_THROW(sum.andTerm(zero), CVC4ApiException);
- ASSERT_THROW(sum.andTerm(f_x), CVC4ApiException);
- ASSERT_THROW(sum.andTerm(sum), CVC4ApiException);
+ ASSERT_THROW(sum.andTerm(b), CVC5ApiException);
+ ASSERT_THROW(sum.andTerm(x), CVC5ApiException);
+ ASSERT_THROW(sum.andTerm(f), CVC5ApiException);
+ ASSERT_THROW(sum.andTerm(p), CVC5ApiException);
+ ASSERT_THROW(sum.andTerm(zero), CVC5ApiException);
+ ASSERT_THROW(sum.andTerm(f_x), CVC5ApiException);
+ ASSERT_THROW(sum.andTerm(sum), CVC5ApiException);
Term p_0 = d_solver.mkTerm(APPLY_UF, p, zero);
ASSERT_NO_THROW(p_0.andTerm(b));
- ASSERT_THROW(p_0.andTerm(x), CVC4ApiException);
- ASSERT_THROW(p_0.andTerm(f), CVC4ApiException);
- ASSERT_THROW(p_0.andTerm(p), CVC4ApiException);
- ASSERT_THROW(p_0.andTerm(zero), CVC4ApiException);
- ASSERT_THROW(p_0.andTerm(f_x), CVC4ApiException);
- ASSERT_THROW(p_0.andTerm(sum), CVC4ApiException);
+ ASSERT_THROW(p_0.andTerm(x), CVC5ApiException);
+ ASSERT_THROW(p_0.andTerm(f), CVC5ApiException);
+ ASSERT_THROW(p_0.andTerm(p), CVC5ApiException);
+ ASSERT_THROW(p_0.andTerm(zero), CVC5ApiException);
+ ASSERT_THROW(p_0.andTerm(f_x), CVC5ApiException);
+ ASSERT_THROW(p_0.andTerm(sum), CVC5ApiException);
ASSERT_NO_THROW(p_0.andTerm(p_0));
Term p_f_x = d_solver.mkTerm(APPLY_UF, p, f_x);
ASSERT_NO_THROW(p_f_x.andTerm(b));
- ASSERT_THROW(p_f_x.andTerm(x), CVC4ApiException);
- ASSERT_THROW(p_f_x.andTerm(f), CVC4ApiException);
- ASSERT_THROW(p_f_x.andTerm(p), CVC4ApiException);
- ASSERT_THROW(p_f_x.andTerm(zero), CVC4ApiException);
- ASSERT_THROW(p_f_x.andTerm(f_x), CVC4ApiException);
- ASSERT_THROW(p_f_x.andTerm(sum), CVC4ApiException);
+ ASSERT_THROW(p_f_x.andTerm(x), CVC5ApiException);
+ ASSERT_THROW(p_f_x.andTerm(f), CVC5ApiException);
+ ASSERT_THROW(p_f_x.andTerm(p), CVC5ApiException);
+ ASSERT_THROW(p_f_x.andTerm(zero), CVC5ApiException);
+ ASSERT_THROW(p_f_x.andTerm(f_x), CVC5ApiException);
+ ASSERT_THROW(p_f_x.andTerm(sum), CVC5ApiException);
ASSERT_NO_THROW(p_f_x.andTerm(p_0));
ASSERT_NO_THROW(p_f_x.andTerm(p_f_x));
}
Sort funSort2 = d_solver.mkFunctionSort(intSort, boolSort);
Term b = d_solver.mkTrue();
- ASSERT_THROW(Term().orTerm(b), CVC4ApiException);
- ASSERT_THROW(b.orTerm(Term()), CVC4ApiException);
+ ASSERT_THROW(Term().orTerm(b), CVC5ApiException);
+ ASSERT_THROW(b.orTerm(Term()), CVC5ApiException);
ASSERT_NO_THROW(b.orTerm(b));
Term x = d_solver.mkVar(d_solver.mkBitVectorSort(8), "x");
- ASSERT_THROW(x.orTerm(b), CVC4ApiException);
- ASSERT_THROW(x.orTerm(x), CVC4ApiException);
+ ASSERT_THROW(x.orTerm(b), CVC5ApiException);
+ ASSERT_THROW(x.orTerm(x), CVC5ApiException);
Term f = d_solver.mkVar(funSort1, "f");
- ASSERT_THROW(f.orTerm(b), CVC4ApiException);
- ASSERT_THROW(f.orTerm(x), CVC4ApiException);
- ASSERT_THROW(f.orTerm(f), CVC4ApiException);
+ ASSERT_THROW(f.orTerm(b), CVC5ApiException);
+ ASSERT_THROW(f.orTerm(x), CVC5ApiException);
+ ASSERT_THROW(f.orTerm(f), CVC5ApiException);
Term p = d_solver.mkVar(funSort2, "p");
- ASSERT_THROW(p.orTerm(b), CVC4ApiException);
- ASSERT_THROW(p.orTerm(x), CVC4ApiException);
- ASSERT_THROW(p.orTerm(f), CVC4ApiException);
- ASSERT_THROW(p.orTerm(p), CVC4ApiException);
+ ASSERT_THROW(p.orTerm(b), CVC5ApiException);
+ ASSERT_THROW(p.orTerm(x), CVC5ApiException);
+ ASSERT_THROW(p.orTerm(f), CVC5ApiException);
+ ASSERT_THROW(p.orTerm(p), CVC5ApiException);
Term zero = d_solver.mkInteger(0);
- ASSERT_THROW(zero.orTerm(b), CVC4ApiException);
- ASSERT_THROW(zero.orTerm(x), CVC4ApiException);
- ASSERT_THROW(zero.orTerm(f), CVC4ApiException);
- ASSERT_THROW(zero.orTerm(p), CVC4ApiException);
- ASSERT_THROW(zero.orTerm(zero), CVC4ApiException);
+ ASSERT_THROW(zero.orTerm(b), CVC5ApiException);
+ ASSERT_THROW(zero.orTerm(x), CVC5ApiException);
+ ASSERT_THROW(zero.orTerm(f), CVC5ApiException);
+ ASSERT_THROW(zero.orTerm(p), CVC5ApiException);
+ ASSERT_THROW(zero.orTerm(zero), CVC5ApiException);
Term f_x = d_solver.mkTerm(APPLY_UF, f, x);
- ASSERT_THROW(f_x.orTerm(b), CVC4ApiException);
- ASSERT_THROW(f_x.orTerm(x), CVC4ApiException);
- ASSERT_THROW(f_x.orTerm(f), CVC4ApiException);
- ASSERT_THROW(f_x.orTerm(p), CVC4ApiException);
- ASSERT_THROW(f_x.orTerm(zero), CVC4ApiException);
- ASSERT_THROW(f_x.orTerm(f_x), CVC4ApiException);
+ ASSERT_THROW(f_x.orTerm(b), CVC5ApiException);
+ ASSERT_THROW(f_x.orTerm(x), CVC5ApiException);
+ ASSERT_THROW(f_x.orTerm(f), CVC5ApiException);
+ ASSERT_THROW(f_x.orTerm(p), CVC5ApiException);
+ ASSERT_THROW(f_x.orTerm(zero), CVC5ApiException);
+ ASSERT_THROW(f_x.orTerm(f_x), CVC5ApiException);
Term sum = d_solver.mkTerm(PLUS, f_x, f_x);
- ASSERT_THROW(sum.orTerm(b), CVC4ApiException);
- ASSERT_THROW(sum.orTerm(x), CVC4ApiException);
- ASSERT_THROW(sum.orTerm(f), CVC4ApiException);
- ASSERT_THROW(sum.orTerm(p), CVC4ApiException);
- ASSERT_THROW(sum.orTerm(zero), CVC4ApiException);
- ASSERT_THROW(sum.orTerm(f_x), CVC4ApiException);
- ASSERT_THROW(sum.orTerm(sum), CVC4ApiException);
+ ASSERT_THROW(sum.orTerm(b), CVC5ApiException);
+ ASSERT_THROW(sum.orTerm(x), CVC5ApiException);
+ ASSERT_THROW(sum.orTerm(f), CVC5ApiException);
+ ASSERT_THROW(sum.orTerm(p), CVC5ApiException);
+ ASSERT_THROW(sum.orTerm(zero), CVC5ApiException);
+ ASSERT_THROW(sum.orTerm(f_x), CVC5ApiException);
+ ASSERT_THROW(sum.orTerm(sum), CVC5ApiException);
Term p_0 = d_solver.mkTerm(APPLY_UF, p, zero);
ASSERT_NO_THROW(p_0.orTerm(b));
- ASSERT_THROW(p_0.orTerm(x), CVC4ApiException);
- ASSERT_THROW(p_0.orTerm(f), CVC4ApiException);
- ASSERT_THROW(p_0.orTerm(p), CVC4ApiException);
- ASSERT_THROW(p_0.orTerm(zero), CVC4ApiException);
- ASSERT_THROW(p_0.orTerm(f_x), CVC4ApiException);
- ASSERT_THROW(p_0.orTerm(sum), CVC4ApiException);
+ ASSERT_THROW(p_0.orTerm(x), CVC5ApiException);
+ ASSERT_THROW(p_0.orTerm(f), CVC5ApiException);
+ ASSERT_THROW(p_0.orTerm(p), CVC5ApiException);
+ ASSERT_THROW(p_0.orTerm(zero), CVC5ApiException);
+ ASSERT_THROW(p_0.orTerm(f_x), CVC5ApiException);
+ ASSERT_THROW(p_0.orTerm(sum), CVC5ApiException);
ASSERT_NO_THROW(p_0.orTerm(p_0));
Term p_f_x = d_solver.mkTerm(APPLY_UF, p, f_x);
ASSERT_NO_THROW(p_f_x.orTerm(b));
- ASSERT_THROW(p_f_x.orTerm(x), CVC4ApiException);
- ASSERT_THROW(p_f_x.orTerm(f), CVC4ApiException);
- ASSERT_THROW(p_f_x.orTerm(p), CVC4ApiException);
- ASSERT_THROW(p_f_x.orTerm(zero), CVC4ApiException);
- ASSERT_THROW(p_f_x.orTerm(f_x), CVC4ApiException);
- ASSERT_THROW(p_f_x.orTerm(sum), CVC4ApiException);
+ ASSERT_THROW(p_f_x.orTerm(x), CVC5ApiException);
+ ASSERT_THROW(p_f_x.orTerm(f), CVC5ApiException);
+ ASSERT_THROW(p_f_x.orTerm(p), CVC5ApiException);
+ ASSERT_THROW(p_f_x.orTerm(zero), CVC5ApiException);
+ ASSERT_THROW(p_f_x.orTerm(f_x), CVC5ApiException);
+ ASSERT_THROW(p_f_x.orTerm(sum), CVC5ApiException);
ASSERT_NO_THROW(p_f_x.orTerm(p_0));
ASSERT_NO_THROW(p_f_x.orTerm(p_f_x));
}
Sort funSort2 = d_solver.mkFunctionSort(intSort, boolSort);
Term b = d_solver.mkTrue();
- ASSERT_THROW(Term().xorTerm(b), CVC4ApiException);
- ASSERT_THROW(b.xorTerm(Term()), CVC4ApiException);
+ ASSERT_THROW(Term().xorTerm(b), CVC5ApiException);
+ ASSERT_THROW(b.xorTerm(Term()), CVC5ApiException);
ASSERT_NO_THROW(b.xorTerm(b));
Term x = d_solver.mkVar(d_solver.mkBitVectorSort(8), "x");
- ASSERT_THROW(x.xorTerm(b), CVC4ApiException);
- ASSERT_THROW(x.xorTerm(x), CVC4ApiException);
+ ASSERT_THROW(x.xorTerm(b), CVC5ApiException);
+ ASSERT_THROW(x.xorTerm(x), CVC5ApiException);
Term f = d_solver.mkVar(funSort1, "f");
- ASSERT_THROW(f.xorTerm(b), CVC4ApiException);
- ASSERT_THROW(f.xorTerm(x), CVC4ApiException);
- ASSERT_THROW(f.xorTerm(f), CVC4ApiException);
+ ASSERT_THROW(f.xorTerm(b), CVC5ApiException);
+ ASSERT_THROW(f.xorTerm(x), CVC5ApiException);
+ ASSERT_THROW(f.xorTerm(f), CVC5ApiException);
Term p = d_solver.mkVar(funSort2, "p");
- ASSERT_THROW(p.xorTerm(b), CVC4ApiException);
- ASSERT_THROW(p.xorTerm(x), CVC4ApiException);
- ASSERT_THROW(p.xorTerm(f), CVC4ApiException);
- ASSERT_THROW(p.xorTerm(p), CVC4ApiException);
+ ASSERT_THROW(p.xorTerm(b), CVC5ApiException);
+ ASSERT_THROW(p.xorTerm(x), CVC5ApiException);
+ ASSERT_THROW(p.xorTerm(f), CVC5ApiException);
+ ASSERT_THROW(p.xorTerm(p), CVC5ApiException);
Term zero = d_solver.mkInteger(0);
- ASSERT_THROW(zero.xorTerm(b), CVC4ApiException);
- ASSERT_THROW(zero.xorTerm(x), CVC4ApiException);
- ASSERT_THROW(zero.xorTerm(f), CVC4ApiException);
- ASSERT_THROW(zero.xorTerm(p), CVC4ApiException);
- ASSERT_THROW(zero.xorTerm(zero), CVC4ApiException);
+ ASSERT_THROW(zero.xorTerm(b), CVC5ApiException);
+ ASSERT_THROW(zero.xorTerm(x), CVC5ApiException);
+ ASSERT_THROW(zero.xorTerm(f), CVC5ApiException);
+ ASSERT_THROW(zero.xorTerm(p), CVC5ApiException);
+ ASSERT_THROW(zero.xorTerm(zero), CVC5ApiException);
Term f_x = d_solver.mkTerm(APPLY_UF, f, x);
- ASSERT_THROW(f_x.xorTerm(b), CVC4ApiException);
- ASSERT_THROW(f_x.xorTerm(x), CVC4ApiException);
- ASSERT_THROW(f_x.xorTerm(f), CVC4ApiException);
- ASSERT_THROW(f_x.xorTerm(p), CVC4ApiException);
- ASSERT_THROW(f_x.xorTerm(zero), CVC4ApiException);
- ASSERT_THROW(f_x.xorTerm(f_x), CVC4ApiException);
+ ASSERT_THROW(f_x.xorTerm(b), CVC5ApiException);
+ ASSERT_THROW(f_x.xorTerm(x), CVC5ApiException);
+ ASSERT_THROW(f_x.xorTerm(f), CVC5ApiException);
+ ASSERT_THROW(f_x.xorTerm(p), CVC5ApiException);
+ ASSERT_THROW(f_x.xorTerm(zero), CVC5ApiException);
+ ASSERT_THROW(f_x.xorTerm(f_x), CVC5ApiException);
Term sum = d_solver.mkTerm(PLUS, f_x, f_x);
- ASSERT_THROW(sum.xorTerm(b), CVC4ApiException);
- ASSERT_THROW(sum.xorTerm(x), CVC4ApiException);
- ASSERT_THROW(sum.xorTerm(f), CVC4ApiException);
- ASSERT_THROW(sum.xorTerm(p), CVC4ApiException);
- ASSERT_THROW(sum.xorTerm(zero), CVC4ApiException);
- ASSERT_THROW(sum.xorTerm(f_x), CVC4ApiException);
- ASSERT_THROW(sum.xorTerm(sum), CVC4ApiException);
+ ASSERT_THROW(sum.xorTerm(b), CVC5ApiException);
+ ASSERT_THROW(sum.xorTerm(x), CVC5ApiException);
+ ASSERT_THROW(sum.xorTerm(f), CVC5ApiException);
+ ASSERT_THROW(sum.xorTerm(p), CVC5ApiException);
+ ASSERT_THROW(sum.xorTerm(zero), CVC5ApiException);
+ ASSERT_THROW(sum.xorTerm(f_x), CVC5ApiException);
+ ASSERT_THROW(sum.xorTerm(sum), CVC5ApiException);
Term p_0 = d_solver.mkTerm(APPLY_UF, p, zero);
ASSERT_NO_THROW(p_0.xorTerm(b));
- ASSERT_THROW(p_0.xorTerm(x), CVC4ApiException);
- ASSERT_THROW(p_0.xorTerm(f), CVC4ApiException);
- ASSERT_THROW(p_0.xorTerm(p), CVC4ApiException);
- ASSERT_THROW(p_0.xorTerm(zero), CVC4ApiException);
- ASSERT_THROW(p_0.xorTerm(f_x), CVC4ApiException);
- ASSERT_THROW(p_0.xorTerm(sum), CVC4ApiException);
+ ASSERT_THROW(p_0.xorTerm(x), CVC5ApiException);
+ ASSERT_THROW(p_0.xorTerm(f), CVC5ApiException);
+ ASSERT_THROW(p_0.xorTerm(p), CVC5ApiException);
+ ASSERT_THROW(p_0.xorTerm(zero), CVC5ApiException);
+ ASSERT_THROW(p_0.xorTerm(f_x), CVC5ApiException);
+ ASSERT_THROW(p_0.xorTerm(sum), CVC5ApiException);
ASSERT_NO_THROW(p_0.xorTerm(p_0));
Term p_f_x = d_solver.mkTerm(APPLY_UF, p, f_x);
ASSERT_NO_THROW(p_f_x.xorTerm(b));
- ASSERT_THROW(p_f_x.xorTerm(x), CVC4ApiException);
- ASSERT_THROW(p_f_x.xorTerm(f), CVC4ApiException);
- ASSERT_THROW(p_f_x.xorTerm(p), CVC4ApiException);
- ASSERT_THROW(p_f_x.xorTerm(zero), CVC4ApiException);
- ASSERT_THROW(p_f_x.xorTerm(f_x), CVC4ApiException);
- ASSERT_THROW(p_f_x.xorTerm(sum), CVC4ApiException);
+ ASSERT_THROW(p_f_x.xorTerm(x), CVC5ApiException);
+ ASSERT_THROW(p_f_x.xorTerm(f), CVC5ApiException);
+ ASSERT_THROW(p_f_x.xorTerm(p), CVC5ApiException);
+ ASSERT_THROW(p_f_x.xorTerm(zero), CVC5ApiException);
+ ASSERT_THROW(p_f_x.xorTerm(f_x), CVC5ApiException);
+ ASSERT_THROW(p_f_x.xorTerm(sum), CVC5ApiException);
ASSERT_NO_THROW(p_f_x.xorTerm(p_0));
ASSERT_NO_THROW(p_f_x.xorTerm(p_f_x));
}
Sort funSort2 = d_solver.mkFunctionSort(intSort, boolSort);
Term b = d_solver.mkTrue();
- ASSERT_THROW(Term().eqTerm(b), CVC4ApiException);
- ASSERT_THROW(b.eqTerm(Term()), CVC4ApiException);
+ ASSERT_THROW(Term().eqTerm(b), CVC5ApiException);
+ ASSERT_THROW(b.eqTerm(Term()), CVC5ApiException);
ASSERT_NO_THROW(b.eqTerm(b));
Term x = d_solver.mkVar(d_solver.mkBitVectorSort(8), "x");
- ASSERT_THROW(x.eqTerm(b), CVC4ApiException);
+ ASSERT_THROW(x.eqTerm(b), CVC5ApiException);
ASSERT_NO_THROW(x.eqTerm(x));
Term f = d_solver.mkVar(funSort1, "f");
- ASSERT_THROW(f.eqTerm(b), CVC4ApiException);
- ASSERT_THROW(f.eqTerm(x), CVC4ApiException);
+ ASSERT_THROW(f.eqTerm(b), CVC5ApiException);
+ ASSERT_THROW(f.eqTerm(x), CVC5ApiException);
ASSERT_NO_THROW(f.eqTerm(f));
Term p = d_solver.mkVar(funSort2, "p");
- ASSERT_THROW(p.eqTerm(b), CVC4ApiException);
- ASSERT_THROW(p.eqTerm(x), CVC4ApiException);
- ASSERT_THROW(p.eqTerm(f), CVC4ApiException);
+ ASSERT_THROW(p.eqTerm(b), CVC5ApiException);
+ ASSERT_THROW(p.eqTerm(x), CVC5ApiException);
+ ASSERT_THROW(p.eqTerm(f), CVC5ApiException);
ASSERT_NO_THROW(p.eqTerm(p));
Term zero = d_solver.mkInteger(0);
- ASSERT_THROW(zero.eqTerm(b), CVC4ApiException);
- ASSERT_THROW(zero.eqTerm(x), CVC4ApiException);
- ASSERT_THROW(zero.eqTerm(f), CVC4ApiException);
- ASSERT_THROW(zero.eqTerm(p), CVC4ApiException);
+ ASSERT_THROW(zero.eqTerm(b), CVC5ApiException);
+ ASSERT_THROW(zero.eqTerm(x), CVC5ApiException);
+ ASSERT_THROW(zero.eqTerm(f), CVC5ApiException);
+ ASSERT_THROW(zero.eqTerm(p), CVC5ApiException);
ASSERT_NO_THROW(zero.eqTerm(zero));
Term f_x = d_solver.mkTerm(APPLY_UF, f, x);
- ASSERT_THROW(f_x.eqTerm(b), CVC4ApiException);
- ASSERT_THROW(f_x.eqTerm(x), CVC4ApiException);
- ASSERT_THROW(f_x.eqTerm(f), CVC4ApiException);
- ASSERT_THROW(f_x.eqTerm(p), CVC4ApiException);
+ ASSERT_THROW(f_x.eqTerm(b), CVC5ApiException);
+ ASSERT_THROW(f_x.eqTerm(x), CVC5ApiException);
+ ASSERT_THROW(f_x.eqTerm(f), CVC5ApiException);
+ ASSERT_THROW(f_x.eqTerm(p), CVC5ApiException);
ASSERT_NO_THROW(f_x.eqTerm(zero));
ASSERT_NO_THROW(f_x.eqTerm(f_x));
Term sum = d_solver.mkTerm(PLUS, f_x, f_x);
- ASSERT_THROW(sum.eqTerm(b), CVC4ApiException);
- ASSERT_THROW(sum.eqTerm(x), CVC4ApiException);
- ASSERT_THROW(sum.eqTerm(f), CVC4ApiException);
- ASSERT_THROW(sum.eqTerm(p), CVC4ApiException);
+ ASSERT_THROW(sum.eqTerm(b), CVC5ApiException);
+ ASSERT_THROW(sum.eqTerm(x), CVC5ApiException);
+ ASSERT_THROW(sum.eqTerm(f), CVC5ApiException);
+ ASSERT_THROW(sum.eqTerm(p), CVC5ApiException);
ASSERT_NO_THROW(sum.eqTerm(zero));
ASSERT_NO_THROW(sum.eqTerm(f_x));
ASSERT_NO_THROW(sum.eqTerm(sum));
Term p_0 = d_solver.mkTerm(APPLY_UF, p, zero);
ASSERT_NO_THROW(p_0.eqTerm(b));
- ASSERT_THROW(p_0.eqTerm(x), CVC4ApiException);
- ASSERT_THROW(p_0.eqTerm(f), CVC4ApiException);
- ASSERT_THROW(p_0.eqTerm(p), CVC4ApiException);
- ASSERT_THROW(p_0.eqTerm(zero), CVC4ApiException);
- ASSERT_THROW(p_0.eqTerm(f_x), CVC4ApiException);
- ASSERT_THROW(p_0.eqTerm(sum), CVC4ApiException);
+ ASSERT_THROW(p_0.eqTerm(x), CVC5ApiException);
+ ASSERT_THROW(p_0.eqTerm(f), CVC5ApiException);
+ ASSERT_THROW(p_0.eqTerm(p), CVC5ApiException);
+ ASSERT_THROW(p_0.eqTerm(zero), CVC5ApiException);
+ ASSERT_THROW(p_0.eqTerm(f_x), CVC5ApiException);
+ ASSERT_THROW(p_0.eqTerm(sum), CVC5ApiException);
ASSERT_NO_THROW(p_0.eqTerm(p_0));
Term p_f_x = d_solver.mkTerm(APPLY_UF, p, f_x);
ASSERT_NO_THROW(p_f_x.eqTerm(b));
- ASSERT_THROW(p_f_x.eqTerm(x), CVC4ApiException);
- ASSERT_THROW(p_f_x.eqTerm(f), CVC4ApiException);
- ASSERT_THROW(p_f_x.eqTerm(p), CVC4ApiException);
- ASSERT_THROW(p_f_x.eqTerm(zero), CVC4ApiException);
- ASSERT_THROW(p_f_x.eqTerm(f_x), CVC4ApiException);
- ASSERT_THROW(p_f_x.eqTerm(sum), CVC4ApiException);
+ ASSERT_THROW(p_f_x.eqTerm(x), CVC5ApiException);
+ ASSERT_THROW(p_f_x.eqTerm(f), CVC5ApiException);
+ ASSERT_THROW(p_f_x.eqTerm(p), CVC5ApiException);
+ ASSERT_THROW(p_f_x.eqTerm(zero), CVC5ApiException);
+ ASSERT_THROW(p_f_x.eqTerm(f_x), CVC5ApiException);
+ ASSERT_THROW(p_f_x.eqTerm(sum), CVC5ApiException);
ASSERT_NO_THROW(p_f_x.eqTerm(p_0));
ASSERT_NO_THROW(p_f_x.eqTerm(p_f_x));
}
Sort funSort2 = d_solver.mkFunctionSort(intSort, boolSort);
Term b = d_solver.mkTrue();
- ASSERT_THROW(Term().impTerm(b), CVC4ApiException);
- ASSERT_THROW(b.impTerm(Term()), CVC4ApiException);
+ ASSERT_THROW(Term().impTerm(b), CVC5ApiException);
+ ASSERT_THROW(b.impTerm(Term()), CVC5ApiException);
ASSERT_NO_THROW(b.impTerm(b));
Term x = d_solver.mkVar(d_solver.mkBitVectorSort(8), "x");
- ASSERT_THROW(x.impTerm(b), CVC4ApiException);
- ASSERT_THROW(x.impTerm(x), CVC4ApiException);
+ ASSERT_THROW(x.impTerm(b), CVC5ApiException);
+ ASSERT_THROW(x.impTerm(x), CVC5ApiException);
Term f = d_solver.mkVar(funSort1, "f");
- ASSERT_THROW(f.impTerm(b), CVC4ApiException);
- ASSERT_THROW(f.impTerm(x), CVC4ApiException);
- ASSERT_THROW(f.impTerm(f), CVC4ApiException);
+ ASSERT_THROW(f.impTerm(b), CVC5ApiException);
+ ASSERT_THROW(f.impTerm(x), CVC5ApiException);
+ ASSERT_THROW(f.impTerm(f), CVC5ApiException);
Term p = d_solver.mkVar(funSort2, "p");
- ASSERT_THROW(p.impTerm(b), CVC4ApiException);
- ASSERT_THROW(p.impTerm(x), CVC4ApiException);
- ASSERT_THROW(p.impTerm(f), CVC4ApiException);
- ASSERT_THROW(p.impTerm(p), CVC4ApiException);
+ ASSERT_THROW(p.impTerm(b), CVC5ApiException);
+ ASSERT_THROW(p.impTerm(x), CVC5ApiException);
+ ASSERT_THROW(p.impTerm(f), CVC5ApiException);
+ ASSERT_THROW(p.impTerm(p), CVC5ApiException);
Term zero = d_solver.mkInteger(0);
- ASSERT_THROW(zero.impTerm(b), CVC4ApiException);
- ASSERT_THROW(zero.impTerm(x), CVC4ApiException);
- ASSERT_THROW(zero.impTerm(f), CVC4ApiException);
- ASSERT_THROW(zero.impTerm(p), CVC4ApiException);
- ASSERT_THROW(zero.impTerm(zero), CVC4ApiException);
+ ASSERT_THROW(zero.impTerm(b), CVC5ApiException);
+ ASSERT_THROW(zero.impTerm(x), CVC5ApiException);
+ ASSERT_THROW(zero.impTerm(f), CVC5ApiException);
+ ASSERT_THROW(zero.impTerm(p), CVC5ApiException);
+ ASSERT_THROW(zero.impTerm(zero), CVC5ApiException);
Term f_x = d_solver.mkTerm(APPLY_UF, f, x);
- ASSERT_THROW(f_x.impTerm(b), CVC4ApiException);
- ASSERT_THROW(f_x.impTerm(x), CVC4ApiException);
- ASSERT_THROW(f_x.impTerm(f), CVC4ApiException);
- ASSERT_THROW(f_x.impTerm(p), CVC4ApiException);
- ASSERT_THROW(f_x.impTerm(zero), CVC4ApiException);
- ASSERT_THROW(f_x.impTerm(f_x), CVC4ApiException);
+ ASSERT_THROW(f_x.impTerm(b), CVC5ApiException);
+ ASSERT_THROW(f_x.impTerm(x), CVC5ApiException);
+ ASSERT_THROW(f_x.impTerm(f), CVC5ApiException);
+ ASSERT_THROW(f_x.impTerm(p), CVC5ApiException);
+ ASSERT_THROW(f_x.impTerm(zero), CVC5ApiException);
+ ASSERT_THROW(f_x.impTerm(f_x), CVC5ApiException);
Term sum = d_solver.mkTerm(PLUS, f_x, f_x);
- ASSERT_THROW(sum.impTerm(b), CVC4ApiException);
- ASSERT_THROW(sum.impTerm(x), CVC4ApiException);
- ASSERT_THROW(sum.impTerm(f), CVC4ApiException);
- ASSERT_THROW(sum.impTerm(p), CVC4ApiException);
- ASSERT_THROW(sum.impTerm(zero), CVC4ApiException);
- ASSERT_THROW(sum.impTerm(f_x), CVC4ApiException);
- ASSERT_THROW(sum.impTerm(sum), CVC4ApiException);
+ ASSERT_THROW(sum.impTerm(b), CVC5ApiException);
+ ASSERT_THROW(sum.impTerm(x), CVC5ApiException);
+ ASSERT_THROW(sum.impTerm(f), CVC5ApiException);
+ ASSERT_THROW(sum.impTerm(p), CVC5ApiException);
+ ASSERT_THROW(sum.impTerm(zero), CVC5ApiException);
+ ASSERT_THROW(sum.impTerm(f_x), CVC5ApiException);
+ ASSERT_THROW(sum.impTerm(sum), CVC5ApiException);
Term p_0 = d_solver.mkTerm(APPLY_UF, p, zero);
ASSERT_NO_THROW(p_0.impTerm(b));
- ASSERT_THROW(p_0.impTerm(x), CVC4ApiException);
- ASSERT_THROW(p_0.impTerm(f), CVC4ApiException);
- ASSERT_THROW(p_0.impTerm(p), CVC4ApiException);
- ASSERT_THROW(p_0.impTerm(zero), CVC4ApiException);
- ASSERT_THROW(p_0.impTerm(f_x), CVC4ApiException);
- ASSERT_THROW(p_0.impTerm(sum), CVC4ApiException);
+ ASSERT_THROW(p_0.impTerm(x), CVC5ApiException);
+ ASSERT_THROW(p_0.impTerm(f), CVC5ApiException);
+ ASSERT_THROW(p_0.impTerm(p), CVC5ApiException);
+ ASSERT_THROW(p_0.impTerm(zero), CVC5ApiException);
+ ASSERT_THROW(p_0.impTerm(f_x), CVC5ApiException);
+ ASSERT_THROW(p_0.impTerm(sum), CVC5ApiException);
ASSERT_NO_THROW(p_0.impTerm(p_0));
Term p_f_x = d_solver.mkTerm(APPLY_UF, p, f_x);
ASSERT_NO_THROW(p_f_x.impTerm(b));
- ASSERT_THROW(p_f_x.impTerm(x), CVC4ApiException);
- ASSERT_THROW(p_f_x.impTerm(f), CVC4ApiException);
- ASSERT_THROW(p_f_x.impTerm(p), CVC4ApiException);
- ASSERT_THROW(p_f_x.impTerm(zero), CVC4ApiException);
- ASSERT_THROW(p_f_x.impTerm(f_x), CVC4ApiException);
- ASSERT_THROW(p_f_x.impTerm(sum), CVC4ApiException);
+ ASSERT_THROW(p_f_x.impTerm(x), CVC5ApiException);
+ ASSERT_THROW(p_f_x.impTerm(f), CVC5ApiException);
+ ASSERT_THROW(p_f_x.impTerm(p), CVC5ApiException);
+ ASSERT_THROW(p_f_x.impTerm(zero), CVC5ApiException);
+ ASSERT_THROW(p_f_x.impTerm(f_x), CVC5ApiException);
+ ASSERT_THROW(p_f_x.impTerm(sum), CVC5ApiException);
ASSERT_NO_THROW(p_f_x.impTerm(p_0));
ASSERT_NO_THROW(p_f_x.impTerm(p_f_x));
}
Sort funSort2 = d_solver.mkFunctionSort(intSort, boolSort);
Term b = d_solver.mkTrue();
- ASSERT_THROW(Term().iteTerm(b, b), CVC4ApiException);
- ASSERT_THROW(b.iteTerm(Term(), b), CVC4ApiException);
- ASSERT_THROW(b.iteTerm(b, Term()), CVC4ApiException);
+ ASSERT_THROW(Term().iteTerm(b, b), CVC5ApiException);
+ ASSERT_THROW(b.iteTerm(Term(), b), CVC5ApiException);
+ ASSERT_THROW(b.iteTerm(b, Term()), CVC5ApiException);
ASSERT_NO_THROW(b.iteTerm(b, b));
Term x = d_solver.mkVar(d_solver.mkBitVectorSort(8), "x");
ASSERT_NO_THROW(b.iteTerm(x, x));
ASSERT_NO_THROW(b.iteTerm(b, b));
- ASSERT_THROW(b.iteTerm(x, b), CVC4ApiException);
- ASSERT_THROW(x.iteTerm(x, x), CVC4ApiException);
- ASSERT_THROW(x.iteTerm(x, b), CVC4ApiException);
+ ASSERT_THROW(b.iteTerm(x, b), CVC5ApiException);
+ ASSERT_THROW(x.iteTerm(x, x), CVC5ApiException);
+ ASSERT_THROW(x.iteTerm(x, b), CVC5ApiException);
Term f = d_solver.mkVar(funSort1, "f");
- ASSERT_THROW(f.iteTerm(b, b), CVC4ApiException);
- ASSERT_THROW(x.iteTerm(b, x), CVC4ApiException);
+ ASSERT_THROW(f.iteTerm(b, b), CVC5ApiException);
+ ASSERT_THROW(x.iteTerm(b, x), CVC5ApiException);
Term p = d_solver.mkVar(funSort2, "p");
- ASSERT_THROW(p.iteTerm(b, b), CVC4ApiException);
- ASSERT_THROW(p.iteTerm(x, b), CVC4ApiException);
+ ASSERT_THROW(p.iteTerm(b, b), CVC5ApiException);
+ ASSERT_THROW(p.iteTerm(x, b), CVC5ApiException);
Term zero = d_solver.mkInteger(0);
- ASSERT_THROW(zero.iteTerm(x, x), CVC4ApiException);
- ASSERT_THROW(zero.iteTerm(x, b), CVC4ApiException);
+ ASSERT_THROW(zero.iteTerm(x, x), CVC5ApiException);
+ ASSERT_THROW(zero.iteTerm(x, b), CVC5ApiException);
Term f_x = d_solver.mkTerm(APPLY_UF, f, x);
- ASSERT_THROW(f_x.iteTerm(b, b), CVC4ApiException);
- ASSERT_THROW(f_x.iteTerm(b, x), CVC4ApiException);
+ ASSERT_THROW(f_x.iteTerm(b, b), CVC5ApiException);
+ ASSERT_THROW(f_x.iteTerm(b, x), CVC5ApiException);
Term sum = d_solver.mkTerm(PLUS, f_x, f_x);
- ASSERT_THROW(sum.iteTerm(x, x), CVC4ApiException);
- ASSERT_THROW(sum.iteTerm(b, x), CVC4ApiException);
+ ASSERT_THROW(sum.iteTerm(x, x), CVC5ApiException);
+ ASSERT_THROW(sum.iteTerm(b, x), CVC5ApiException);
Term p_0 = d_solver.mkTerm(APPLY_UF, p, zero);
ASSERT_NO_THROW(p_0.iteTerm(b, b));
ASSERT_NO_THROW(p_0.iteTerm(x, x));
- ASSERT_THROW(p_0.iteTerm(x, b), CVC4ApiException);
+ ASSERT_THROW(p_0.iteTerm(x, b), CVC5ApiException);
Term p_f_x = d_solver.mkTerm(APPLY_UF, p, f_x);
ASSERT_NO_THROW(p_f_x.iteTerm(b, b));
ASSERT_NO_THROW(p_f_x.iteTerm(x, x));
- ASSERT_THROW(p_f_x.iteTerm(x, b), CVC4ApiException);
+ ASSERT_THROW(p_f_x.iteTerm(x, b), CVC5ApiException);
}
TEST_F(TestApiBlackTerm, termAssignment)
ASSERT_EQ(t1[0], two);
ASSERT_EQ(t1.getNumChildren(), 2);
Term tnull;
- ASSERT_THROW(tnull.getNumChildren(), CVC4ApiException);
+ ASSERT_THROW(tnull.getNumChildren(), CVC5ApiException);
// apply term f(2)
Sort intSort = d_solver.getIntegerSort();
ASSERT_EQ(t2.getNumChildren(), 2);
ASSERT_EQ(t2[0], f);
ASSERT_EQ(t2[1], two);
- ASSERT_THROW(tnull[0], CVC4ApiException);
+ ASSERT_THROW(tnull[0], CVC5ApiException);
}
TEST_F(TestApiBlackTerm, getInteger)
Term int11 = d_solver.mkInteger("18446744073709551616");
Term int12 = d_solver.mkInteger("-0");
- ASSERT_THROW(d_solver.mkInteger(""), CVC4ApiException);
- ASSERT_THROW(d_solver.mkInteger("-"), CVC4ApiException);
- ASSERT_THROW(d_solver.mkInteger("-1-"), CVC4ApiException);
- ASSERT_THROW(d_solver.mkInteger("0.0"), CVC4ApiException);
- ASSERT_THROW(d_solver.mkInteger("-0.1"), CVC4ApiException);
- ASSERT_THROW(d_solver.mkInteger("012"), CVC4ApiException);
- ASSERT_THROW(d_solver.mkInteger("0000"), CVC4ApiException);
- ASSERT_THROW(d_solver.mkInteger("-01"), CVC4ApiException);
- ASSERT_THROW(d_solver.mkInteger("-00"), CVC4ApiException);
+ ASSERT_THROW(d_solver.mkInteger(""), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkInteger("-"), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkInteger("-1-"), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkInteger("0.0"), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkInteger("-0.1"), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkInteger("012"), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkInteger("0000"), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkInteger("-01"), CVC5ApiException);
+ ASSERT_THROW(d_solver.mkInteger("-00"), CVC5ApiException);
ASSERT_TRUE(!int1.isInt32() && !int1.isUInt32() && !int1.isInt64()
&& !int1.isUInt64() && int1.isInteger());
ASSERT_EQ(xpx.substitute(x, one), onepone);
ASSERT_EQ(onepone.substitute(one, x), xpx);
// incorrect due to type
- ASSERT_THROW(xpx.substitute(one, ttrue), CVC4ApiException);
+ ASSERT_THROW(xpx.substitute(one, ttrue), CVC5ApiException);
// simultaneous substitution
Term y = d_solver.mkConst(d_solver.getIntegerSort(), "y");
// incorrect substitution due to arity
rs.pop_back();
- ASSERT_THROW(xpy.substitute(es, rs), CVC4ApiException);
+ ASSERT_THROW(xpy.substitute(es, rs), CVC5ApiException);
// incorrect substitution due to types
rs.push_back(ttrue);
- ASSERT_THROW(xpy.substitute(es, rs), CVC4ApiException);
+ ASSERT_THROW(xpy.substitute(es, rs), CVC5ApiException);
// null cannot substitute
Term tnull;
- ASSERT_THROW(tnull.substitute(one, x), CVC4ApiException);
- ASSERT_THROW(xpx.substitute(tnull, x), CVC4ApiException);
- ASSERT_THROW(xpx.substitute(x, tnull), CVC4ApiException);
+ ASSERT_THROW(tnull.substitute(one, x), CVC5ApiException);
+ ASSERT_THROW(xpx.substitute(tnull, x), CVC5ApiException);
+ ASSERT_THROW(xpx.substitute(x, tnull), CVC5ApiException);
rs.pop_back();
rs.push_back(tnull);
- ASSERT_THROW(xpy.substitute(es, rs), CVC4ApiException);
+ ASSERT_THROW(xpy.substitute(es, rs), CVC5ApiException);
es.clear();
rs.clear();
es.push_back(x);
rs.push_back(y);
- ASSERT_THROW(tnull.substitute(es, rs), CVC4ApiException);
+ ASSERT_THROW(tnull.substitute(es, rs), CVC5ApiException);
es.push_back(tnull);
rs.push_back(one);
- ASSERT_THROW(xpx.substitute(es, rs), CVC4ApiException);
+ ASSERT_THROW(xpx.substitute(es, rs), CVC5ApiException);
}
TEST_F(TestApiBlackTerm, constArray)
ASSERT_EQ(constarr.getKind(), CONST_ARRAY);
ASSERT_EQ(constarr.getConstArrayBase(), one);
- ASSERT_THROW(a.getConstArrayBase(), CVC4ApiException);
+ ASSERT_THROW(a.getConstArrayBase(), CVC5ApiException);
arrsort =
d_solver.mkArraySort(d_solver.getRealSort(), d_solver.getRealSort());
// A seq.unit app is not a constant sequence (regardless of whether it is
// applied to a constant).
Term su = d_solver.mkTerm(SEQ_UNIT, d_solver.mkReal(1));
- ASSERT_THROW(su.getConstSequenceElements(), CVC4ApiException);
+ ASSERT_THROW(su.getConstSequenceElements(), CVC5ApiException);
}
TEST_F(TestApiBlackTerm, termScopedToString)
d_sout.reset(new std::stringstream);
d_options.set(options::in, d_sin.get());
d_options.set(options::out, d_sout.get());
- d_options.set(options::inputLanguage, language::input::LANG_CVC4);
+ d_options.set(options::inputLanguage, language::input::LANG_CVC);
d_solver.reset(new cvc5::api::Solver(&d_options));
d_symman.reset(new SymbolManager(d_solver.get()));
}
OR, fffx_eq_x, fffx_eq_y, fx_eq_gx, x_eq_y, fgx_eq_gy);
std::stringstream sstr;
- sstr << Node::setdepth(-1) << Node::setlanguage(language::output::LANG_CVC4);
+ sstr << Node::setdepth(-1) << Node::setlanguage(language::output::LANG_CVC);
sstr << Node::dag(false) << n; // never dagify
ASSERT_EQ(sstr.str(),
"(f(f(f(x))) = x) OR (f(f(f(x))) = y) OR (f(x) = g(x)) OR (x = "
class TestParserBlackCvCParser : public TestParserBlackParser
{
protected:
- TestParserBlackCvCParser() : TestParserBlackParser(LANG_CVC4) {}
+ TestParserBlackCvCParser() : TestParserBlackParser(LANG_CVC) {}
};
TEST_F(TestParserBlackCvCParser, good_inputs)
ASSERT_NE(filename, nullptr);
checkEmptyInput(ParserBuilder(&d_solver, d_symman.get(), filename)
- .withInputLanguage(LANG_CVC4));
+ .withInputLanguage(LANG_CVC));
remove(filename);
free(filename);
fs.close();
checkTrueInput(ParserBuilder(&d_solver, d_symman.get(), filename)
- .withInputLanguage(LANG_CVC4));
+ .withInputLanguage(LANG_CVC));
remove(filename);
free(filename);
TEST_F(TestParseBlackParserBuilder, empty_string_input)
{
checkEmptyInput(ParserBuilder(&d_solver, d_symman.get(), "foo")
- .withInputLanguage(LANG_CVC4)
+ .withInputLanguage(LANG_CVC)
.withStringInput(""));
}
TEST_F(TestParseBlackParserBuilder, true_string_input)
{
checkTrueInput(ParserBuilder(&d_solver, d_symman.get(), "foo")
- .withInputLanguage(LANG_CVC4)
+ .withInputLanguage(LANG_CVC)
.withStringInput("TRUE"));
}
{
std::stringstream ss("", std::ios_base::in);
checkEmptyInput(ParserBuilder(&d_solver, d_symman.get(), "foo")
- .withInputLanguage(LANG_CVC4)
+ .withInputLanguage(LANG_CVC)
.withStreamInput(ss));
}
{
std::stringstream ss("TRUE", std::ios_base::in);
checkTrueInput(ParserBuilder(&d_solver, d_symman.get(), "foo")
- .withInputLanguage(LANG_CVC4)
+ .withInputLanguage(LANG_CVC)
.withStreamInput(ss));
}
// (singleton (singleton_op Int) 1)
// (as emptyset (Set Real)))
ASSERT_THROW(d_solver.mkTerm(UNION, singletonInt, emptyReal),
- CVC4ApiException);
+ CVC5ApiException);
// (union
// (singleton (singleton_op Real) 1)
// (as emptyset (Set Real)))
Assert(BooleanSimplification::DUPLICATE_REMOVAL_THRESHOLD >= 10);
std::cout << expr::ExprSetDepth(-1)
- << language::SetLanguage(language::output::LANG_CVC4);
+ << language::SetLanguage(language::output::LANG_CVC);
}
// assert equality up to commuting children
Debug.on("foo");
Debug("foo") << "testing3";
- CVC4Message() << "a message";
+ CVC5Message() << "a message";
Warning() << "bad warning!";
Chat() << "chatty";
Notice() << "note";
ASSERT_FALSE(Debug.isOn("foo"));
ASSERT_FALSE(Trace.isOn("foo"));
ASSERT_FALSE(Warning.isOn());
- ASSERT_FALSE(CVC4Message.isOn());
+ ASSERT_FALSE(CVC5Message.isOn());
ASSERT_FALSE(Notice.isOn());
ASSERT_FALSE(Chat.isOn());
cout << "warning" << std::endl;
Warning() << failure() << std::endl;
cout << "message" << std::endl;
- CVC4Message() << failure() << std::endl;
+ CVC5Message() << failure() << std::endl;
cout << "notice" << std::endl;
Notice() << failure() << std::endl;
cout << "chat" << std::endl;
ASSERT_EQ(d_chatStream.str(), std::string());
d_chatStream.str("");
- CVC4Message() << "baz foo";
+ CVC5Message() << "baz foo";
ASSERT_EQ(d_messageStream.str(), std::string());
d_messageStream.str("");
ASSERT_EQ(d_chatStream.str(), std::string("baz foo"));
d_chatStream.str("");
- CVC4Message() << "baz foo";
+ CVC5Message() << "baz foo";
ASSERT_EQ(d_messageStream.str(), std::string("baz foo"));
d_messageStream.str("");