#include "api/cvc4cpp.h"
+#include "base/configuration.h"
#include "base/cvc4_assert.h"
#include "base/cvc4_check.h"
#include "expr/expr.h"
Term Solver::mkConst(Kind kind, uint32_t arg1, uint32_t arg2, Term arg3) const
{
+ CVC4_API_CHECK(Configuration::isBuiltWithSymFPU())
+ << "Expected CVC4 to be compiled with SymFPU support";
CVC4_API_KIND_CHECK_EXPECTED(kind == CONST_FLOATINGPOINT, kind)
<< "CONST_FLOATINGPOINT";
CVC4_API_ARG_CHECK_EXPECTED(arg1 > 0, arg1) << "a value > 0";
* @param val the value of the constant
* @return the bit-vector constant
*/
- Term mkBitVector(uint32_t size, uint64_t val) const;
+ Term mkBitVector(uint32_t size, uint64_t val = 0) const;
/**
* Create a bit-vector constant from a given string.
/**
* Create constant of kind:
- * - CONST_FLOATINGPOINT
+ * - CONST_FLOATINGPOINT (requires CVC4 to be compiled with symFPU support)
* See enum Kind for a description of the parameters.
* @param kind the kind of the constant
* @param arg1 the first argument to this kind
#include <cxxtest/TestSuite.h>
#include "api/cvc4cpp.h"
+#include "base/configuration.h"
using namespace CVC4::api;
TS_ASSERT_THROWS_NOTHING(d_solver.mkConst(CONST_BITVECTOR, val2, val2));
// mkConst(Kind kind, uint32_t arg1, uint32_t arg2, Term arg3) const
-#ifdef CVC4_USE_SYMFPU
Term t1 = d_solver.mkBitVector(8);
Term t2 = d_solver.mkBitVector(4);
Term t3 = d_solver.mkReal(2);
- TS_ASSERT_THROWS_NOTHING(d_solver.mkConst(CONST_FLOATINGPOINT, 3, 5, t1));
+ if (CVC4::Configuration::isBuiltWithSymFPU())
+ {
+ TS_ASSERT_THROWS_NOTHING(d_solver.mkConst(CONST_FLOATINGPOINT, 3, 5, t1));
+ }
+ else
+ {
+ TS_ASSERT_THROWS(d_solver.mkConst(CONST_FLOATINGPOINT, 3, 5, t1),
+ CVC4ApiException&);
+ }
TS_ASSERT_THROWS(d_solver.mkConst(CONST_FLOATINGPOINT, 0, 5, Term()),
CVC4ApiException&);
TS_ASSERT_THROWS(d_solver.mkConst(CONST_FLOATINGPOINT, 0, 5, t1),
CVC4ApiException&);
TS_ASSERT_THROWS(d_solver.mkConst(CONST_BITVECTOR, 3, 5, t1),
CVC4ApiException&);
-#endif
}
void SolverBlack::testMkEmptySet()