Def_exc: Fix issues in leq, join, narrow, meet with broken checking for in_range#100
Conversation
|
These exclusion sets have been explored in this SAS paper. In particular, Example 6 "any minimal quasi-join for the donut domain over intervals is non-associative". I haven't taken a very deep look at what remedies they suggest, but I think a deep read of that paper may be useful. |
|
It seems like the cases from above where analysis does not terminate are unrelated to the arrays, we have the same behavior for this simple example as well: analyzer/tests/regression/02-base/33-backwards-loop.c Lines 1 to 10 in 037ac0d The change that causes it to no longer terminate is this one in the Old analyzer/src/cdomains/intDomain.ml Lines 735 to 739 in c5968eb This implementation of Here it terminates with the following value in line 10:
This is due to New analyzer/src/cdomains/intDomain.ml Lines 722 to 729 in 037ac0d analyzer/src/cdomains/intDomain.ml Lines 786 to 789 in 037ac0d This problem is fixed here, but now it takes as many iterations to terminate as there are negative numbers in the interval, so 2^31 in this case. |
|
Changing |
|
A naive question: why does narrowing for exclusions sets always use the meet operation? That seems like an interval narrowing always improving the result. Maybe just meet (use refined value) if exclusion set is empty, but do not grow it if it contains any elements already. Do we actually need exclusion sets to be refined? [Edited] I forgot my main question. Simmo had a similar case in his path-sensitive domain where backward looping failed, but forward iteration worked. Are we handling negative numbers differently, or why is this only triggered for |
Not so much a naive question as a good one! Looks like we replaced
No, it does not have anything to do with negative numbers or iterating backwards per se, we have the same behavior in all of these cases here. It's just that the iterating backwards case is the one that appears most natural out of all of those. |
This was erroneously changed to `narrow = meet` in #97
|
I moved the parts that will still be relevant after merging this into #105 |
This fixes some of the issues quickcheck (see #99) found for
def_exc.leq: betweenDefiniteandExcludeddid not take the ranges into accountjoin: was too eager to increase the range.meet: checked whether the excluded value on the right was in the range interval instead of checking if it is in the range represented by that intervalIt also fixes an issue where
narrowwas changed by mistake in #97 causing a time-out on some of the regression tests.It now runs the quickchecks but skips the test for associativity of join, as our join is not associative.
The join i still not associative
Because of the ranges (fixed now)
This problem comes from having to chose an exclusion range for a join of two definites. Whichever way one does this (so
longvs.unsigned longhere), this problem will crop up.I guess one could go to the non-C range of
[0,n-1]for values that fit both into the signed and unsigned type of size n.And more fundamentally