Skip to content

Conversation

@tautschnig
Copy link
Collaborator

These aren't fully supported by the back-ends. Instead, bit-extract the
components and construct an expression.

  • 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.
  • 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.

}
else if(target_type.id() == ID_string)
{
// this works, but is somewhat questionable
Copy link
Contributor

Choose a reason for hiding this comment

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

Clarify why?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Why it works or why it is questionable?

Copy link
Contributor

Choose a reason for hiding this comment

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

Why it's questionable

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Because the only ID_string-typed expression we really deal with is a constant_exprt. But all tests pass when I do this 👼

Copy link
Contributor

@allredj allredj left a 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: 175c12c).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/101421426

Copy link
Contributor

@romainbrenguier romainbrenguier left a comment

Choose a reason for hiding this comment

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

Please break this big function into parts and document it. It will then be easier to review.

else
{
PRECONDITION_WITH_DIAGNOSTICS(
false, "bv_to_expr does not yet support ", target_type.id_string());
Copy link
Contributor

Choose a reason for hiding this comment

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

That's not a precondition, use UNEXPECTEDCASE

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There is UNHANDLED_CASE, but the documentation suggests that this should not be used, and it wouldn't provide diagnostics either. So I'm inclined to leave this as is.

These aren't fully supported by the back-ends. Instead, bit-extract the
components and construct an expression.
@tautschnig
Copy link
Collaborator Author

Refactored and acted upon comments as far as possible. @owen-jones-diffblue @romainbrenguier @smowton could you please take another look?

@tautschnig tautschnig merged commit 4b183ec into diffblue:develop Feb 19, 2019
@tautschnig tautschnig deleted the byte-op-conversion branch February 19, 2019 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants