Fixes the case where the type of the function is not a function type.
size_t dag,
OutputLanguage language) const
{
+ // get the range type of the function, or the type itself
+ // if its not a function
+ TypeNode range = d_func.getSort().getTypeNode();
+ if (range.isFunction())
+ {
+ range = range.getRangeType();
+ }
Printer::getPrinter(language)->toStreamCmdDefineNamedFunction(
out,
d_func.toString(),
api::termVectorToNodes(d_formals),
- d_func.getSort().getFunctionCodomainSort().getTypeNode(),
+ range,
d_formula.getNode());
}