summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2018-06-28 13:53:36 -0500
committerGitHub <noreply@github.com>2018-06-28 13:53:36 -0500
commite799ab0164722e8a4f192ee13223d0eeec6ec004 (patch)
tree5ff7c46d2f0f6ff2a2a4f3655425b49e86bd18a5
parentd83f8bebccffdb677652706f4eb3a2fff056587c (diff)
Do not rename uninterpreted constants (#2098)
-rw-r--r--src/expr/uninterpreted_constant.cpp10
-rw-r--r--src/printer/smt2/smt2_printer.cpp4
2 files changed, 4 insertions, 10 deletions
diff --git a/src/expr/uninterpreted_constant.cpp b/src/expr/uninterpreted_constant.cpp
index 2187d9cdf..9898bcb3f 100644
--- a/src/expr/uninterpreted_constant.cpp
+++ b/src/expr/uninterpreted_constant.cpp
@@ -34,15 +34,7 @@ UninterpretedConstant::UninterpretedConstant(Type type, Integer index)
}
std::ostream& operator<<(std::ostream& out, const UninterpretedConstant& uc) {
- stringstream ss;
- ss << uc.getType();
- string t = ss.str();
- size_t i = 0;
- // replace everything that isn't in [a-zA-Z0-9_] with an _
- while((i = t.find_first_not_of("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_", i)) != string::npos) {
- t.replace(i, 1, 1, '_');
- }
- return out << "uc_" << t << '_' << uc.getIndex();
+ return out << "uc_" << uc.getType() << '_' << uc.getIndex();
}
}/* CVC4 namespace */
diff --git a/src/printer/smt2/smt2_printer.cpp b/src/printer/smt2/smt2_printer.cpp
index f6d3cc743..0e1df15b5 100644
--- a/src/printer/smt2/smt2_printer.cpp
+++ b/src/printer/smt2/smt2_printer.cpp
@@ -267,7 +267,9 @@ void Smt2Printer::toStream(std::ostream& out,
case kind::UNINTERPRETED_CONSTANT: {
const UninterpretedConstant& uc = n.getConst<UninterpretedConstant>();
- out << '@' << uc;
+ std::stringstream ss;
+ ss << '@' << uc;
+ out << maybeQuoteSymbol(ss.str());
break;
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback