CVC4_API_SOLVER_TRY_CATCH_END;
}
-Term Solver::mkReal(const char* s) const
-{
- CVC4_API_SOLVER_TRY_CATCH_BEGIN;
- CVC4_API_ARG_CHECK_NOT_NULLPTR(s);
-
- return mkRealFromStrHelper(std::string(s));
-
- CVC4_API_SOLVER_TRY_CATCH_END;
-}
-
Term Solver::mkReal(const std::string& s) const
{
CVC4_API_SOLVER_TRY_CATCH_BEGIN;
CVC4_API_SOLVER_TRY_CATCH_END;
}
-Term Solver::mkReal(int32_t val) const
-{
- CVC4_API_SOLVER_TRY_CATCH_BEGIN;
- return mkValHelper<CVC4::Rational>(CVC4::Rational(val));
- CVC4_API_SOLVER_TRY_CATCH_END;
-}
-
Term Solver::mkReal(int64_t val) const
{
CVC4_API_SOLVER_TRY_CATCH_BEGIN;
CVC4_API_SOLVER_TRY_CATCH_END;
}
-Term Solver::mkReal(uint32_t val) const
-{
- CVC4_API_SOLVER_TRY_CATCH_BEGIN;
- return mkValHelper<CVC4::Rational>(CVC4::Rational(val));
- CVC4_API_SOLVER_TRY_CATCH_END;
-}
-
-Term Solver::mkReal(uint64_t val) const
-{
- CVC4_API_SOLVER_TRY_CATCH_BEGIN;
- return mkValHelper<CVC4::Rational>(CVC4::Rational(val));
- CVC4_API_SOLVER_TRY_CATCH_END;
-}
-
-Term Solver::mkReal(int32_t num, int32_t den) const
-{
- CVC4_API_SOLVER_TRY_CATCH_BEGIN;
- return mkValHelper<CVC4::Rational>(CVC4::Rational(num, den));
- CVC4_API_SOLVER_TRY_CATCH_END;
-}
-
Term Solver::mkReal(int64_t num, int64_t den) const
{
CVC4_API_SOLVER_TRY_CATCH_BEGIN;
CVC4_API_SOLVER_TRY_CATCH_END;
}
-Term Solver::mkReal(uint32_t num, uint32_t den) const
-{
- CVC4_API_SOLVER_TRY_CATCH_BEGIN;
- return mkValHelper<CVC4::Rational>(CVC4::Rational(num, den));
- CVC4_API_SOLVER_TRY_CATCH_END;
-}
-
-Term Solver::mkReal(uint64_t num, uint64_t den) const
-{
- CVC4_API_SOLVER_TRY_CATCH_BEGIN;
- return mkValHelper<CVC4::Rational>(CVC4::Rational(num, den));
- CVC4_API_SOLVER_TRY_CATCH_END;
-}
-
Term Solver::mkRegexpEmpty() const
{
CVC4_API_SOLVER_TRY_CATCH_BEGIN;
CVC4_API_SOLVER_TRY_CATCH_END;
}
-Term Solver::mkString(const char* s, bool useEscSequences) const
-{
- CVC4_API_SOLVER_TRY_CATCH_BEGIN;
- return mkValHelper<CVC4::String>(CVC4::String(s, useEscSequences));
- CVC4_API_SOLVER_TRY_CATCH_END;
-}
-
Term Solver::mkString(const std::string& s, bool useEscSequences) const
{
CVC4_API_SOLVER_TRY_CATCH_BEGIN;
CVC4_API_SOLVER_TRY_CATCH_END;
}
-Term Solver::mkChar(const char* s) const
-{
- CVC4_API_SOLVER_TRY_CATCH_BEGIN;
- CVC4_API_ARG_CHECK_NOT_NULLPTR(s);
- return mkCharFromStrHelper(std::string(s));
- CVC4_API_SOLVER_TRY_CATCH_END;
-}
-
Term Solver::mkEmptySequence(Sort sort) const
{
CVC4_API_SOLVER_TRY_CATCH_BEGIN;
CVC4_API_SOLVER_TRY_CATCH_END;
}
-Term Solver::mkBitVector(const char* s, uint32_t base) const
-{
- CVC4_API_SOLVER_TRY_CATCH_BEGIN;
- CVC4_API_ARG_CHECK_NOT_NULLPTR(s);
-
- return mkBVFromStrHelper(std::string(s), base);
-
- CVC4_API_SOLVER_TRY_CATCH_END;
-}
-
Term Solver::mkBitVector(const std::string& s, uint32_t base) const
{
CVC4_API_SOLVER_TRY_CATCH_BEGIN;
CVC4_API_SOLVER_TRY_CATCH_END;
}
-Term Solver::mkBitVector(uint32_t size, const char* s, uint32_t base) const
-{
- CVC4_API_SOLVER_TRY_CATCH_BEGIN;
- CVC4_API_ARG_CHECK_NOT_NULLPTR(s);
- return mkBVFromStrHelper(size, s, base);
- CVC4_API_SOLVER_TRY_CATCH_END;
-}
-
-Term Solver::mkBitVector(uint32_t size, std::string& s, uint32_t base) const
+Term Solver::mkBitVector(uint32_t size,
+ const std::string& s,
+ uint32_t base) const
{
CVC4_API_SOLVER_TRY_CATCH_BEGIN;
return mkBVFromStrHelper(size, s, base);
*/
Term mkPi() const;
- /**
- * Create a real constant from a string.
- * @param s the string representation of the constant, may represent an
- * integer (e.g., "123") or real constant (e.g., "12.34" or "12/34").
- * @return a constant of sort Real or Integer (if 's' represents an integer)
- */
- Term mkReal(const char* s) const;
-
/**
* Create a real constant from a string.
* @param s the string representation of the constant, may represent an
*/
Term mkReal(const std::string& s) const;
- /**
- * Create a real constant from an integer.
- * @param val the value of the constant
- * @return a constant of sort Integer
- */
- Term mkReal(int32_t val) const;
-
/**
* Create a real constant from an integer.
* @param val the value of the constant
*/
Term mkReal(int64_t val) const;
- /**
- * Create a real constant from an unsigned integer.
- * @param val the value of the constant
- * @return a constant of sort Integer
- */
- Term mkReal(uint32_t val) const;
-
- /**
- * Create a real constant from an unsigned integer.
- * @param val the value of the constant
- * @return a constant of sort Integer
- */
- Term mkReal(uint64_t val) const;
-
- /**
- * Create a real constant from a rational.
- * @param num the value of the numerator
- * @param den the value of the denominator
- * @return a constant of sort Real or Integer (if 'num' is divisible by 'den')
- */
- Term mkReal(int32_t num, int32_t den) const;
-
/**
* Create a real constant from a rational.
* @param num the value of the numerator
*/
Term mkReal(int64_t num, int64_t den) const;
- /**
- * Create a real constant from a rational.
- * @param num the value of the numerator
- * @param den the value of the denominator
- * @return a constant of sort Real or Integer (if 'num' is divisible by 'den')
- */
- Term mkReal(uint32_t num, uint32_t den) const;
-
- /**
- * Create a real constant from a rational.
- * @param num the value of the numerator
- * @param den the value of the denominator
- * @return a constant of sort Real or Integer (if 'num' is divisible by 'den')
- */
- Term mkReal(uint64_t num, uint64_t den) const;
-
/**
* Create a regular expression empty term.
* @return the empty term
*/
Term mkSepNil(Sort sort) const;
- /**
- * Create a String constant.
- * @param s the string this constant represents
- * @param useEscSequences determines whether escape sequences in \p s should
- * be converted to the corresponding character
- * @return the String constant
- */
- Term mkString(const char* s, bool useEscSequences = false) const;
-
/**
* Create a String constant.
* @param s the string this constant represents
*/
Term mkChar(const std::string& s) const;
- /**
- * Create a character constant from a given string.
- * @param s the string denoting the code point of the character (in base 16)
- * @return the character constant
- */
- Term mkChar(const char* s) const;
-
/**
* Create an empty sequence of the given element sort.
* @param sort The element sort of the sequence.
*/
Term mkBitVector(uint32_t size, uint64_t val = 0) const;
- /**
- * Create a bit-vector constant from a given string.
- * @param s the string representation of the constant
- * @param base the base of the string representation (2, 10, or 16)
- * @return the bit-vector constant
- */
- Term mkBitVector(const char* s, uint32_t base = 2) const;
-
/**
* Create a bit-vector constant from a given string of base 2, 10 or 16.
*
*/
Term mkBitVector(const std::string& s, uint32_t base = 2) const;
- /**
- * Create a bit-vector constant of a given bit-width from a given string of
- * base 2, 10 or 16.
- *
- * @param size the bit-width of the constant
- * @param s the string representation of the constant
- * @param base the base of the string representation (2, 10, or 16)
- * @return the bit-vector constant
- */
- Term mkBitVector(uint32_t size, const char* s, uint32_t base) const;
-
/**
* Create a bit-vector constant of a given bit-width from a given string of
* base 2, 10 or 16.
* @param base the base of the string representation (2, 10, or 16)
* @return the bit-vector constant
*/
- Term mkBitVector(uint32_t size, std::string& s, uint32_t base) const;
+ Term mkBitVector(uint32_t size, const std::string& s, uint32_t base) const;
/**
* Create a constant array with the provided constant value stored at every
TS_ASSERT_THROWS_NOTHING(d_solver->mkReal("12/3"));
TS_ASSERT_THROWS_NOTHING(d_solver->mkReal(".2"));
TS_ASSERT_THROWS_NOTHING(d_solver->mkReal("2."));
- TS_ASSERT_THROWS(d_solver->mkReal(nullptr), CVC4ApiException&);
TS_ASSERT_THROWS(d_solver->mkReal(""), CVC4ApiException&);
TS_ASSERT_THROWS(d_solver->mkReal("asdf"), CVC4ApiException&);
TS_ASSERT_THROWS(d_solver->mkReal("1.2/3"), CVC4ApiException&);
{
TS_ASSERT_THROWS_NOTHING(d_solver->mkChar(std::string("0123")));
TS_ASSERT_THROWS_NOTHING(d_solver->mkChar("aA"));
- TS_ASSERT_THROWS(d_solver->mkChar(nullptr), CVC4ApiException&);
TS_ASSERT_THROWS(d_solver->mkChar(""), CVC4ApiException&);
TS_ASSERT_THROWS(d_solver->mkChar("0g0"), CVC4ApiException&);
TS_ASSERT_THROWS(d_solver->mkChar("100000"), CVC4ApiException&);