PARSER_STATE->addSygusConstructorVariables(
datatypes[dtProcessed], sygusVars, t);
}
- )*
+ )+
RPAREN_TOK
RPAREN_TOK
{
dtProcessed++;
}
- )*
+ )+
RPAREN_TOK
{
if (dtProcessed != sortedVarNames.size())
bool aci = allowConst.find(i)!=allowConst.end();
Type btt = sortedVarNames[i].second;
datatypes[i].setSygus(btt, bvl, aci, false);
+ Trace("parser-sygus2") << "- " << datatypes[i].getName()
+ << ", #cons= " << datatypes[i].getNumConstructors()
+ << ", aci= " << aci << std::endl;
+ // We can be in a case where the only rule specified was (Variable T)
+ // and there are no variables of type T, in which case this is a bogus
+ // grammar. This results in the error below.
+ // We can also be in a case where the only rule specified was
+ // (Constant T), in which case we have not yet added a constructor. We
+ // ensure an arbitrary constant is added in this case.
+ if (datatypes[i].getNumConstructors() == 0)
+ {
+ if (aci)
+ {
+ Expr c = btt.mkGroundTerm();
+ PARSER_STATE->addSygusConstructorTerm(datatypes[i], c, ntsToUnres);
+ }
+ else
+ {
+ std::stringstream se;
+ se << "Grouped rule listing for " << datatypes[i].getName()
+ << " produced an empty rule list.";
+ PARSER_STATE->parseError(se.str());
+ }
+ }
}
// pop scope from the pre-declaration
PARSER_STATE->popScope();
regress1/sygus/nia-max-square-ns.sy
regress1/sygus/no-flat-simp.sy
regress1/sygus/no-mention.sy
+ regress1/sygus/only-const-grammar.sy
regress1/sygus/parity-si-rcons.sy
regress1/sygus/pbe_multi.sy
regress1/sygus/phone-1-long.sy
--- /dev/null
+; EXPECT: unsat
+; COMMAND-LINE: --sygus-out=status --lang=sygus2
+(set-logic LIA)
+
+(synth-fun f ((x Int) (y Int)) Int
+ ((Start Int) (CInt Int))
+ (
+ (Start Int ((+ x CInt)))
+ (CInt Int ((Constant Int)))
+ )
+)
+
+(declare-var x Int)
+(declare-var y Int)
+
+(constraint (= (f 0 0) 2))
+
+(constraint (= (f 1 1) 3))
+
+(check-synth)