Range relationships
From LMNLWiki
Two Ranges that belong to different Limina have no relationships defined between them. All the following definitions assume that all ranges mentioned belong to the same Limen.
Two ranges are congruent iff their start and end properties are equal. If ranges are equal, they are necessarily congruent. (Congruent ranges were formerly known as clones.)
Let sA be the start property of range A, and eA be the value of the end property of range A; and likewise for range B.
Range A encloses range B iff they are not congruent, sA <= sB, and eA >= eB. This relation can be exhaustively partitioned into three sub-relations:
- Range A strictly encloses range B iff sA < sB and eA > eB.
- Range A encloses range B with a suffix iff sA = sB and eA > eB.
- Range A encloses range B with a prefix iff sA < sB and eA = eB.
Range A fits within range B iff they are not congruent, sA >= sB, and eA <= eB. This relation can be exhaustively partitioned into three sub-relations:
- Range A fits strictly within range B iff sA > sB and eA < eB.
- Range A is a prefix of range B iff sA = sB and eA < eB.
- Range A is a suffix of range B iff sA > sB and eA = eB.
Range A and range B overlap iff either sA or eA (but not both) is greater than sB and less than eB. This relation can be exhaustively partitioned into two sub-relations:
- If sA < sB < eA < eB, then range A overlaps the start of range B.
- If sB < sA < eB < eA, then range A overlaps the end of range B.
Range A precedes range B iff eA <= sB. This relation can be exhaustively partitioned into two sub-relations:
- Range A strictly precedes range B iff eA < sB.
- Range A immediately precedes range B iff eA = sB.
Range A follows range B iff sA >= eB. This relation can be exhaustively partitioned into two sub-relations:
- Range A strictly follows range B iff sA < eB.
- Range A immediately follows range B iff sA = eB.
These definitions partition the sequence of ranges belonging to a particular Limen with respect to a given range. Given a range A, all the other ranges belonging to the same Limen must either: precede A (either strictly or immediately), enclose A (either strictly, with a suffix, or with a prefix), overlap A (either the start of A or the end of A), be congruent to A, be within A (either strictly or as a suffix or as a prefix), or follow A.
The enclosing ranges of a range are all those ranges that enclose the range. The closest enclosing ranges of a range are those enclosing ranges of the range that do not enclose any other of the range's enclosing ranges.
The enclosed ranges of a range are all those ranges that are within the range. The closest enclosed ranges of a range are those enclosed ranges of the range that are not within any other of the range's enclosed ranges.
The start order of a sequence of ranges is defined such that range A is before range B in start order iff sA < sB. If the start points of the two ranges are the same, then range A is ordered before range B if its length is greater than range B's length. If the lengths of the two ranges are the same, then range A is before range B if it was before range B in the original sequence. The reverse start order is the precise reverse of this ordering.
All the ranges that precede a range are before it in start order; all the ranges that follow a range are after it in start order. All the ranges that overlap the start of a range are before it in start order; all the ranges that overlap the end of a range are after it in start order. All the enclosing ranges of a range are before it in start order; all the enclosed ranges of a range are after it in start order. The ranges congruent to a range A might appear before or after A in start order, but not before or after another range that is not congruent to A.
References
J.Allen. Time and time again : The many ways to represent time. International Journal of Intelligent Systems, 6(4):341-355, July 1991 [1]
- Range relationships are similar to time relationships, but have slightly different names to reflect spatial rather than temporal relationships. In addition, Allen only considers one direction of relationship (e.g. "before" but not "after") The following table indicates the mapping.
-
Allen relation Range relation A before B A strictly precedes B A meets B A immediately precedes B A overlaps B A overlaps the start of B A starts B A is a prefix of B A during B A fits strictly within B A finishes B A is a suffix of B A equals B A is congruent with B