-
Notifications
You must be signed in to change notification settings - Fork 273
Simplifier and symex rewriting fixes/extensions #731
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
Changes from all commits
7064483
ddd3d03
77236cc
81943f2
71e9642
14c00dc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -242,12 +242,12 @@ exprt flatten_byte_extract( | |
|
||
byte_extract_exprt tmp(unpacked); | ||
tmp.type()=subtype; | ||
tmp.offset()=simplify_expr(new_offset, ns); | ||
tmp.offset()=new_offset; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also wondering about the right place for this -- perhaps where flatten_byte_* is used? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am also kind of tempted to do the flattening in the simplifier. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I do agree that this should be moved to the simplifier (also note that it only has dependencies within util/), but may I suggest that this happens as a separate PR? Otherwise this PR will become huge. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, separate PR There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, I've put a note on my TODO list. I'll take care of it later on. |
||
|
||
array.copy_to_operands(flatten_byte_extract(tmp, ns)); | ||
} | ||
|
||
return array; | ||
return simplify_expr(array, ns); | ||
} | ||
} | ||
else if(type.id()==ID_struct) | ||
|
@@ -277,13 +277,13 @@ exprt flatten_byte_extract( | |
|
||
byte_extract_exprt tmp(unpacked); | ||
tmp.type()=comp.type(); | ||
tmp.offset()=simplify_expr(new_offset, ns); | ||
tmp.offset()=new_offset; | ||
|
||
s.move_to_operands(tmp); | ||
} | ||
|
||
if(!failed) | ||
return s; | ||
return simplify_expr(s, ns); | ||
} | ||
|
||
const exprt &root=unpacked.op(); | ||
|
@@ -333,7 +333,7 @@ exprt flatten_byte_extract( | |
{ | ||
concatenation_exprt concatenation(src.type()); | ||
concatenation.operands().swap(op); | ||
return concatenation; | ||
return simplify_expr(concatenation, ns); | ||
} | ||
} | ||
|
||
|
@@ -413,7 +413,7 @@ exprt flatten_byte_update( | |
result.swap(with_expr); | ||
} | ||
|
||
return result; | ||
return simplify_expr(result, ns); | ||
} | ||
else // sub_size!=1 | ||
{ | ||
|
@@ -512,7 +512,7 @@ exprt flatten_byte_update( | |
result=with_expr; | ||
} | ||
|
||
return result; | ||
return simplify_expr(result, ns); | ||
} | ||
} | ||
else | ||
|
@@ -583,7 +583,7 @@ exprt flatten_byte_update( | |
// original_bits |= newvalue | ||
bitor_exprt bitor_expr(bitand_expr, value_shifted); | ||
|
||
return bitor_expr; | ||
return simplify_expr(bitor_expr, ns); | ||
} | ||
else | ||
{ | ||
|
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.
Wouldn't the natural place for this to happen be the simplifier?
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.
While that is true, it would cause/require repeated simplification of the same expression (note that this simplification needs to happen before doing
symex_assign_*
). It may, however, also be useful to add this to the simplifier as a fallback?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.
Not sure the object descriptors fit into simplifier; leave as is for now.