diff options
author | Andrew Reynolds <andrew.j.reynolds@gmail.com> | 2021-04-20 16:40:12 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-20 21:40:12 +0000 |
commit | cc8ce1bcdf8d6a4b508723063879e891a6cbd8c3 (patch) | |
tree | fef63c0628404e673eca56947d19411198ba3ce2 /test/unit/api/solver_black.cpp | |
parent | 18ce14653647a93319cc53eec9bc310d3a4c6f57 (diff) |
Add instantiation pool feature to the API (#6358)
This adds the command declare-pool to the public API. It also adds parsing support for this feature, lifts the internal kinds to public kinds, adds an example regression, and a unit test for the new declare-pool solver method.
Diffstat (limited to 'test/unit/api/solver_black.cpp')
-rw-r--r-- | test/unit/api/solver_black.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/unit/api/solver_black.cpp b/test/unit/api/solver_black.cpp index 361bfa8aa..db950dd7e 100644 --- a/test/unit/api/solver_black.cpp +++ b/test/unit/api/solver_black.cpp @@ -1299,6 +1299,22 @@ TEST_F(TestApiBlackSolver, getInterpolant) ASSERT_TRUE(output.getSort().isBoolean()); } +TEST_F(TestApiBlackSolver, declarePool) +{ + Sort intSort = d_solver.getIntegerSort(); + Sort setSort = d_solver.mkSetSort(intSort); + Term zero = d_solver.mkInteger(0); + Term x = d_solver.mkConst(intSort, "x"); + Term y = d_solver.mkConst(intSort, "y"); + // declare a pool with initial value { 0, x, y } + Term p = d_solver.declarePool("p", intSort, {zero, x, y}); + // pool should have the same sort + ASSERT_TRUE(p.getSort() == setSort); + // cannot pass null sort + Sort nullSort; + ASSERT_THROW(d_solver.declarePool("i", nullSort, {}), CVC5ApiException); +} + TEST_F(TestApiBlackSolver, getOp) { Sort bv32 = d_solver.mkBitVectorSort(32); |