// quantify the body
Trace("sygus-infer") << "Make inner sygus conjecture..." << std::endl;
+ body = body.negate();
if (!qvars.empty())
{
Node bvl = nm->mkNode(BOUND_VAR_LIST, qvars);
- body = nm->mkNode(EXISTS, bvl, body.negate());
+ body = nm->mkNode(EXISTS, bvl, body);
}
// sygus attribute to mark the conjecture as a sygus conjecture
bool rconsSygus)
{
Assert( d_sol!=NULL );
- Assert(!d_inst.empty());
const Datatype& dt = ((DatatypeType)(stn).toType()).getDatatype();
Node varList = Node::fromExpr( dt.getSygusVarList() );
Node prog = d_quant[0][sol_index];
std::vector< Node > vars;
Node s;
- if( d_prog_to_sol_index.find( prog )==d_prog_to_sol_index.end() ){
+ // If it is unconstrained: either the variable does not appear in the
+ // conjecture or the conjecture can be solved without a single instantiation.
+ if (d_prog_to_sol_index.find(prog) == d_prog_to_sol_index.end()
+ || d_inst.empty())
+ {
Trace("csi-sol") << "Get solution for (unconstrained) " << prog << std::endl;
s = d_qe->getTermEnumeration()->getEnumerateTerm(
TypeNode::fromType(dt.getSygusType()), 0);
- }else{
+ }
+ else
+ {
Trace("csi-sol") << "Get solution for " << prog << ", with skolems : ";
sol_index = d_prog_to_sol_index[prog];
d_sol->d_varList.clear();
}
// store in map
Node fvar = d_quant[0][i];
- Assert(fvar.getType() == bsol.getType());
+ Assert(fvar.getType().isComparableTo(bsol.getType()));
sol_map[fvar] = bsol;
}
}
regress1/sygus/inv-unused.sy
regress1/sygus/issue2914.sy
regress1/sygus/issue2935.sy
+ regress1/sygus/issue3199.smt2
+ regress1/sygus/issue3200.smt2
+ regress1/sygus/issue3201.smt2
regress1/sygus/large-const-simp.sy
regress1/sygus/let-bug-simp.sy
regress1/sygus/list-head-x.sy
--- /dev/null
+; EXPECT: sat
+; COMMAND-LINE: --sygus-inference
+(set-logic QF_LRA)
+(declare-fun v () Real)
+(assert (= v 0))
+(check-sat)
+(exit)
--- /dev/null
+; EXPECT: sat
+; COMMAND-LINE: --sygus-inference
+(set-logic ALL)
+(declare-fun v () Real)
+(assert (= (* v v) 0))
+(check-sat)
+(exit)
--- /dev/null
+; EXPECT: unsat
+; COMMAND-LINE: --sygus-inference
+(set-logic ALL)
+(declare-fun v () Bool)
+(assert false)
+(assert v)
+(check-sat)
+(exit)