const std::vector<Node>& snvec = sn.getVec();
if (snvec.empty())
{
- out << "(as seq.empty " << n.getType() << ")";
+ out << "(as seq.empty ";
+ toStreamType(out, n.getType());
+ out << ")";
}
if (snvec.size() > 1)
{
case kind::STORE_ALL: {
ArrayStoreAll asa = n.getConst<ArrayStoreAll>();
- out << "((as const " << asa.getType() << ") " << asa.getValue() << ")";
+ out << "((as const ";
+ toStreamType(out, asa.getType());
+ out << ") " << asa.getValue() << ")";
break;
}
out << "(Tuple";
for (unsigned int i = 0; i < nargs; i++)
{
- out << " " << dt[0][i].getRangeType();
+ out << " ";
+ toStreamType(out, dt[0][i].getRangeType());
}
out << ")";
}
}
case kind::EMPTYSET:
- out << "(as emptyset " << n.getConst<EmptySet>().getType() << ")";
+ out << "(as emptyset ";
+ toStreamType(out, n.getConst<EmptySet>().getType());
+ out << ")";
break;
case kind::EMPTYBAG:
- out << "(as emptybag " << n.getConst<EmptyBag>().getType() << ")";
+ out << "(as emptybag ";
+ toStreamType(out, n.getConst<EmptyBag>().getType());
+ out << ")";
break;
case kind::BITVECTOR_EXTRACT_OP:
{
case kind::BITVECTOR_ROTATE_LEFT:
case kind::BITVECTOR_ROTATE_RIGHT:
case kind::INT_TO_BITVECTOR:
- out << n.getOperator() << ' ';
+ toStream(out, n.getOperator(), toDepth, nullptr);
+ out << ' ';
stillNeedToPrintParams = false;
break;
case kind::BITVECTOR_SIGN_EXTEND: return "sign_extend";
case kind::BITVECTOR_ROTATE_LEFT: return "rotate_left";
case kind::BITVECTOR_ROTATE_RIGHT: return "rotate_right";
+ case kind::INT_TO_BITVECTOR: return "int2bv";
case kind::UNION: return "union";
case kind::INTERSECTION: return "intersection";
return kind::kindToString(k);
}
+void Smt2Printer::toStreamType(std::ostream& out, TypeNode tn) const
+{
+ // we currently must call TypeNode::toStream here.
+ tn.toStream(out, language::output::LANG_SMTLIB_V2_6);
+}
+
template <class T>
static bool tryToStream(std::ostream& out, const Command* c);
template <class T>