Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions src/solvers/smt2/smt2_conv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2137,20 +2137,25 @@ void smt2_convt::convert_expr(const exprt &expr)
else if(quantifier_expr.id() == ID_exists)
out << "(exists ";

out << "( ";
out << '(';
bool first = true;
for(const auto &bound : quantifier_expr.variables())
{
out << "(";
if(first)
first = false;
else
out << ' ';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this space actually needed or is it also redundant?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you'd get ")(" otherwise. Syntactically valid, but not pretty.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense. I wasn't aware if the goal was making this prettier or just shorter.

out << '(';
convert_expr(bound);
out << " ";
out << ' ';
convert_type(bound.type());
out << ") ";
out << ')';
}
out << ") ";

convert_expr(quantifier_expr.where());

out << ")";
out << ')';
}
else if(expr.id()==ID_vector)
{
Expand Down Expand Up @@ -2383,7 +2388,7 @@ void smt2_convt::convert_typecast(const typecast_exprt &expr)
convert_expr(src);
out << " ";
convert_expr(from_integer(0, src_type));
out << ")) "; // not, =
out << "))"; // not, =
out << " (_ bv1 " << to_width << ")";
out << " (_ bv0 " << to_width << ")";
out << ")"; // ite
Expand Down