Re: boolean datatype ... wtf?

From: David BL <davidbl_at_iinet.net.au>
Date: Wed, 29 Sep 2010 20:53:34 -0700 (PDT)
Message-ID: <da240d3d-29cb-4126-8b55-272e35643a58_at_t5g2000prd.googlegroups.com>


On Sep 29, 10:45 pm, Bob Badour <bbad..._at_pei.sympatico.ca> wrote:
> Paul Mansour wrote:
> > On Sep 29, 9:46 am, paul c <toledobythe..._at_oohay.ac> wrote:
>
> >>On 29/09/2010 4:51 AM, Paul Mansour wrote:
> >>...
>
> >>>What is the problem with a Boolean data type?
> >>>.
> >>>It is fundamental - so fundamental that in TTM it is the only
> >>>required scalar data type: “We require that at least one built-in
> >>>scalar type be supported : Namely, type “Boolean” (BOOLEAN in Tutorial
> >>>D”).
>
> >>>Date and Darwen go on to give the obvious reasons for this.
>
> >>>The fact that DEE and DUM may be interpreted as TRUE and FALSE is not
> >>>relevant. The result of A=B or A>B is not a relation.
>
> >>Aren't A=B and A>B relations?
>
> > I was under the impression that they are not, even if A and B are
> > relations. But I may have misintepreted C.J. Date on this.
>
> > In "Database in Depth" he writes:
>
> > "In Chapter 2, I mentioned the fact that the equality comparison
> > operator "=" applies to every type. In partitular, therefore it
> > applies to relation types.... Now I must immediatly explain that these
> > opeartors are not relational operators as such -- that is they are not
> > part of the relational algebra-- because their result is a truth
> > value, not a relation."
>
> An algebra is a set of values and a set of operations closed on that set
> of values.
>
> Date is saying that comparisons are not part of the relational algebra
> in the same way that division is not part of the integer algebra because
> dividing any two arbitrary integers is not necessarily closed on integers.
>
> Consider an expression of the form:
>
> R = f(A,B)
>
> where both A and B are relations and f is some binary operation. If f is
> natural join, then R is a relation. If f is a comparison, then R is not
> a relation; it is a boolean.
>
> Similarly, if A and B are integers and f is multiplication, then R is an
> integer whereas if f is division, R is not necessarily an integer.
>
> The expression R = f(A,B) itself, however, is always a relation. We
> could re-express the relation as g(R,A,B)
> g: {(R,A,B)| R = f(A,B)}

Nonsense. Assuming that we don't consider the boolean values to be relations, an expression like

    R = f(A,B)

is not a set of tuples. In a sentence in which this expression appears it stands for or evaluates to some boolean value. By contrast the expressions

    g

and

    {(R,A,B)| R = f(A,B)}

indeed stand for a set of tuples. Received on Thu Sep 30 2010 - 05:53:34 CEST

Original text of this message