-
Notifications
You must be signed in to change notification settings - Fork 277
VSD - Further cross-representation expression evaluation #5887
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
VSD - Further cross-representation expression evaluation #5887
Conversation
As we look to do cross-representation evaluation, it's no longer meanful to have separate tests for "expressions involving constants", etc
rewrite_expression has, incorrectly, expected every term in the rewritten expression to be a constant. When there are intervals in play, this is clearly not the case. When we encounter an interval, don't attempt to coerce it to a constant expression, simply use the existing operand.
A constant of, say, 5 has a index_range of 5. A value_set of { 5, 6, 9 } therefore has an index_range of 5,6,9. An interval of [1, 3] has an index_range of 1,2,3. A value_set containing that interval should have the same index_range. A value_set of multiple constants and intervals should have an index_range which is the union of its contents index_range.
Codecov Report
@@ Coverage Diff @@
## develop #5887 +/- ##
===========================================
+ Coverage 72.95% 73.09% +0.13%
===========================================
Files 1425 1428 +3
Lines 154281 155058 +777
===========================================
+ Hits 112561 113341 +780
+ Misses 41720 41717 -3
Continue to review full report at Codecov.
|
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.
Thanks for the clean ups and the unit tests. I think any changes are best done with the upcoming review of VSD.
The PR follows on from #5880, completing the implementation work for value-sets and intervals.
The bulk of the PR is additional unit tests, confirming behaviour for the various combinations of constants, intervals, value-sets of constants, value-sets of intervals, and value-sets with mixed content.
The functional changes are quite small - a fix to value-set evaluation to properly handle intervals and a similar change to value-set index ranges (used when indexing into arrays) to remove the assumption the contents are all constants.