On Sep 4, 2006, at 12:44 , Tom Lane wrote:

OK, so if everyone is leaning to #3, the name game remains to be played.
Do we all agree on this:

        "x @> y" means "x contains y"
        "x @< y" means "x is contained in y"

Are we all prepared to sign a solemn oath to commit hara-kiri if we
invent a new datatype that gets this wrong?  No?  Maybe these still
aren't obvious enough.

When I've been working on range/interval stuff, I tried to come up with a self-consistent set of operator symbols for the Allen operators, which includes the "contains" and "is contained in" pair. Here's what I came up with.

Where r1 and r2 are ranges

r1 >> r2    r1 is strictly during r2, i.e., r1 is a strict subset of r2
r1 << r2    r2 is strictly during r1, i.e., r2 is a strict subset of r1
<< and >> are meant to evoke the (strict) subset (⊂ or &sub;) and superset (⊃ or &sup;) operators.

r1 <<= r2   r1 is a superset of r2
r1 =>> r2   r1 is a subset of r2

<<= and =>> are mean to evoke the subset (⊆ or &sube;) and superset (⊇ or &supe;) operators.

Assuming the meaning of contains and is contained in is inclusive (rather than strict), then we'd have

a <<= b : a contains b
a =>> b : a is contained by b

I've included the other Allen operators at the bottom for completeness.


Michael Glaesemann
grzm seespotcode net

r1 = r2     r1 equals r2
r1 <> r2    r1 does not equal r2
For the following, the < or > indicates the relative position of the two ranges if they were depicted on an line that increases from left to right.

r1 <| r2    r1 strictly meets r2, i.e.,  begin(r2) is next(end(r1))
r1 |> r2    r2 strictly meets r2, i.e., begin(r1) is next(end(r2))
The | is meant to evoke the meeting point of r1 and r2. They don't overlap, they are just abutting. The < or > "points" to the direction the of the range it points to relative to the other range, i.e., r1 is to the left of r2 on an line that increases from left to right.

r1 </ r2    r1 is before r2
r1 /> r2    r1 is after r2
The / is meant to evoke the fact that they are not abutting.

r1 <& r2    r1 strictly overlaps r2
r1 &> r2    r2 strictly overlaps r1
The & is meant to evoke "and", in that there is something the two ranges share.

r1 @< r2    r1 starts r2
r1 @> r2    r2 starts r1
r1 >@ r2    r1 finishes r2
r1 <@ r2    r2 finishes r1
The @ is meant to indicate the point where the two ranges share a begin or end point. E.g., for r1 @< r2, r1 and r2 start together, and end(r1) < end(r2). For r1 <@ r2, begin(r1) < begin(r2), but they share the same end point.


---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to [EMAIL PROTECTED] so that your
      message can get through to the mailing list cleanly

Reply via email to