cex struct value printing
MODIFY
ir/type.cpp
ir/type.cpp
@@ -620,8 +620,16 @@ pair<expr, vector<expr>> StructType::mkInput(State &s, const char *name) const {
return { move(val), move(vars) };
}
-void StructType::printVal(ostream &os, const expr &e) const {
- // TODO
+void StructType::printVal(ostream &os, const expr &val) const {
+ os << "{ ";
+ bool first = true;
+ for (size_t i = 0, e = children.size(); i != e; ++i) {
+ if (!first)
+ os << ", ";
+ getChild(i).printVal(os, extract(val, i));
+ first = false;
+ }
+ os << " }";
}
void StructType::print(ostream &os) const {

MODIFY
tools/transform.cpp
tools/transform.cpp
@@ -44,7 +44,8 @@ static void print_varval(ostream &s, const Model &m, const Value *var,
expr e = m.eval(val.value);
// undef variables may not have a model since each read uses a copy
if (!e.isConst()) {
- s << "undef";
+ // FIXME
+ s << "?";
return;
}

cex struct value printing