diff options
author | Andrew Reynolds <andrew.j.reynolds@gmail.com> | 2021-10-20 14:48:11 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-20 19:48:11 +0000 |
commit | 221f8b49844a0d65739393df9327de0338154ff2 (patch) | |
tree | 0cd453cc3e41e82df8fe42f562f11595b213364e /test/unit/api/solver_black.cpp | |
parent | 68fc65dfb303d75eab953523744103ba2b65ac8e (diff) |
Check whether abduct option is enabled (#7418)
This addresses one of the issues related to #6605.
Diffstat (limited to 'test/unit/api/solver_black.cpp')
-rw-r--r-- | test/unit/api/solver_black.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/unit/api/solver_black.cpp b/test/unit/api/solver_black.cpp index f90018101..d5137393e 100644 --- a/test/unit/api/solver_black.cpp +++ b/test/unit/api/solver_black.cpp @@ -1225,6 +1225,23 @@ TEST_F(TestApiBlackSolver, getAbduct) ASSERT_EQ(output2, truen); } +TEST_F(TestApiBlackSolver, getAbduct2) +{ + d_solver.setLogic("QF_LIA"); + d_solver.setOption("incremental", "false"); + Sort intSort = d_solver.getIntegerSort(); + Term zero = d_solver.mkInteger(0); + Term x = d_solver.mkConst(intSort, "x"); + Term y = d_solver.mkConst(intSort, "y"); + // Assumptions for abduction: x > 0 + d_solver.assertFormula(d_solver.mkTerm(GT, x, zero)); + // Conjecture for abduction: y > 0 + Term conj = d_solver.mkTerm(GT, y, zero); + Term output; + // Fails due to option not set + ASSERT_THROW(d_solver.getAbduct(conj, output), CVC5ApiException); +} + TEST_F(TestApiBlackSolver, getInterpolant) { d_solver.setLogic("QF_LIA"); |