Given a sequence of intervals $I_1, I_2, \ldots$, is there an efficient way to detect whether some interval $I_i$ is completely contained in the union of the preceding intervals $I_1, \ldots, I_{i-1}$?
For example, in the sequence $(0, 5), (5, 10), (2, 6)$, the interval $(2,6)$ is covered by the previous intervals, which cover the full range $(0, 10)$.
In contrast, in the sequence $(0, 5), (6, 10), (2, 6)$, the interval $(2,6)$ is not covered by the previous intervals, because the sub-interval $(5,6)$ is not covered.
My initial idea was to use an interval or segment tree to maintain the set of previous intervals, and check before adding each interval whether it is fully contained in the set. However, most algorithms construct the tree efficiently by first pre-sorting the intervals. In contrast, it seems like I need an on-line algorithm that efficiently merges intervals. I also don't need to maintain the original intervals (they can be merged), and lookup speed is not important.
The application here is exception tables in bytecode. I want to determine whether a given bytecode range is already covered by the ranges that precede it.