#include "expr/uninterpreted_constant.h"
+#include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
}
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 */
static void toStream(std::ostream& out, const DeclareTypeCommand* c)
{
- out << "(declare-sort " << c->getSymbol() << " " << c->getArity() << ")";
+ out << "(declare-sort " << maybeQuoteSymbol(c->getSymbol()) << " "
+ << c->getArity() << ")";
}
static void toStream(std::ostream& out, const DefineTypeCommand* c)
ufmt.simplify();
}
std::stringstream ss;
- ss << "_arg_" << f << "_";
+ ss << "_arg_";
Node val = ufmt.getFunctionValue(ss.str().c_str(), condenseFuncValues);
m->assignFunctionDefinition(f, val);
// ufmt.debugPrint( std::cout, m );