Skip to content

Conversation

@smowton
Copy link
Contributor

@smowton smowton commented Jul 25, 2019

This means that any member-of-symbol constructs introduced by a nested dereference,
such as x->y ==> (x == &o1 ? o1 : o2).y, can be simplified to produce e.g.
(x == &o1 ? o1.y : o2.y) ==> (x == &o1 ? o1..y : o2..y). value_set_dereferencet will
then special-case the if-expression, dereferencing the inner o1..y and o2..y individually.
In the best case where each has a single possible alias, &o3 and &o4 respectively, we
end up with (x == &o1 ? &o3 : &o4), rather than the current result:
let p = (x == &o1 ? o1 : o2).y in (p == &o3 ? o3 : o4).

The net benefit: smaller expressions, and thanks to simpler expressions a higher chance that future simplification will succeed.

This means that any member-of-symbol constructs introduced by a nested dereference,
such as x->y ==> (x == &o1 ? o1 : o2).y, can be simplified to produce e.g.
(x == &o1 ? o1.y : o2.y) ==> (x == &o1 ? o1..y : o2..y). value_set_dereferencet will
then special-case the if-expression, dereferencing the inner o1..y and o2..y individually.
In the best case where each has a single possible alias, &o3 and &o4 respectively, we
end up with (x == &o1 ? &o3 : &o4), rather than the current result:
let p = (x == &o1 ? o1 : o2).y in (p == &o3 ? o3 : o4)
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: 8ff8927).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/120726270

@codecov-io
Copy link

Codecov Report

Merging #4949 into develop will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #4949      +/-   ##
===========================================
+ Coverage    69.27%   69.27%   +<.01%     
===========================================
  Files         1307     1307              
  Lines       108143   108145       +2     
===========================================
+ Hits         74916    74918       +2     
  Misses       33227    33227
Impacted Files Coverage Δ
src/goto-symex/symex_dereference.cpp 89.18% <100%> (+0.19%) ⬆️

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 91ccdfb...8ff8927. Read the comment docs.

@smowton smowton merged commit 455e8f9 into diffblue:develop Jul 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants