-
Notifications
You must be signed in to change notification settings - Fork 277
format_expr: use table and tweak precedences #3208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
kroening
commented
Oct 20, 2018
- Each commit message has a non-empty body, explaining why the change was made.
- Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
- Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
- n/a My commit message includes data points confirming performance improvements (if claimed).
- My PR is restricted to a single feature or bugfix.
- White-space or formatting changes outside the feature-related changed lines are in commits of their own.
ee91d9c
to
bcdf096
Compare
src/util/format_expr.cpp
Outdated
@@ -180,7 +207,7 @@ std::ostream &fallback_format_rec(std::ostream &os, const exprt &expr) | |||
if(first) | |||
first = false; | |||
else | |||
os << ", "; | |||
os << " }, "; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this change about?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
src/util/format_expr.cpp
Outdated
{ID_implies, u8"\u21d2"}, // =>, U+21D2 | ||
{ID_le, u8"\u2264"}, // <=, U+2264 | ||
{ID_ge, u8"\u2265"}, // >=, U+2265 | ||
{ID_notequal, u8"\u2260"}, // /=, U+2260 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
1482c22
to
372028e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, with a possible need for further changes as outlined below.
{ID_xor, {u8"\u2295"}}, // + in circle, U+2295 | ||
{ID_implies, {u8"\u21d2"}}, // =>, U+21D2 | ||
{ID_le, {u8"\u2264"}}, // <=, U+2264 | ||
{ID_ge, {u8"\u2265"}}, // >=, U+2265 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about ID_lt
, ID_gt
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, added
@@ -356,7 +356,7 @@ SCENARIO("miniBDD", "[core][solver][miniBDD]") | |||
{ | |||
std::ostringstream oss; | |||
oss << format(t.as_expr()); | |||
REQUIRE(oss.str() == "(¬a) ∨ b"); | |||
REQUIRE(oss.str() == "¬a ∨ b"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the changes in this file are in the wrong commit as they appear to relate to precedence. But I could be wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Split into separate commit
372028e
to
9b6a3ea
Compare
9b6a3ea
to
6dca32d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passed Diffblue compatibility checks (cbmc commit: 6dca32d).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/88634542