namespace test {
-class TestApiSolverBlack : public TestApi
+class TestApiBlackSolver : public TestApi
{
};
-TEST_F(TestApiSolverBlack, recoverableException)
+TEST_F(TestApiBlackSolver, recoverableException)
{
d_solver.setOption("produce-models", "true");
Term x = d_solver.mkConst(d_solver.getBooleanSort(), "x");
ASSERT_THROW(d_solver.getValue(x), CVC4ApiRecoverableException);
}
-TEST_F(TestApiSolverBlack, supportsFloatingPoint)
+TEST_F(TestApiBlackSolver, supportsFloatingPoint)
{
if (d_solver.supportsFloatingPoint())
{
}
}
-TEST_F(TestApiSolverBlack, getBooleanSort)
+TEST_F(TestApiBlackSolver, getBooleanSort)
{
ASSERT_NO_THROW(d_solver.getBooleanSort());
}
-TEST_F(TestApiSolverBlack, getIntegerSort)
+TEST_F(TestApiBlackSolver, getIntegerSort)
{
ASSERT_NO_THROW(d_solver.getIntegerSort());
}
-TEST_F(TestApiSolverBlack, getNullSort)
+TEST_F(TestApiBlackSolver, getNullSort)
{
ASSERT_NO_THROW(d_solver.getNullSort());
}
-TEST_F(TestApiSolverBlack, getRealSort)
+TEST_F(TestApiBlackSolver, getRealSort)
{
ASSERT_NO_THROW(d_solver.getRealSort());
}
-TEST_F(TestApiSolverBlack, getRegExpSort)
+TEST_F(TestApiBlackSolver, getRegExpSort)
{
ASSERT_NO_THROW(d_solver.getRegExpSort());
}
-TEST_F(TestApiSolverBlack, getStringSort)
+TEST_F(TestApiBlackSolver, getStringSort)
{
ASSERT_NO_THROW(d_solver.getStringSort());
}
-TEST_F(TestApiSolverBlack, getRoundingModeSort)
+TEST_F(TestApiBlackSolver, getRoundingModeSort)
{
if (d_solver.supportsFloatingPoint())
{
}
}
-TEST_F(TestApiSolverBlack, mkArraySort)
+TEST_F(TestApiBlackSolver, mkArraySort)
{
Sort boolSort = d_solver.getBooleanSort();
Sort intSort = d_solver.getIntegerSort();
ASSERT_THROW(slv.mkArraySort(boolSort, boolSort), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, mkBitVectorSort)
+TEST_F(TestApiBlackSolver, mkBitVectorSort)
{
ASSERT_NO_THROW(d_solver.mkBitVectorSort(32));
ASSERT_THROW(d_solver.mkBitVectorSort(0), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, mkFloatingPointSort)
+TEST_F(TestApiBlackSolver, mkFloatingPointSort)
{
if (d_solver.supportsFloatingPoint())
{
}
}
-TEST_F(TestApiSolverBlack, mkDatatypeSort)
+TEST_F(TestApiBlackSolver, mkDatatypeSort)
{
DatatypeDecl dtypeSpec = d_solver.mkDatatypeDecl("list");
DatatypeConstructorDecl cons = d_solver.mkDatatypeConstructorDecl("cons");
ASSERT_THROW(d_solver.mkDatatypeSort(throwsDtypeSpec), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, mkDatatypeSorts)
+TEST_F(TestApiBlackSolver, mkDatatypeSorts)
{
Solver slv;
/* Note: More tests are in datatype_api_black. */
}
-TEST_F(TestApiSolverBlack, mkFunctionSort)
+TEST_F(TestApiBlackSolver, mkFunctionSort)
{
ASSERT_NO_THROW(d_solver.mkFunctionSort(d_solver.mkUninterpretedSort("u"),
d_solver.getIntegerSort()));
CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, mkParamSort)
+TEST_F(TestApiBlackSolver, mkParamSort)
{
ASSERT_NO_THROW(d_solver.mkParamSort("T"));
ASSERT_NO_THROW(d_solver.mkParamSort(""));
}
-TEST_F(TestApiSolverBlack, mkPredicateSort)
+TEST_F(TestApiBlackSolver, mkPredicateSort)
{
ASSERT_NO_THROW(d_solver.mkPredicateSort({d_solver.getIntegerSort()}));
ASSERT_THROW(d_solver.mkPredicateSort({}), CVC4ApiException);
CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, mkRecordSort)
+TEST_F(TestApiBlackSolver, mkRecordSort)
{
std::vector<std::pair<std::string, Sort>> fields = {
std::make_pair("b", d_solver.getBooleanSort()),
ASSERT_THROW(slv.mkRecordSort(fields), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, mkSetSort)
+TEST_F(TestApiBlackSolver, mkSetSort)
{
ASSERT_NO_THROW(d_solver.mkSetSort(d_solver.getBooleanSort()));
ASSERT_NO_THROW(d_solver.mkSetSort(d_solver.getIntegerSort()));
ASSERT_THROW(slv.mkSetSort(d_solver.mkBitVectorSort(4)), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, mkBagSort)
+TEST_F(TestApiBlackSolver, mkBagSort)
{
ASSERT_NO_THROW(d_solver.mkBagSort(d_solver.getBooleanSort()));
ASSERT_NO_THROW(d_solver.mkBagSort(d_solver.getIntegerSort()));
ASSERT_THROW(slv.mkBagSort(d_solver.mkBitVectorSort(4)), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, mkSequenceSort)
+TEST_F(TestApiBlackSolver, mkSequenceSort)
{
ASSERT_NO_THROW(d_solver.mkSequenceSort(d_solver.getBooleanSort()));
ASSERT_NO_THROW(d_solver.mkSequenceSort(
ASSERT_THROW(slv.mkSequenceSort(d_solver.getIntegerSort()), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, mkUninterpretedSort)
+TEST_F(TestApiBlackSolver, mkUninterpretedSort)
{
ASSERT_NO_THROW(d_solver.mkUninterpretedSort("u"));
ASSERT_NO_THROW(d_solver.mkUninterpretedSort(""));
}
-TEST_F(TestApiSolverBlack, mkSortConstructorSort)
+TEST_F(TestApiBlackSolver, mkSortConstructorSort)
{
ASSERT_NO_THROW(d_solver.mkSortConstructorSort("s", 2));
ASSERT_NO_THROW(d_solver.mkSortConstructorSort("", 2));
ASSERT_THROW(d_solver.mkSortConstructorSort("", 0), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, mkTupleSort)
+TEST_F(TestApiBlackSolver, mkTupleSort)
{
ASSERT_NO_THROW(d_solver.mkTupleSort({d_solver.getIntegerSort()}));
Sort funSort = d_solver.mkFunctionSort(d_solver.mkUninterpretedSort("u"),
ASSERT_THROW(slv.mkTupleSort({d_solver.getIntegerSort()}), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, mkBitVector)
+TEST_F(TestApiBlackSolver, mkBitVector)
{
uint32_t size0 = 0, size1 = 8, size2 = 32, val1 = 2;
uint64_t val2 = 2;
d_solver.mkBitVector(8, "FF", 16));
}
-TEST_F(TestApiSolverBlack, mkVar)
+TEST_F(TestApiBlackSolver, mkVar)
{
Sort boolSort = d_solver.getBooleanSort();
Sort intSort = d_solver.getIntegerSort();
ASSERT_THROW(slv.mkVar(boolSort, "x"), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, mkBoolean)
+TEST_F(TestApiBlackSolver, mkBoolean)
{
ASSERT_NO_THROW(d_solver.mkBoolean(true));
ASSERT_NO_THROW(d_solver.mkBoolean(false));
}
-TEST_F(TestApiSolverBlack, mkRoundingMode)
+TEST_F(TestApiBlackSolver, mkRoundingMode)
{
if (CVC4::Configuration::isBuiltWithSymFPU())
{
}
}
-TEST_F(TestApiSolverBlack, mkUninterpretedConst)
+TEST_F(TestApiBlackSolver, mkUninterpretedConst)
{
ASSERT_NO_THROW(d_solver.mkUninterpretedConst(d_solver.getBooleanSort(), 1));
ASSERT_THROW(d_solver.mkUninterpretedConst(Sort(), 1), CVC4ApiException);
CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, mkAbstractValue)
+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(0), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, mkFloatingPoint)
+TEST_F(TestApiBlackSolver, mkFloatingPoint)
{
Term t1 = d_solver.mkBitVector(8);
Term t2 = d_solver.mkBitVector(4);
}
}
-TEST_F(TestApiSolverBlack, mkEmptySet)
+TEST_F(TestApiBlackSolver, mkEmptySet)
{
Solver slv;
Sort s = d_solver.mkSetSort(d_solver.getBooleanSort());
ASSERT_THROW(slv.mkEmptySet(s), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, mkEmptyBag)
+TEST_F(TestApiBlackSolver, mkEmptyBag)
{
Solver slv;
Sort s = d_solver.mkBagSort(d_solver.getBooleanSort());
ASSERT_THROW(slv.mkEmptyBag(s), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, mkEmptySequence)
+TEST_F(TestApiBlackSolver, mkEmptySequence)
{
Solver slv;
Sort s = d_solver.mkSequenceSort(d_solver.getBooleanSort());
ASSERT_THROW(slv.mkEmptySequence(s), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, mkFalse)
+TEST_F(TestApiBlackSolver, mkFalse)
{
ASSERT_NO_THROW(d_solver.mkFalse());
ASSERT_NO_THROW(d_solver.mkFalse());
}
-TEST_F(TestApiSolverBlack, mkNaN)
+TEST_F(TestApiBlackSolver, mkNaN)
{
if (CVC4::Configuration::isBuiltWithSymFPU())
{
}
}
-TEST_F(TestApiSolverBlack, mkNegZero)
+TEST_F(TestApiBlackSolver, mkNegZero)
{
if (CVC4::Configuration::isBuiltWithSymFPU())
{
}
}
-TEST_F(TestApiSolverBlack, mkNegInf)
+TEST_F(TestApiBlackSolver, mkNegInf)
{
if (CVC4::Configuration::isBuiltWithSymFPU())
{
}
}
-TEST_F(TestApiSolverBlack, mkPosInf)
+TEST_F(TestApiBlackSolver, mkPosInf)
{
if (CVC4::Configuration::isBuiltWithSymFPU())
{
}
}
-TEST_F(TestApiSolverBlack, mkPosZero)
+TEST_F(TestApiBlackSolver, mkPosZero)
{
if (CVC4::Configuration::isBuiltWithSymFPU())
{
}
}
-TEST_F(TestApiSolverBlack, mkOp)
+TEST_F(TestApiBlackSolver, mkOp)
{
// mkOp(Kind kind, Kind k)
ASSERT_THROW(d_solver.mkOp(BITVECTOR_EXTRACT, EQUAL), CVC4ApiException);
ASSERT_THROW(d_solver.mkOp(DIVISIBLE, 1, 2), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, mkPi) { ASSERT_NO_THROW(d_solver.mkPi()); }
+TEST_F(TestApiBlackSolver, mkPi) { ASSERT_NO_THROW(d_solver.mkPi()); }
-TEST_F(TestApiSolverBlack, mkInteger)
+TEST_F(TestApiBlackSolver, mkInteger)
{
ASSERT_NO_THROW(d_solver.mkInteger("123"));
ASSERT_THROW(d_solver.mkInteger("1.23"), CVC4ApiException);
ASSERT_NO_THROW(d_solver.mkInteger(val4));
}
-TEST_F(TestApiSolverBlack, mkReal)
+TEST_F(TestApiBlackSolver, mkReal)
{
ASSERT_NO_THROW(d_solver.mkReal("123"));
ASSERT_NO_THROW(d_solver.mkReal("1.23"));
ASSERT_NO_THROW(d_solver.mkReal(val4, val4));
}
-TEST_F(TestApiSolverBlack, mkRegexpEmpty)
+TEST_F(TestApiBlackSolver, mkRegexpEmpty)
{
Sort strSort = d_solver.getStringSort();
Term s = d_solver.mkConst(strSort, "s");
d_solver.mkTerm(STRING_IN_REGEXP, s, d_solver.mkRegexpEmpty()));
}
-TEST_F(TestApiSolverBlack, mkRegexpSigma)
+TEST_F(TestApiBlackSolver, mkRegexpSigma)
{
Sort strSort = d_solver.getStringSort();
Term s = d_solver.mkConst(strSort, "s");
d_solver.mkTerm(STRING_IN_REGEXP, s, d_solver.mkRegexpSigma()));
}
-TEST_F(TestApiSolverBlack, mkSepNil)
+TEST_F(TestApiBlackSolver, mkSepNil)
{
ASSERT_NO_THROW(d_solver.mkSepNil(d_solver.getBooleanSort()));
ASSERT_THROW(d_solver.mkSepNil(Sort()), CVC4ApiException);
ASSERT_THROW(slv.mkSepNil(d_solver.getIntegerSort()), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, mkString)
+TEST_F(TestApiBlackSolver, mkString)
{
ASSERT_NO_THROW(d_solver.mkString(""));
ASSERT_NO_THROW(d_solver.mkString("asdfasdf"));
"\"asdf\\u{5c}nasdf\"");
}
-TEST_F(TestApiSolverBlack, mkChar)
+TEST_F(TestApiBlackSolver, mkChar)
{
ASSERT_NO_THROW(d_solver.mkChar(std::string("0123")));
ASSERT_NO_THROW(d_solver.mkChar("aA"));
ASSERT_EQ(d_solver.mkChar("abc"), d_solver.mkChar("ABC"));
}
-TEST_F(TestApiSolverBlack, mkTerm)
+TEST_F(TestApiBlackSolver, mkTerm)
{
Sort bv32 = d_solver.mkBitVectorSort(32);
Term a = d_solver.mkConst(bv32, "a");
ASSERT_THROW(d_solver.mkTerm(DISTINCT, v6), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, mkTermFromOp)
+TEST_F(TestApiBlackSolver, mkTermFromOp)
{
Sort bv32 = d_solver.mkBitVectorSort(32);
Term a = d_solver.mkConst(bv32, "a");
ASSERT_THROW(slv.mkTerm(opterm2, v4), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, mkTrue)
+TEST_F(TestApiBlackSolver, mkTrue)
{
ASSERT_NO_THROW(d_solver.mkTrue());
ASSERT_NO_THROW(d_solver.mkTrue());
}
-TEST_F(TestApiSolverBlack, mkTuple)
+TEST_F(TestApiBlackSolver, mkTuple)
{
ASSERT_NO_THROW(d_solver.mkTuple({d_solver.mkBitVectorSort(3)},
{d_solver.mkBitVector("101", 2)}));
CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, mkUniverseSet)
+TEST_F(TestApiBlackSolver, mkUniverseSet)
{
ASSERT_NO_THROW(d_solver.mkUniverseSet(d_solver.getBooleanSort()));
ASSERT_THROW(d_solver.mkUniverseSet(Sort()), CVC4ApiException);
ASSERT_THROW(slv.mkUniverseSet(d_solver.getBooleanSort()), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, mkConst)
+TEST_F(TestApiBlackSolver, mkConst)
{
Sort boolSort = d_solver.getBooleanSort();
Sort intSort = d_solver.getIntegerSort();
ASSERT_THROW(slv.mkConst(boolSort), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, mkConstArray)
+TEST_F(TestApiBlackSolver, mkConstArray)
{
Sort intSort = d_solver.getIntegerSort();
Sort arrSort = d_solver.mkArraySort(intSort, intSort);
ASSERT_THROW(slv.mkConstArray(arrSort, zero2), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, declareDatatype)
+TEST_F(TestApiBlackSolver, declareDatatype)
{
DatatypeConstructorDecl nil = d_solver.mkDatatypeConstructorDecl("nil");
std::vector<DatatypeConstructorDecl> ctors1 = {nil};
ASSERT_THROW(slv.declareDatatype(std::string("a"), ctors1), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, declareFun)
+TEST_F(TestApiBlackSolver, declareFun)
{
Sort bvSort = d_solver.mkBitVectorSort(32);
Sort funSort = d_solver.mkFunctionSort(d_solver.mkUninterpretedSort("u"),
ASSERT_THROW(slv.declareFun("f1", {}, bvSort), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, declareSort)
+TEST_F(TestApiBlackSolver, declareSort)
{
ASSERT_NO_THROW(d_solver.declareSort("s", 0));
ASSERT_NO_THROW(d_solver.declareSort("s", 2));
ASSERT_NO_THROW(d_solver.declareSort("", 2));
}
-TEST_F(TestApiSolverBlack, defineSort)
+TEST_F(TestApiBlackSolver, defineSort)
{
Sort sortVar0 = d_solver.mkParamSort("T0");
Sort sortVar1 = d_solver.mkParamSort("T1");
ASSERT_NO_THROW(arraySort1.substitute({sortVar0, sortVar1}, {intSort, realSort}));
}
-TEST_F(TestApiSolverBlack, defineFun)
+TEST_F(TestApiBlackSolver, defineFun)
{
Sort bvSort = d_solver.mkBitVectorSort(32);
Sort funSort1 = d_solver.mkFunctionSort({bvSort, bvSort}, bvSort);
ASSERT_THROW(slv.defineFun("ff", {b12, b22}, bvSort2, v1), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, defineFunGlobal)
+TEST_F(TestApiBlackSolver, defineFunGlobal)
{
Sort bSort = d_solver.getBooleanSort();
Sort fSort = d_solver.mkFunctionSort(bSort, bSort);
ASSERT_TRUE(d_solver.checkSat().isUnsat());
}
-TEST_F(TestApiSolverBlack, defineFunRec)
+TEST_F(TestApiBlackSolver, defineFunRec)
{
Sort bvSort = d_solver.mkBitVectorSort(32);
Sort funSort1 = d_solver.mkFunctionSort({bvSort, bvSort}, bvSort);
CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, defineFunRecWrongLogic)
+TEST_F(TestApiBlackSolver, defineFunRecWrongLogic)
{
d_solver.setLogic("QF_BV");
Sort bvSort = d_solver.mkBitVectorSort(32);
ASSERT_THROW(d_solver.defineFunRec(f, {b, b}, v), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, defineFunRecGlobal)
+TEST_F(TestApiBlackSolver, defineFunRecGlobal)
{
Sort bSort = d_solver.getBooleanSort();
Sort fSort = d_solver.mkFunctionSort(bSort, bSort);
ASSERT_TRUE(d_solver.checkSat().isUnsat());
}
-TEST_F(TestApiSolverBlack, defineFunsRec)
+TEST_F(TestApiBlackSolver, defineFunsRec)
{
Sort uSort = d_solver.mkUninterpretedSort("u");
Sort bvSort = d_solver.mkBitVectorSort(32);
CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, defineFunsRecWrongLogic)
+TEST_F(TestApiBlackSolver, defineFunsRecWrongLogic)
{
d_solver.setLogic("QF_BV");
Sort uSort = d_solver.mkUninterpretedSort("u");
CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, defineFunsRecGlobal)
+TEST_F(TestApiBlackSolver, defineFunsRecGlobal)
{
Sort bSort = d_solver.getBooleanSort();
Sort fSort = d_solver.mkFunctionSort(bSort, bSort);
ASSERT_TRUE(d_solver.checkSat().isUnsat());
}
-TEST_F(TestApiSolverBlack, uFIteration)
+TEST_F(TestApiBlackSolver, uFIteration)
{
Sort intSort = d_solver.getIntegerSort();
Sort funSort = d_solver.mkFunctionSort({intSort, intSort}, intSort);
}
}
-TEST_F(TestApiSolverBlack, getInfo)
+TEST_F(TestApiBlackSolver, getInfo)
{
ASSERT_NO_THROW(d_solver.getInfo("name"));
ASSERT_THROW(d_solver.getInfo("asdf"), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, getInterpolant)
+TEST_F(TestApiBlackSolver, getInterpolant)
{
d_solver.setOption("produce-interpols", "default");
d_solver.setOption("incremental", "false");
ASSERT_TRUE(output.getSort().isBoolean());
}
-TEST_F(TestApiSolverBlack, getOp)
+TEST_F(TestApiBlackSolver, getOp)
{
Sort bv32 = d_solver.mkBitVectorSort(32);
Term a = d_solver.mkConst(bv32, "a");
ASSERT_EQ(listhead.getOp(), Op(&d_solver, APPLY_SELECTOR));
}
-TEST_F(TestApiSolverBlack, getOption)
+TEST_F(TestApiBlackSolver, getOption)
{
ASSERT_NO_THROW(d_solver.getOption("incremental"));
ASSERT_THROW(d_solver.getOption("asdf"), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, getUnsatAssumptions1)
+TEST_F(TestApiBlackSolver, getUnsatAssumptions1)
{
#if IS_PROOFS_BUILD
d_solver.setOption("incremental", "false");
#endif
}
-TEST_F(TestApiSolverBlack, getUnsatAssumptions2)
+TEST_F(TestApiBlackSolver, getUnsatAssumptions2)
{
#if IS_PROOFS_BUILD
d_solver.setOption("incremental", "true");
#endif
}
-TEST_F(TestApiSolverBlack, getUnsatAssumptions3)
+TEST_F(TestApiBlackSolver, getUnsatAssumptions3)
{
#if IS_PROOFS_BUILD
d_solver.setOption("incremental", "true");
#endif
}
-TEST_F(TestApiSolverBlack, getUnsatCore1)
+TEST_F(TestApiBlackSolver, getUnsatCore1)
{
#if IS_PROOFS_BUILD
d_solver.setOption("incremental", "false");
#endif
}
-TEST_F(TestApiSolverBlack, getUnsatCore2)
+TEST_F(TestApiBlackSolver, getUnsatCore2)
{
#if IS_PROOFS_BUILD
d_solver.setOption("incremental", "false");
#endif
}
-TEST_F(TestApiSolverBlack, getUnsatCore3)
+TEST_F(TestApiBlackSolver, getUnsatCore3)
{
#if IS_PROOFS_BUILD
d_solver.setOption("incremental", "true");
#endif
}
-TEST_F(TestApiSolverBlack, getValue1)
+TEST_F(TestApiBlackSolver, getValue1)
{
d_solver.setOption("produce-models", "false");
Term t = d_solver.mkTrue();
ASSERT_THROW(d_solver.getValue(t), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, getValue2)
+TEST_F(TestApiBlackSolver, getValue2)
{
d_solver.setOption("produce-models", "true");
Term t = d_solver.mkFalse();
ASSERT_THROW(d_solver.getValue(t), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, getValue3)
+TEST_F(TestApiBlackSolver, getValue3)
{
d_solver.setOption("produce-models", "true");
Sort uSort = d_solver.mkUninterpretedSort("u");
ASSERT_THROW(slv.getValue(x), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, getQuantifierElimination)
+TEST_F(TestApiBlackSolver, getQuantifierElimination)
{
Term x = d_solver.mkVar(d_solver.getBooleanSort(), "x");
Term forall =
ASSERT_NO_THROW(d_solver.getQuantifierElimination(forall));
}
-TEST_F(TestApiSolverBlack, getQuantifierEliminationDisjunct)
+TEST_F(TestApiBlackSolver, getQuantifierEliminationDisjunct)
{
Term x = d_solver.mkVar(d_solver.getBooleanSort(), "x");
Term forall =
ASSERT_NO_THROW(d_solver.getQuantifierEliminationDisjunct(forall));
}
-TEST_F(TestApiSolverBlack, declareSeparationHeap)
+TEST_F(TestApiBlackSolver, declareSeparationHeap)
{
d_solver.setLogic("ALL_SUPPORTED");
Sort integer = d_solver.getIntegerSort();
}
} // namespace
-TEST_F(TestApiSolverBlack, getSeparationHeapTerm1)
+TEST_F(TestApiBlackSolver, getSeparationHeapTerm1)
{
d_solver.setLogic("QF_BV");
d_solver.setOption("incremental", "false");
ASSERT_THROW(d_solver.getSeparationHeap(), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, getSeparationHeapTerm2)
+TEST_F(TestApiBlackSolver, getSeparationHeapTerm2)
{
d_solver.setLogic("ALL_SUPPORTED");
d_solver.setOption("incremental", "false");
ASSERT_THROW(d_solver.getSeparationHeap(), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, getSeparationHeapTerm3)
+TEST_F(TestApiBlackSolver, getSeparationHeapTerm3)
{
d_solver.setLogic("ALL_SUPPORTED");
d_solver.setOption("incremental", "false");
ASSERT_THROW(d_solver.getSeparationHeap(), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, getSeparationHeapTerm4)
+TEST_F(TestApiBlackSolver, getSeparationHeapTerm4)
{
d_solver.setLogic("ALL_SUPPORTED");
d_solver.setOption("incremental", "false");
ASSERT_THROW(d_solver.getSeparationHeap(), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, getSeparationHeapTerm5)
+TEST_F(TestApiBlackSolver, getSeparationHeapTerm5)
{
d_solver.setLogic("ALL_SUPPORTED");
d_solver.setOption("incremental", "false");
ASSERT_NO_THROW(d_solver.getSeparationHeap());
}
-TEST_F(TestApiSolverBlack, getSeparationNilTerm1)
+TEST_F(TestApiBlackSolver, getSeparationNilTerm1)
{
d_solver.setLogic("QF_BV");
d_solver.setOption("incremental", "false");
ASSERT_THROW(d_solver.getSeparationNilTerm(), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, getSeparationNilTerm2)
+TEST_F(TestApiBlackSolver, getSeparationNilTerm2)
{
d_solver.setLogic("ALL_SUPPORTED");
d_solver.setOption("incremental", "false");
ASSERT_THROW(d_solver.getSeparationNilTerm(), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, getSeparationNilTerm3)
+TEST_F(TestApiBlackSolver, getSeparationNilTerm3)
{
d_solver.setLogic("ALL_SUPPORTED");
d_solver.setOption("incremental", "false");
ASSERT_THROW(d_solver.getSeparationNilTerm(), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, getSeparationNilTerm4)
+TEST_F(TestApiBlackSolver, getSeparationNilTerm4)
{
d_solver.setLogic("ALL_SUPPORTED");
d_solver.setOption("incremental", "false");
ASSERT_THROW(d_solver.getSeparationNilTerm(), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, getSeparationNilTerm5)
+TEST_F(TestApiBlackSolver, getSeparationNilTerm5)
{
d_solver.setLogic("ALL_SUPPORTED");
d_solver.setOption("incremental", "false");
ASSERT_NO_THROW(d_solver.getSeparationNilTerm());
}
-TEST_F(TestApiSolverBlack, push1)
+TEST_F(TestApiBlackSolver, push1)
{
d_solver.setOption("incremental", "true");
ASSERT_NO_THROW(d_solver.push(1));
ASSERT_THROW(d_solver.setOption("incremental", "true"), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, push2)
+TEST_F(TestApiBlackSolver, push2)
{
d_solver.setOption("incremental", "false");
ASSERT_THROW(d_solver.push(1), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, pop1)
+TEST_F(TestApiBlackSolver, pop1)
{
d_solver.setOption("incremental", "false");
ASSERT_THROW(d_solver.pop(1), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, pop2)
+TEST_F(TestApiBlackSolver, pop2)
{
d_solver.setOption("incremental", "true");
ASSERT_THROW(d_solver.pop(1), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, pop3)
+TEST_F(TestApiBlackSolver, pop3)
{
d_solver.setOption("incremental", "true");
ASSERT_NO_THROW(d_solver.push(1));
ASSERT_THROW(d_solver.pop(1), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, blockModel1)
+TEST_F(TestApiBlackSolver, blockModel1)
{
d_solver.setOption("produce-models", "true");
Term x = d_solver.mkConst(d_solver.getBooleanSort(), "x");
ASSERT_THROW(d_solver.blockModel(), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, blockModel2)
+TEST_F(TestApiBlackSolver, blockModel2)
{
d_solver.setOption("block-models", "literals");
Term x = d_solver.mkConst(d_solver.getBooleanSort(), "x");
ASSERT_THROW(d_solver.blockModel(), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, blockModel3)
+TEST_F(TestApiBlackSolver, blockModel3)
{
d_solver.setOption("produce-models", "true");
d_solver.setOption("block-models", "literals");
ASSERT_THROW(d_solver.blockModel(), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, blockModel4)
+TEST_F(TestApiBlackSolver, blockModel4)
{
d_solver.setOption("produce-models", "true");
d_solver.setOption("block-models", "literals");
ASSERT_NO_THROW(d_solver.blockModel());
}
-TEST_F(TestApiSolverBlack, blockModelValues1)
+TEST_F(TestApiBlackSolver, blockModelValues1)
{
d_solver.setOption("produce-models", "true");
d_solver.setOption("block-models", "literals");
CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, blockModelValues2)
+TEST_F(TestApiBlackSolver, blockModelValues2)
{
d_solver.setOption("produce-models", "true");
Term x = d_solver.mkConst(d_solver.getBooleanSort(), "x");
ASSERT_THROW(d_solver.blockModelValues({x}), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, blockModelValues3)
+TEST_F(TestApiBlackSolver, blockModelValues3)
{
d_solver.setOption("block-models", "literals");
Term x = d_solver.mkConst(d_solver.getBooleanSort(), "x");
ASSERT_THROW(d_solver.blockModelValues({x}), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, blockModelValues4)
+TEST_F(TestApiBlackSolver, blockModelValues4)
{
d_solver.setOption("produce-models", "true");
d_solver.setOption("block-models", "literals");
ASSERT_THROW(d_solver.blockModelValues({x}), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, blockModelValues5)
+TEST_F(TestApiBlackSolver, blockModelValues5)
{
d_solver.setOption("produce-models", "true");
d_solver.setOption("block-models", "literals");
ASSERT_NO_THROW(d_solver.blockModelValues({x}));
}
-TEST_F(TestApiSolverBlack, setInfo)
+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("status", "asdf"), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, simplify)
+TEST_F(TestApiBlackSolver, simplify)
{
ASSERT_THROW(d_solver.simplify(Term()), CVC4ApiException);
ASSERT_NO_THROW(d_solver.simplify(f2));
}
-TEST_F(TestApiSolverBlack, assertFormula)
+TEST_F(TestApiBlackSolver, assertFormula)
{
ASSERT_NO_THROW(d_solver.assertFormula(d_solver.mkTrue()));
ASSERT_THROW(d_solver.assertFormula(Term()), CVC4ApiException);
ASSERT_THROW(slv.assertFormula(d_solver.mkTrue()), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, checkEntailed)
+TEST_F(TestApiBlackSolver, checkEntailed)
{
d_solver.setOption("incremental", "false");
ASSERT_NO_THROW(d_solver.checkEntailed(d_solver.mkTrue()));
ASSERT_THROW(slv.checkEntailed(d_solver.mkTrue()), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, checkEntailed1)
+TEST_F(TestApiBlackSolver, checkEntailed1)
{
Sort boolSort = d_solver.getBooleanSort();
Term x = d_solver.mkConst(boolSort, "x");
ASSERT_THROW(slv.checkEntailed(d_solver.mkTrue()), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, checkEntailed2)
+TEST_F(TestApiBlackSolver, checkEntailed2)
{
d_solver.setOption("incremental", "true");
ASSERT_THROW(slv.checkEntailed(d_solver.mkTrue()), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, checkSat)
+TEST_F(TestApiBlackSolver, checkSat)
{
d_solver.setOption("incremental", "false");
ASSERT_NO_THROW(d_solver.checkSat());
ASSERT_THROW(d_solver.checkSat(), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, checkSatAssuming)
+TEST_F(TestApiBlackSolver, checkSatAssuming)
{
d_solver.setOption("incremental", "false");
ASSERT_NO_THROW(d_solver.checkSatAssuming(d_solver.mkTrue()));
ASSERT_THROW(slv.checkSatAssuming(d_solver.mkTrue()), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, checkSatAssuming1)
+TEST_F(TestApiBlackSolver, checkSatAssuming1)
{
Sort boolSort = d_solver.getBooleanSort();
Term x = d_solver.mkConst(boolSort, "x");
ASSERT_THROW(slv.checkSatAssuming(d_solver.mkTrue()), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, checkSatAssuming2)
+TEST_F(TestApiBlackSolver, checkSatAssuming2)
{
d_solver.setOption("incremental", "true");
ASSERT_THROW(slv.checkSatAssuming(d_solver.mkTrue()), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, setLogic)
+TEST_F(TestApiBlackSolver, setLogic)
{
ASSERT_NO_THROW(d_solver.setLogic("AUFLIRA"));
ASSERT_THROW(d_solver.setLogic("AF_BV"), CVC4ApiException);
ASSERT_THROW(d_solver.setLogic("AUFLIRA"), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, setOption)
+TEST_F(TestApiBlackSolver, setOption)
{
ASSERT_NO_THROW(d_solver.setOption("bv-sat-solver", "minisat"));
ASSERT_THROW(d_solver.setOption("bv-sat-solver", "1"), CVC4ApiException);
CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, resetAssertions)
+TEST_F(TestApiBlackSolver, resetAssertions)
{
d_solver.setOption("incremental", "true");
d_solver.checkSatAssuming({slt, ule});
}
-TEST_F(TestApiSolverBlack, mkSygusVar)
+TEST_F(TestApiBlackSolver, mkSygusVar)
{
Sort boolSort = d_solver.getBooleanSort();
Sort intSort = d_solver.getIntegerSort();
ASSERT_THROW(slv.mkSygusVar(boolSort), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, mkSygusGrammar)
+TEST_F(TestApiBlackSolver, mkSygusGrammar)
{
Term nullTerm;
Term boolTerm = d_solver.mkBoolean(true);
ASSERT_THROW(slv.mkSygusGrammar({boolVar2}, {intVar}), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, synthFun)
+TEST_F(TestApiBlackSolver, synthFun)
{
Sort null = d_solver.getNullSort();
Sort boolean = d_solver.getBooleanSort();
CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, synthInv)
+TEST_F(TestApiBlackSolver, synthInv)
{
Sort boolean = d_solver.getBooleanSort();
Sort integer = d_solver.getIntegerSort();
ASSERT_THROW(d_solver.synthInv("i4", {x}, g2), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, addSygusConstraint)
+TEST_F(TestApiBlackSolver, addSygusConstraint)
{
Term nullTerm;
Term boolTerm = d_solver.mkBoolean(true);
ASSERT_THROW(slv.addSygusConstraint(boolTerm), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, addSygusInvConstraint)
+TEST_F(TestApiBlackSolver, addSygusInvConstraint)
{
Sort boolean = d_solver.getBooleanSort();
Sort real = d_solver.getRealSort();
CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, getSynthSolution)
+TEST_F(TestApiBlackSolver, getSynthSolution)
{
d_solver.setOption("lang", "sygus2");
d_solver.setOption("incremental", "false");
ASSERT_THROW(slv.getSynthSolution(f), CVC4ApiException);
}
-TEST_F(TestApiSolverBlack, getSynthSolutions)
+TEST_F(TestApiBlackSolver, getSynthSolutions)
{
d_solver.setOption("lang", "sygus2");
d_solver.setOption("incremental", "false");
namespace test {
-class TestApiSortBlack : public TestApi
+class TestApiBlackSort : public TestApi
{
};
-TEST_F(TestApiSortBlack, getDatatype)
+TEST_F(TestApiBlackSort, getDatatype)
{
// create datatype sort, check should not fail
DatatypeDecl dtypeSpec = d_solver.mkDatatypeDecl("list");
ASSERT_THROW(bvSort.getDatatype(), CVC4ApiException);
}
-TEST_F(TestApiSortBlack, datatypeSorts)
+TEST_F(TestApiBlackSort, datatypeSorts)
{
Sort intSort = d_solver.getIntegerSort();
// create datatype sort to test
ASSERT_THROW(booleanSort.getSelectorCodomainSort(), CVC4ApiException);
}
-TEST_F(TestApiSortBlack, instantiate)
+TEST_F(TestApiBlackSort, instantiate)
{
// instantiate parametric datatype, check should not fail
Sort sort = d_solver.mkParamSort("T");
CVC4ApiException);
}
-TEST_F(TestApiSortBlack, getFunctionArity)
+TEST_F(TestApiBlackSort, getFunctionArity)
{
Sort funSort = d_solver.mkFunctionSort(d_solver.mkUninterpretedSort("u"),
d_solver.getIntegerSort());
ASSERT_THROW(bvSort.getFunctionArity(), CVC4ApiException);
}
-TEST_F(TestApiSortBlack, getFunctionDomainSorts)
+TEST_F(TestApiBlackSort, getFunctionDomainSorts)
{
Sort funSort = d_solver.mkFunctionSort(d_solver.mkUninterpretedSort("u"),
d_solver.getIntegerSort());
ASSERT_THROW(bvSort.getFunctionDomainSorts(), CVC4ApiException);
}
-TEST_F(TestApiSortBlack, getFunctionCodomainSort)
+TEST_F(TestApiBlackSort, getFunctionCodomainSort)
{
Sort funSort = d_solver.mkFunctionSort(d_solver.mkUninterpretedSort("u"),
d_solver.getIntegerSort());
ASSERT_THROW(bvSort.getFunctionCodomainSort(), CVC4ApiException);
}
-TEST_F(TestApiSortBlack, getArrayIndexSort)
+TEST_F(TestApiBlackSort, getArrayIndexSort)
{
Sort elementSort = d_solver.mkBitVectorSort(32);
Sort indexSort = d_solver.mkBitVectorSort(32);
ASSERT_THROW(indexSort.getArrayIndexSort(), CVC4ApiException);
}
-TEST_F(TestApiSortBlack, getArrayElementSort)
+TEST_F(TestApiBlackSort, getArrayElementSort)
{
Sort elementSort = d_solver.mkBitVectorSort(32);
Sort indexSort = d_solver.mkBitVectorSort(32);
ASSERT_THROW(indexSort.getArrayElementSort(), CVC4ApiException);
}
-TEST_F(TestApiSortBlack, getSetElementSort)
+TEST_F(TestApiBlackSort, getSetElementSort)
{
Sort setSort = d_solver.mkSetSort(d_solver.getIntegerSort());
ASSERT_NO_THROW(setSort.getSetElementSort());
ASSERT_THROW(bvSort.getSetElementSort(), CVC4ApiException);
}
-TEST_F(TestApiSortBlack, getBagElementSort)
+TEST_F(TestApiBlackSort, getBagElementSort)
{
Sort bagSort = d_solver.mkBagSort(d_solver.getIntegerSort());
ASSERT_NO_THROW(bagSort.getBagElementSort());
ASSERT_THROW(bvSort.getBagElementSort(), CVC4ApiException);
}
-TEST_F(TestApiSortBlack, getSequenceElementSort)
+TEST_F(TestApiBlackSort, getSequenceElementSort)
{
Sort seqSort = d_solver.mkSequenceSort(d_solver.getIntegerSort());
ASSERT_TRUE(seqSort.isSequence());
ASSERT_THROW(bvSort.getSequenceElementSort(), CVC4ApiException);
}
-TEST_F(TestApiSortBlack, getUninterpretedSortName)
+TEST_F(TestApiBlackSort, getUninterpretedSortName)
{
Sort uSort = d_solver.mkUninterpretedSort("u");
ASSERT_NO_THROW(uSort.getUninterpretedSortName());
ASSERT_THROW(bvSort.getUninterpretedSortName(), CVC4ApiException);
}
-TEST_F(TestApiSortBlack, isUninterpretedSortParameterized)
+TEST_F(TestApiBlackSort, isUninterpretedSortParameterized)
{
Sort uSort = d_solver.mkUninterpretedSort("u");
ASSERT_FALSE(uSort.isUninterpretedSortParameterized());
ASSERT_THROW(bvSort.isUninterpretedSortParameterized(), CVC4ApiException);
}
-TEST_F(TestApiSortBlack, getUninterpretedSortParamSorts)
+TEST_F(TestApiBlackSort, getUninterpretedSortParamSorts)
{
Sort uSort = d_solver.mkUninterpretedSort("u");
ASSERT_NO_THROW(uSort.getUninterpretedSortParamSorts());
ASSERT_THROW(bvSort.getUninterpretedSortParamSorts(), CVC4ApiException);
}
-TEST_F(TestApiSortBlack, getUninterpretedSortConstructorName)
+TEST_F(TestApiBlackSort, getUninterpretedSortConstructorName)
{
Sort sSort = d_solver.mkSortConstructorSort("s", 2);
ASSERT_NO_THROW(sSort.getSortConstructorName());
ASSERT_THROW(bvSort.getSortConstructorName(), CVC4ApiException);
}
-TEST_F(TestApiSortBlack, getUninterpretedSortConstructorArity)
+TEST_F(TestApiBlackSort, getUninterpretedSortConstructorArity)
{
Sort sSort = d_solver.mkSortConstructorSort("s", 2);
ASSERT_NO_THROW(sSort.getSortConstructorArity());
ASSERT_THROW(bvSort.getSortConstructorArity(), CVC4ApiException);
}
-TEST_F(TestApiSortBlack, getBVSize)
+TEST_F(TestApiBlackSort, getBVSize)
{
Sort bvSort = d_solver.mkBitVectorSort(32);
ASSERT_NO_THROW(bvSort.getBVSize());
ASSERT_THROW(setSort.getBVSize(), CVC4ApiException);
}
-TEST_F(TestApiSortBlack, getFPExponentSize)
+TEST_F(TestApiBlackSort, getFPExponentSize)
{
if (CVC4::Configuration::isBuiltWithSymFPU())
{
}
}
-TEST_F(TestApiSortBlack, getFPSignificandSize)
+TEST_F(TestApiBlackSort, getFPSignificandSize)
{
if (CVC4::Configuration::isBuiltWithSymFPU())
{
}
}
-TEST_F(TestApiSortBlack, getDatatypeParamSorts)
+TEST_F(TestApiBlackSort, getDatatypeParamSorts)
{
// create parametric datatype, check should not fail
Sort sort = d_solver.mkParamSort("T");
ASSERT_THROW(dtypeSort.getDatatypeParamSorts(), CVC4ApiException);
}
-TEST_F(TestApiSortBlack, getDatatypeArity)
+TEST_F(TestApiBlackSort, getDatatypeArity)
{
// create datatype sort, check should not fail
DatatypeDecl dtypeSpec = d_solver.mkDatatypeDecl("list");
ASSERT_THROW(bvSort.getDatatypeArity(), CVC4ApiException);
}
-TEST_F(TestApiSortBlack, getTupleLength)
+TEST_F(TestApiBlackSort, getTupleLength)
{
Sort tupleSort = d_solver.mkTupleSort(
{d_solver.getIntegerSort(), d_solver.getIntegerSort()});
ASSERT_THROW(bvSort.getTupleLength(), CVC4ApiException);
}
-TEST_F(TestApiSortBlack, getTupleSorts)
+TEST_F(TestApiBlackSort, getTupleSorts)
{
Sort tupleSort = d_solver.mkTupleSort(
{d_solver.getIntegerSort(), d_solver.getIntegerSort()});
ASSERT_THROW(bvSort.getTupleSorts(), CVC4ApiException);
}
-TEST_F(TestApiSortBlack, sortCompare)
+TEST_F(TestApiBlackSort, sortCompare)
{
Sort boolSort = d_solver.getBooleanSort();
Sort intSort = d_solver.getIntegerSort();
ASSERT_TRUE((intSort > bvSort || intSort == bvSort) == (intSort >= bvSort));
}
-TEST_F(TestApiSortBlack, sortSubtyping)
+TEST_F(TestApiBlackSort, sortSubtyping)
{
Sort intSort = d_solver.getIntegerSort();
Sort realSort = d_solver.getRealSort();
ASSERT_FALSE(setSortR.isSubsortOf(setSortI));
}
-TEST_F(TestApiSortBlack, sortScopedToString)
+TEST_F(TestApiBlackSort, sortScopedToString)
{
std::string name = "uninterp-sort";
Sort bvsort8 = d_solver.mkBitVectorSort(8);