In current master, --produce-interpols takes a mode, where "none" is the default mode, in which interpolant generation is not enabled.
This PR makes --produce-interpols a Boolean, and adds a interpols-mode option to determine the mode, similarly to unsat cores.
{
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_SOLVER_CHECK_TERM(conj);
- CVC5_API_CHECK(d_slv->getOptions().smt.produceInterpols
- != options::ProduceInterpols::NONE)
+ CVC5_API_CHECK(d_slv->getOptions().smt.interpols)
<< "Cannot get interpolant unless interpolants are enabled (try "
- "--produce-interpols=mode)";
+ "--produce-interpols)";
//////// all checks before this line
TypeNode nullType;
Node result = d_slv->getInterpolant(*conj.d_node, nullType);
{
CVC5_API_TRY_CATCH_BEGIN;
CVC5_API_SOLVER_CHECK_TERM(conj);
- CVC5_API_CHECK(d_slv->getOptions().smt.produceInterpols
- != options::ProduceInterpols::NONE)
+ CVC5_API_CHECK(d_slv->getOptions().smt.interpols)
<< "Cannot get interpolant unless interpolants are enabled (try "
- "--produce-interpols=mode)";
+ "--produce-interpols)";
//////// all checks before this line
Node result = d_slv->getInterpolant(*conj.d_node, *grammar.resolve().d_type);
return Term(this, result);
Term Solver::getInterpolantNext() const
{
CVC5_API_TRY_CATCH_BEGIN;
- CVC5_API_CHECK(d_slv->getOptions().smt.produceInterpols
- != options::ProduceInterpols::NONE)
+ CVC5_API_CHECK(d_slv->getOptions().smt.interpols)
<< "Cannot get interpolant unless interpolants are enabled (try "
- "--produce-interpols=mode)";
+ "--produce-interpols)";
CVC5_API_CHECK(d_slv->getOptions().base.incrementalSolving)
<< "Cannot get next interpolant when not solving incrementally (try "
"--incremental)";
help = "attempt to solve a pure real satisfiable problem as an integer problem (for non-linear)"
[[option]]
- name = "produceInterpols"
+ name = "interpols"
category = "regular"
- long = "produce-interpols=MODE"
- type = "ProduceInterpols"
- default = "NONE"
- help = "support the get-interpol command"
+ long = "produce-interpols"
+ type = "bool"
+ default = "false"
+ help = "turn on interpolation generation."
+
+[[option]]
+ name = "interpolsMode"
+ category = "regular"
+ long = "interpols-mode=MODE"
+ type = "InterpolsMode"
+ default = "DEFAULT"
+ help = "choose interpolants production mode, see --interpols-mode=help"
help_mode = "Interpolants grammar mode"
-[[option.mode.NONE]]
- name = "none"
- help = "don't compute interpolants"
[[option.mode.DEFAULT]]
name = "default"
help = "use the default grammar for the theory or the user-defined grammar if given"
const TypeNode& grammarType,
Node& interpol)
{
- if (options().smt.produceInterpols == options::ProduceInterpols::NONE)
+ if (!options().smt.interpols)
{
const char* msg =
- "Cannot get interpolation when produce-interpol options is off.";
+ "Cannot get interpolation when produce-interpols options is off.";
throw ModalException(msg);
}
Trace("sygus-interpol") << "SolverEngine::getInterpol: conjecture " << conj
}
if (!d_isInternalSubsolver)
{
- if (opts.smt.produceAbducts
- || opts.smt.produceInterpols != options::ProduceInterpols::NONE
+ if (opts.smt.produceAbducts || opts.smt.interpols
|| opts.quantifiers.sygusInference
|| opts.quantifiers.sygusRewSynthInput)
{
{
d_abductSolver.reset(new AbductionSolver(*d_env.get()));
}
- if (d_env->getOptions().smt.produceInterpols
- != options::ProduceInterpols::NONE)
+ if (d_env->getOptions().smt.interpols)
{
d_interpolSolver.reset(new InterpolationSolver(*d_env));
}
std::map<TypeNode, std::unordered_set<Node>>& result)
{
NodeManager* nm = NodeManager::currentNM();
- Assert(options().smt.produceInterpols != options::ProduceInterpols::NONE);
+ Assert(options().smt.interpols);
// ASSUMPTIONS
- if (options().smt.produceInterpols == options::ProduceInterpols::ASSUMPTIONS)
+ if (options().smt.interpolsMode == options::InterpolsMode::ASSUMPTIONS)
{
Node tmpAssumptions =
(axioms.size() == 1 ? axioms[0] : nm->mkNode(kind::AND, axioms));
expr::getOperatorsMap(tmpAssumptions, result);
}
// CONJECTURE
- else if (options().smt.produceInterpols
- == options::ProduceInterpols::CONJECTURE)
+ else if (options().smt.interpolsMode == options::InterpolsMode::CONJECTURE)
{
expr::getOperatorsMap(conj, result);
}
// SHARED
- else if (options().smt.produceInterpols == options::ProduceInterpols::SHARED)
+ else if (options().smt.interpolsMode == options::InterpolsMode::SHARED)
{
// Get operators from axioms
std::map<TypeNode, std::unordered_set<Node>> include_cons_axioms;
}
}
// ALL
- else if (options().smt.produceInterpols == options::ProduceInterpols::ALL)
+ else if (options().smt.interpolsMode == options::InterpolsMode::ALL)
{
Node tmpAssumptions =
(axioms.size() == 1 ? axioms[0] : nm->mkNode(kind::AND, axioms));
-; COMMAND-LINE: --produce-interpols=default --sygus-enum=fast --check-interpols -i
+; COMMAND-LINE: --produce-interpols --interpols-mode=default --sygus-enum=fast --check-interpols -i
; SCRUBBER: grep -v -E '(\(define-fun)'
; EXIT: 0
(set-logic NIA)
-; COMMAND-LINE: --produce-interpols=default --sygus-enum=fast --check-interpols
+; COMMAND-LINE: --produce-interpols --interpols-mode=default --sygus-enum=fast --check-interpols
; SCRUBBER: grep -v -E '(\(define-fun)'
; EXIT: 0
(set-logic NIA)
-; COMMAND-LINE: --produce-interpols=default --check-interpols -i
+; COMMAND-LINE: --produce-interpols --interpols-mode=default --check-interpols -i
; SCRUBBER: grep -v -E '(\(define-fun)'
; EXIT: 0
(set-logic LIA)
-; COMMAND-LINE: --produce-interpols=default --check-interpols
+; COMMAND-LINE: --produce-interpols --interpols-mode=default --check-interpols
; SCRUBBER: grep -v -E '(\(define-fun)'
; EXIT: 0
(set-logic LIA)
-; COMMAND-LINE: --produce-interpols=default --sygus-enum=fast --check-interpols
+; COMMAND-LINE: --produce-interpols --interpols-mode=default --sygus-enum=fast --check-interpols
; SCRUBBER: grep -v -E '(\(define-fun)'
; EXIT: 0
(set-logic ALL)
-; COMMAND-LINE: --produce-interpols=default --sygus-enum=fast --check-interpols
+; COMMAND-LINE: --produce-interpols --interpols-mode=default --sygus-enum=fast --check-interpols
; SCRUBBER: grep -v -E '(\(define-fun)'
; EXIT: 0
(set-logic ALL)
-; COMMAND-LINE: --produce-interpols=conjecture --sygus-enum=fast --check-interpols
+; COMMAND-LINE: --produce-interpols --interpols-mode=conjecture --sygus-enum=fast --check-interpols
; SCRUBBER: grep -v -E '(\(define-fun)'
; EXIT: 0
(set-logic ALL)
-(set-option :produce-interpols conjecture)
-(set-option :sygus-enum fast)
(declare-fun cfg@1 () (_ BitVec 1))
(declare-fun witness_0@1 () Bool)
(declare-fun op@1 () (_ BitVec 4))
-; COMMAND-LINE: --produce-interpols=default
+; COMMAND-LINE: --produce-interpols --interpols-mode=default
; SCRUBBER: grep -v -E '(\(define-fun)'
; EXIT: 0
(set-logic ALL)
-; COMMAND-LINE: --produce-interpols=default --sygus-enum=fast --check-interpols
+; COMMAND-LINE: --produce-interpols --interpols-mode=default --sygus-enum=fast --check-interpols
; SCRUBBER: grep -v -E '(\(define-fun)'
; EXIT: 0
(set-logic ALL)
-; COMMAND-LINE: --produce-interpols=default --sygus-enum=fast --check-interpols
+; COMMAND-LINE: --produce-interpols --interpols-mode=default --sygus-enum=fast --check-interpols
; SCRUBBER: grep -v -E '(\(define-fun)'
; EXIT: 0
(set-logic ALL)
-; COMMAND-LINE: --produce-interpols=default
+; COMMAND-LINE: --produce-interpols --interpols-mode=default
; SCRUBBER: grep -v -E '(\(define-fun)'
; EXIT: 0
(set-logic ALL)
-; COMMAND-LINE: --produce-interpols=default --sygus-enum=fast --check-interpols
+; COMMAND-LINE: --produce-interpols --interpols-mode=default --sygus-enum=fast --check-interpols
; SCRUBBER: grep -v -E '(\(define-fun)'
; EXIT: 0
TEST_F(TestApiBlackSolver, getInterpolant)
{
d_solver.setLogic("QF_LIA");
- d_solver.setOption("produce-interpols", "default");
+ d_solver.setOption("produce-interpols", "true");
d_solver.setOption("incremental", "false");
Sort intSort = d_solver.getIntegerSort();
TEST_F(TestApiBlackSolver, getInterpolantNext)
{
d_solver.setLogic("QF_LIA");
- d_solver.setOption("produce-interpols", "default");
+ d_solver.setOption("produce-interpols", "true");
d_solver.setOption("incremental", "true");
Sort intSort = d_solver.getIntegerSort();
@Test void getInterpolant() throws CVC5ApiException
{
d_solver.setLogic("QF_LIA");
- d_solver.setOption("produce-interpols", "default");
+ d_solver.setOption("produce-interpols", "true");
d_solver.setOption("incremental", "false");
Sort intSort = d_solver.getIntegerSort();
@Test void getInterpolantNext() throws CVC5ApiException
{
d_solver.setLogic("QF_LIA");
- d_solver.setOption("produce-interpols", "default");
+ d_solver.setOption("produce-interpols", "true");
d_solver.setOption("incremental", "true");
Sort intSort = d_solver.getIntegerSort();
def test_get_interpolant(solver):
solver.setLogic("QF_LIA")
- solver.setOption("produce-interpols", "default")
+ solver.setOption("produce-interpols", "true")
solver.setOption("incremental", "false")
intSort = solver.getIntegerSort()
def test_get_interpolant_next(solver):
solver.setLogic("QF_LIA")
- solver.setOption("produce-interpols", "default")
+ solver.setOption("produce-interpols", "true")
solver.setOption("incremental", "true")
intSort = solver.getIntegerSort()