This allows the basic use of SyGuS in incremental mode, where constraints can be pushed/popped.
It does not yet support getting multiple solutions for the same set of constraints, which will require more significant changes.
}
| /* check-sat */
CHECK_SAT_TOK { PARSER_STATE->checkThatLogicIsSet(); }
- { if (PARSER_STATE->sygus()) {
+ {
+ if (PARSER_STATE->sygus()) {
PARSER_STATE->parseError("Sygus does not support check-sat command.");
}
cmd->reset(new CheckSatCommand());
{ cmd->reset(new GetDifficultyCommand); }
| /* push */
PUSH_TOK { PARSER_STATE->checkThatLogicIsSet(); }
- { if( PARSER_STATE->sygus() ){
- PARSER_STATE->parseError("Sygus does not support push command.");
- }
- }
( k=INTEGER_LITERAL
{ unsigned num = AntlrInput::tokenToUnsigned(k);
if(num == 0) {
}
} )
| POP_TOK { PARSER_STATE->checkThatLogicIsSet(); }
- { if( PARSER_STATE->sygus() ){
- PARSER_STATE->parseError("Sygus does not support pop command.");
- }
- }
( k=INTEGER_LITERAL
{ unsigned num = AntlrInput::tokenToUnsigned(k);
// we don't compare num to PARSER_STATE->scopeLevel() here, since
Result SygusSolver::checkSynth(Assertions& as)
{
- if (options().base.incrementalSolving)
- {
- // TODO (project #7)
- throw ModalException(
- "Cannot make check-synth commands when incremental solving is enabled");
- }
Trace("smt") << "SygusSolver::checkSynth" << std::endl;
// if applicable, check if the subsolver is the correct one
if (usingSygusSubsolver() && d_subsolverCd.get() != d_subsolver.get())
// the subsolver.
d_sygusConjectureStale = true;
}
+ // TODO (project #7): we currently must always rebuild the synthesis
+ // conjecture + subsolver, since it answers unsat. When the subsolver is
+ // updated to treat "sat" as solution for synthesis conjecture, this line
+ // will be deleted.
+ d_sygusConjectureStale = true;
if (d_sygusConjectureStale)
{
NodeManager* nm = NodeManager::currentNM();
regress0/sygus/General_plus10.sy
regress0/sygus/hd-05-d1-prog-nogrammar.sy
regress0/sygus/ho-occ-synth-fun.sy
+ regress0/sygus/incremental-modify-ex.sy
regress0/sygus/inv-different-var-order.sy
regress0/sygus/issue3356-syg-inf-usort.smt2
regress0/sygus/issue3624.sy
--- /dev/null
+; COMMAND-LINE: -i --sygus-out=status
+;EXPECT: unsat
+;EXPECT: unsat
+(set-logic LIA)
+
+(synth-fun f ((x Int) (y Int)) Int
+ ((Start Int) (StartBool Bool))
+ ((Start Int (0 1 x y
+ (+ Start Start)
+ (- Start Start)
+ (ite StartBool Start Start)))
+ (StartBool Bool ((and StartBool StartBool)
+ (not StartBool)
+ (<= Start Start)))))
+
+
+(declare-var x Int)
+(declare-var y Int)
+
+(push 1)
+(constraint (>= (f x y) 0))
+(check-synth)
+(pop 1)
+
+(constraint (< (f x y) 0))
+(check-synth)