A recent change made it so that defined functions would print as the anonymous lambda corresponding to their definition if the SyGuS v1 parser was used. This was caused by comparison with the wrong kind in the new API.
Notice that the v2 parser does not have this issue.
This also adds a regression to ensure this behavior is maintained by the SyGuS v2 parser.
// the given name.
spc = std::make_shared<printer::SygusNamedPrintCallback>(cnames[i]);
}
- else if (!sop.isNull() && sop.getKind() == api::VARIABLE)
+ else if (!sop.isNull() && sop.getKind() == api::CONSTANT)
{
Debug("parser-sygus") << "--> Defined function " << ops[i]
<< std::endl;
regress0/sygus/parse-bv-let.sy
regress0/sygus/pbe-pred-contra.sy
regress0/sygus/pLTL-sygus-syntax-err.sy
+ regress0/sygus/print-define-fun.sy
regress0/sygus/real-si-all.sy
regress0/sygus/sygus-no-wf.sy
regress0/sygus/sygus-uf.sy
--- /dev/null
+; COMMAND-LINE: --lang=sygus2
+; EXPECT: unsat
+; EXPECT: (define-fun g ((x Int)) Int (f 0))
+(set-logic LIA)
+(define-fun f ((x Int)) Int (+ x 1))
+(synth-fun g ((x Int)) Int ((Start Int)) ((Start Int ((f 0)))))
+(check-synth)