diff options
author | Andrew Reynolds <andrew.j.reynolds@gmail.com> | 2020-11-12 17:03:30 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-12 17:03:30 -0600 |
commit | 83af1ef582a7ff3749126a5d91d5ef0ac34c1516 (patch) | |
tree | a5a7aec20ff5e6bb4256e1bd301568710b877f49 /src/smt | |
parent | 3db60fa3fba4787cc33a61c1a357c43ba1cc9d6d (diff) |
Fix printing of define named function (#5425)
Fixes the case where the type of the function is not a function type.
Diffstat (limited to 'src/smt')
-rw-r--r-- | src/smt/command.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/smt/command.cpp b/src/smt/command.cpp index f1490e2f9..1e7401fa4 100644 --- a/src/smt/command.cpp +++ b/src/smt/command.cpp @@ -1313,11 +1313,18 @@ void DefineNamedFunctionCommand::toStream(std::ostream& out, 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()); } |