Re: boolean datatype ... wtf?
Date: Wed, 29 Sep 2010 08:00:36 -0700 (PDT)
Message-ID: <26ef65e8-949d-42e3-ad4c-c9a616a70afb_at_g6g2000pro.googlegroups.com>
On Sep 29, 7:07 am, Erwin <e.sm..._at_myonline.be> wrote:
> On 29 sep, 15:46, 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?
>
> Here we go again ...
>
> But then again, incidentally, he did not say that 'A=B' isn't a
> relation. He said that _THE RESULT OF_ 'A=B' isn't a relation.
>
> Conceptually, it could be argued that what a language implementation
> achieves when it evaluates an expression such as 'A=B', is to join a
> tuple {A,B} with the EQUALS relation (which is implicitly defined by
> the system) of the pertinent type, and then check whether the result
> of that join is empty or not ...
>
> Fair bit of hairsplitting going on, if you ask me ...- Hide quoted text -
I would argue that we join (ordinary finite) relations with equality predicates much more often that it appeared at the first sight. One operation which utility can rival that of natural join is composition (aka set intersection join). This is merely a natural join projected to the set of distinct attributes. For example composition of
Pets=[nickname specie]
folly dog scruffy cat
;
with
Fed=[name nickname time]
claire folly 200 max folly 200 max folly 300 max scruffy 200
;
is
Pets/^Fed=[name specie time]
claire dog 200 max cat 200 max dog 200 max dog 300
;
It is essentially natural join with the common column "nickname" REMOVEd (to use A-Algebra terminology:-).
Renaming -- which is arguably second most used relational operation -- is composition with equality predicate:
Pets/^[nickname=petname]=[petname specie]
folly dog scruffy cat
; Received on Wed Sep 29 2010 - 17:00:36 CEST