BinaryAnalysisPlatform / bap

Binary Analysis Platform
MIT License
2.07k stars 273 forks source link

uses Allen's Interval Algebra in the KB.Value merge implementation #1441

Closed ivg closed 2 years ago

ivg commented 2 years ago

In PR #1401, we rewrote the KB merge operation using an interval algebra that used only five relations between the intervals. This change introduced several bugs that weren't caught by our test system as our tree structure is very complex. PR #1439 attempted to fix the bugs but some were still overlooked. Apparently the choice of the interval algebra wasn't the right one as it was covering only a small subset of the set of possible relationships and its non-injective nature left a lot of room for errors.

A much better choice is the Allen's Interval Algebra that gives an exhaustive set of 13 distinct relationships between two intervals. We also extend it to the relation between a point and an interval to handle singleton ranges.