473,699 Members | 2,801 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

left and overleft/notright revisited: why !>> and !<< might be poornames

Just thought of this, in reference to earlier discussion about replacing
&< and &> with !<< and !>> to correct the problem w/ rtree search
strategy "replacemen t" at the node level.

It's possibly nit-picking but I'm that way.

Again, using 1D definitions here.

S << T can be (and I would expect, usually is) defined as "for all x in
S and y in T, x < y" or the equivalent thereof (not exist x in s, y in T
s.t. x>=y, etc).

S !>> T could be defined in at least two ways:

As logical union of << and && cases: S !>> T iff S << T or S && T
As negation of >>: S !>> T iff not (S >> T)

which looked fine, until today when I thought of this.

Consider the empty interval (n,n) (any empty interval will do, they're
all the same empty set), and any nonempty interval (and thus set) S.
For convenience I'll refer to (n,n) in its set form, {}.

Perhaps not so obviously, any of the following are true for all such S:
{} << S, S << {}, {} << {}, and conversely for >>. This holds true for
all positional "less than" and "greater than" operations I've ever seen
defined over sets (of "ordinary numbers" if you'll pardon that).

Now, if "!>>" (the replacement for overleft) is defined in the first
way, union of << and &&, then {} !>> S is true. On the other hand, if
"!>>" is defined in the second way, {} !>> S is false. Hmmm.

Observations:

1. This may be irrelevant. I don't know what the impact of attempting
to index an empty open interval (or for that matter a singleton closed
interval) in an r-tree would be, but I imagine there might be problems
finding any such interval using any of the strategy operators (except
maybe ~=). (I'd also imagine whatever type was using the rtree would
need to pick "an" empty interval to represent all of them, but that's
another can of worms). Whether immediately relevant or not, I feel the
usual definition for the operator should be clear, at least in comments.

2. The whole point of the operator replacement at the node level, you're
testing a box which contains some target T, rather than (in this case)
lying to the left of T. Thus, the "left or overlap" definition for !>>
seems appropriate, which would mean that !>> really isn't the negation
of >>.

Proposal:

any of:

1. Keep !>> and !<< as "good enough", document (somewhere) that they are
properly defined as "<< or &&" and ">> or &&" respectively, and thus
aren't equivalent to !S>>T and !S<<T resp. where empty open intervals
are concerned;

2. Change the operator names to be more consistent with the definition;

3. Change the definition to !S>>T and !S<<T resp. and comment that empty
open intervals are non-indexable,

or

4. Do nothing, and assume anyone creating a data type that supports open
intervals, and then inserting an empty open interval into an r-tree
index, deserves whatever they get. :)
Thoughts?

-- Bill

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 23 '05 #1
2 1264
Tom Lane wrote:
William White <bw****@frognet .net> writes:
Consider the empty interval (n,n) (any empty interval will do, they're
all the same empty set),

I don't think that's the case. [0,0) and [1,1) are certainly
distinguishable given the normal machine representation of intervals.


Every definition of an interval I've seen defines it in terms of a set.

For example, the interval (a,b) in R is the set {x : x > a and x < b}.
Thus, the empty set does not have a unique representation as an interval
in R, just as the nondirected line segments ((0,0),(1,1)) and
((1,1),(0,0)) are identical regardless of the fact that the
representations are not.

Incidentally, my attempts to construct valid operators which *do* treat
various open empty intervals as distinct led to some rather peculiar
(usually inconsistent) results, especially when operating upon empty
open intervals whose endpoints were identical (e.g., (a,a] and (a,a]).
If you use a mathematical model that says they're not distinguishable ,
that says to me that you chose the wrong model --- especially when the
model leads you into logical difficulties that need not (and do not)
exist in the actual implementation.


Do you have an alternative to suggest, given the requirements that the
operators return the expected results on nonempty intervals, and the
usual logic applies (e.g., S @ T and S ~ T ==> S ~= T)
Thanks,

-- Bill

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #2
William White <bw****@frognet .net> writes:
Consider the empty interval (n,n) (any empty interval will do, they're
all the same empty set),


I don't think that's the case. [0,0) and [1,1) are certainly
distinguishable given the normal machine representation of intervals.
If you use a mathematical model that says they're not distinguishable ,
that says to me that you chose the wrong model --- especially when the
model leads you into logical difficulties that need not (and do not)
exist in the actual implementation.

My feeling about it is [0,0) << [1,1) but not vice versa.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postg resql.org so that your
message can get through to the mailing list cleanly

Nov 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
2409
by: Roger Price | last post by:
Thank you to Yang (Is that your first name?) and Andy for your suggestions. I am 99% of the way there but now cannot get the "Reset" button to work. I have included the whole of my code and would appreciate it if someone could explain where I am going wrong. TIA Roger
21
2984
by: Chris Reedy | last post by:
For everyone - Apologies for the length of this message. If you don't want to look at the long example, you can skip to the end of the message. And for the Python gurus among you, if you can spare the time, I would appreciate any comments (including words like evil and disgusting, if you think they are applicable :-}) on the example here. Kenny -
10
5837
by: Bulba! | last post by:
Hello everyone, I'm reading the rows from a CSV file. csv.DictReader puts those rows into dictionaries. The actual files contain old and new translations of software strings. The dictionary containing the row data looks like this: o={'TermID':'4', 'English':'System Administration', 'Polish':'Zarzadzanie systemem'}
37
2141
by: Kay Schluehr | last post by:
Since George Sakkis proposed a new way of doing list comprehensions http://groups-beta.google.com/group/comp.lang.python/browse_frm/thread/ac5023ad18b2835f/d3ff1b81fa70c8a7#d3ff1b81fa70c8a7 letting tuples-like objects (x,y,z=0) acting as functions on other tuples I wonder why this would not be a good starting point of rethinking anonymus functions? In Georges proposition the action is
3
3505
by: Haines Brown | last post by:
I thought I had understood this issue and implemented a work around, but now when I check on IE5, it is not working: ... #IE-hack { margin-left: auto; margin-right: auto; width: 20em; text-align: center; }
16
9257
by: Uncle Pirate | last post by:
This has me stumped. I am trying to use as little space as possible at the top of my document but Firefox/Mozilla insists on placing vertical space before any element. IE displays it correctly (as I want). At one point, I set some negative top margins which moved the graphics above the page in IE. Here's the link: http://abateofnm.org/ I've tried reformatting the HTML to assure there is no white space and I've tried setting top...
1
3037
by: alexsg | last post by:
A little while ago Ron P kindly responded to my inquiry on how to copy the first line of memo field into a text field, using a query: left(,instr(1,,vbCrLf)-1) This is great, but I would like to do this on a form, so that the person entering the memo can use a button to paste the 1st line to a title (text) field. I'm having trouble setting up the code to do this. I'd also appreciate some ideas on how to get the 2nd and 3rd lines...
1
1454
by: TopherB | last post by:
It came to me while sleeping that my question was not being answered (all answered where in the form of changing the question) because the answer was not readily available. So I thought I might ask how to determine with of the actual window and calculate the image left from that since I could determine the image width. But then I realized that the position of the mouse pointer would work just fine and so some googling resulted in this code: ...
4
2216
by: mdarling | last post by:
I am using Lebans lady example to mix Bold and Normal in a single line text box, I have altered it and I still cant get it to bold the text I need bolded I have pasted it here, can somebody help? I need Last_Name, Suff, First_Name, Middle_Name bolded, the rest normal. Thanks Melissa ' **START CODE ' Written by Stephen Lebans 1999 ' Stephen@lebans.com ' www.lebans.com ' This sample database is for a Poster named "Lady". ' She...
0
8615
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9173
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8911
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7748
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5872
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4375
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4627
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3057
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2345
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.