-
Notifications
You must be signed in to change notification settings - Fork 277
SMT2 floating point encoding fix #4395
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
Mar 16, 2019
- 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.
This will need a non-recursive variant of letification, which is a few steps away from #4396. |
This avoids stack overflow in the case of expressions with many unique subexpressions. PR #4395 is an exemplar.
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: 80e33fb).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/104919955
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: cf71d76).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/104925912
src/solvers/smt2/smt2irep.cpp
Outdated
throw error("unexpected end of file"); | ||
if(stack.empty()) | ||
{ | ||
result = irept(irep_idt()); |
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 this really necessary with the result.clear()
above?
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.
No, not strictly; this is primarily meant to make it clear what is returned.
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 guess to really make it clear the best way would be to make parse
return an optionalt<irept>
instead of a bool.
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.
+1 for using optionalt<irept>
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.
But then also this commit should just be in a PR of its own where those kinds of changes could be made. It really doesn't relate to floating-point encoding fixes in any obvious way.
replace recursion in letify_rec by loop [blocks: #4395]
Z3, for instance, produces newlines at the end of the response; this should be tolerated by the parser.
efebade
to
9d2a61e
Compare
This is follow-up from a discussion in #4395 and clarifies the contract of this function.
There is now a separate commit with the optional return value of smt2irep. |
This is follow-up from a discussion in #4395 and clarifies the contract of this function.
This case was missing but is used in our lowering of floating-point operations.
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.
This PR failed Diffblue compatibility checks (cbmc commit: efebade).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/105603393
Status will be re-evaluated on next push.
Common spurious failures:
-
the cbmc commit has disappeared in the mean time (e.g. in a force-push)
-
the author is not in the list of contributors (e.g. first-time contributors).
-
the compatibility was already broken by an earlier merge.
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.
This PR failed Diffblue compatibility checks (cbmc commit: 9d2a61e).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/105604164
Status will be re-evaluated on next push.
Common spurious failures:
-
the cbmc commit has disappeared in the mean time (e.g. in a force-push)
-
the author is not in the list of contributors (e.g. first-time contributors).
-
the compatibility was already broken by an earlier merge.
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.
This PR failed Diffblue compatibility checks (cbmc commit: 8c4c5e5).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/105604746
Status will be re-evaluated on next push.
Common spurious failures:
-
the cbmc commit has disappeared in the mean time (e.g. in a force-push)
-
the author is not in the list of contributors (e.g. first-time contributors).
-
the compatibility was already broken by an earlier merge.
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: be64fc1).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/105604892
This is follow-up from a discussion in #4395 and clarifies the contract of this function.