Skip to content

bv_get_rec: ensure all expressions are properly typed #7020

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

Merged
merged 1 commit into from
Jul 21, 2022

Conversation

tautschnig
Copy link
Collaborator

The regression test included here failed as of 55fc192 for a
member_exprt over an untyped nil_exprt was being constructed. While at
it, get rid of the split-brain problem that passing the type separately
from the expression had created.

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

The regression test included here failed as of 55fc192 for a
member_exprt over an untyped nil_exprt was being constructed. While at
it, get rid of the split-brain problem that passing the type separately
from the expression had created.
@tautschnig
Copy link
Collaborator Author

@codecov
Copy link

codecov bot commented Jul 21, 2022

Codecov Report

Merging #7020 (e90aeb3) into develop (d5462fb) will increase coverage by 0.00%.
The diff coverage is 90.00%.

@@           Coverage Diff            @@
##           develop    #7020   +/-   ##
========================================
  Coverage    77.88%   77.88%           
========================================
  Files         1569     1569           
  Lines       180891   180892    +1     
========================================
+ Hits        140878   140880    +2     
+ Misses       40013    40012    -1     
Impacted Files Coverage Δ
src/solvers/flattening/boolbv.h 62.50% <ø> (ø)
src/solvers/flattening/bv_pointers.h 100.00% <ø> (ø)
src/solvers/flattening/boolbv_get.cpp 83.33% <89.28%> (+0.47%) ⬆️
src/solvers/flattening/bv_pointers.cpp 85.59% <100.00%> (+0.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b4a2ab0...e90aeb3. Read the comment docs.

@peterschrammel peterschrammel removed their assignment Jul 21, 2022
Copy link
Collaborator

@martin-cs martin-cs left a comment

Choose a reason for hiding this comment

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

Yes. Not sure why type was being passed independently. Feels like probably like part of an older design, possibly for handling untyped access?

return bv_get_rec(expr, map_entry.literal_map, 0);
else
{
PRECONDITION(expr.type() == typet{});
Copy link
Collaborator

Choose a reason for hiding this comment

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

This gives me lots of "I don't think types are supposed to work like that" feelings. But I recognise that this is an improvement on what is there and not what the patch is addressing.

@@ -274,7 +269,9 @@ exprt boolbvt::bv_get_rec(

exprt boolbvt::bv_get(const bvt &bv, const typet &type) const
Copy link
Member

Choose a reason for hiding this comment

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

Can we get rid of this method?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not unless we get rid of boolbvt::bv_get_cache, which invokes this method.

@tautschnig tautschnig merged commit 24c825a into diffblue:develop Jul 21, 2022
@tautschnig tautschnig deleted the bugfixes/typed-bv_get_rec branch July 21, 2022 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants