-
Notifications
You must be signed in to change notification settings - Fork 274
Use FloatingPoint theory when using --cprover-smt2 #6132
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
May 20, 2021
- Each commit message has a non-empty body, explaining why the change was made.
- n/a Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
- n/a The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
- 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.
- n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.
a8a325f
to
3b2a021
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.
Looks good. Thanks for the clearly broken out commits.
Codecov Report
@@ Coverage Diff @@
## develop #6132 +/- ##
===========================================
- Coverage 75.42% 75.26% -0.16%
===========================================
Files 1447 1447
Lines 158094 158181 +87
===========================================
- Hits 119249 119062 -187
- Misses 38845 39119 +274
Continue to review full report at Codecov.
|
src/solvers/smt2/smt2_parser.cpp
Outdated
} | ||
else | ||
{ | ||
// remove the '.', if any |
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.
The ", if any" in the comment seems strange, because we know that there is a '.' in the else
case.
src/solvers/smt2/smt2_parser.cpp
Outdated
for(auto ch : real_number) | ||
if(ch != '.') | ||
significand_str += ch; |
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.
- Is the intended behaviour really such that the '.' is the only character not being copied over?
- Nit pick: Braces around the body of the for-loop would be nice.
- Perhaps just use
erase
instead:
std::string significand_str = real_number;
significand_str.erase(significand_str.begin() + dot_pos);
- As further alternative, create
significand_str
by concatenating two substrings, which perhaps is more efficient in some future version of C++ with string views.
This commit adds the obvious mapping from fp.abs to our abs_exprt.
This adds support for floating-point literals to the SMT2 expression formatter.
SMT-LIB to_fp has a number of variants, and this commit adds two of them to enable the use of cprover_smt2 with CBMC.
This adds support for three floating-point constants to the SMT2 parser, to enable the use of cprover_smt2 with CBMC.
This fixes an off-by-one bug in the SMT2 backend when parsing +oo, -oo and NaN expressions.
This enables the use of the FloatingPoint theory when using cprover_smt2. The resulting SMT-LIB files are much smaller, and easier to read. The commit also enables existing tests that now pass with --cprover-smt2.