summaryrefslogtreecommitdiff
path: root/src/smt
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2020-11-12 17:03:30 -0600
committerGitHub <noreply@github.com>2020-11-12 17:03:30 -0600
commit83af1ef582a7ff3749126a5d91d5ef0ac34c1516 (patch)
treea5a7aec20ff5e6bb4256e1bd301568710b877f49 /src/smt
parent3db60fa3fba4787cc33a61c1a357c43ba1cc9d6d (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.cpp9
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());
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback