summaryrefslogtreecommitdiff
path: root/src/expr
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2019-08-03 11:56:51 -0500
committerGitHub <noreply@github.com>2019-08-03 11:56:51 -0500
commit243a1d58a139077ecf19ac8a68573e51c08e4621 (patch)
tree8fa7ae926032b6c6d7c10b269ba4b32afbf6af62 /src/expr
parentfbc61a7bbe75c99b29cd238f552c18542deb5c32 (diff)
Fix printing issue related to nested quotes (#3154)
Diffstat (limited to 'src/expr')
-rw-r--r--src/expr/uninterpreted_constant.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/expr/uninterpreted_constant.cpp b/src/expr/uninterpreted_constant.cpp
index 5c9daf784..64180c377 100644
--- a/src/expr/uninterpreted_constant.cpp
+++ b/src/expr/uninterpreted_constant.cpp
@@ -16,6 +16,7 @@
#include "expr/uninterpreted_constant.h"
+#include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
@@ -34,7 +35,18 @@ UninterpretedConstant::UninterpretedConstant(Type type, Integer index)
}
std::ostream& operator<<(std::ostream& out, const UninterpretedConstant& uc) {
- return out << "uc_" << uc.getType() << '_' << uc.getIndex();
+ std::stringstream ss;
+ ss << uc.getType();
+ std::string st(ss.str());
+ // must remove delimiting quotes from the name of the type
+ // this prevents us from printing symbols like |@uc_|T|_n|
+ std::string q("|");
+ size_t pos;
+ while ((pos = st.find(q)) != std::string::npos)
+ {
+ st.replace(pos, 1, "");
+ }
+ return out << "uc_" << st.c_str() << "_" << uc.getIndex();
}
}/* CVC4 namespace */
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback