Re: more closed-world chatter
From: Bob Badour <bbadour_at_pei.sympatico.ca>
Date: Thu, 03 May 2007 11:37:18 -0300
Message-ID: <4639f36f$0$4040$9a566e8b_at_news.aliant.net>
>
> Thanks, I feel better now. Still, I'd like to know I could paraphrase
> that query a little more formally, say using D&D <AND>. But the
> stipulation "It is required that if <A,T1> is in Hr1 and <A,T2> is in
> Hr2, then T1 = T2" stymies me, eg., if pricedomain={1,2} and
> anotherdomain={3}, it seems that <AND> isn't defined.
>
> (I realize I could get the "false" answer suggested if only one side of
> the <AND> used the "Items" attribute but if I've already invented a
> different domain name, why should I need to invent a different attribute
> name. Seems like phrasing the query after I know the answer.)
>
> Any comment?
Date: Thu, 03 May 2007 11:37:18 -0300
Message-ID: <4639f36f$0$4040$9a566e8b_at_news.aliant.net>
paul c wrote:
>> paul c wrote: >> >>> paul c wrote: >>> >>>> If I have a domain of items consisting of the values "a" and "b" and >>>> a domain of item prices consisting of the values "1" and "2" and an >>>> empty relation {ItemID, Price} known by the relvar name "Items", I >>>> take it that the logical complement of "Items" has four tuples - >>>> loosely, <a,1>,<a,2>,<b,1>,<b,2>. >>>> >>>> If I select from Items where Price = 3, should a dbms answer with an >>>> empty relation or should it take exception, such as "illegal >>>> question"? If it doesn't take exception, then I'd guess it is >>>> supposing a complement that has an infinite number of tuples which >>>> couldn't be implemented on a finite computer. >>>> >>>> As unhappy as this makes me, I'm now thinking exceptions can't be >>>> avoided in practice. >>>> >>>> p >>> >>> Ie., is it a logical mistake to allow the query in the first place? >> >> No, it is not a logical mistake. Equality evaluates to false for >> values of disjoint types. Because 3 is not in your type, the >> comparison evaluates to false. >> ...
>
> Thanks, I feel better now. Still, I'd like to know I could paraphrase
> that query a little more formally, say using D&D <AND>. But the
> stipulation "It is required that if <A,T1> is in Hr1 and <A,T2> is in
> Hr2, then T1 = T2" stymies me, eg., if pricedomain={1,2} and
> anotherdomain={3}, it seems that <AND> isn't defined.
>
> (I realize I could get the "false" answer suggested if only one side of
> the <AND> used the "Items" attribute but if I've already invented a
> different domain name, why should I need to invent a different attribute
> name. Seems like phrasing the query after I know the answer.)
>
> Any comment?
The comparison is necessarily defined in the most specific common supertype, which might be the universal supertype. I don't see the problem you are seeing. Obviously, you are joining another relation with a Price attribute defined on some supertype of the Price attribute in Items:
Items <AND> (Price = 3) Received on Thu May 03 2007 - 16:37:18 CEST