Re: constraints in algebra instead of calculus

From: Jan Hidders <hidders_at_gmail.com>
Date: Tue, 19 Jun 2007 05:04:33 -0700
Message-ID: <1182254673.586017.295260_at_w5g2000hsg.googlegroups.com>


On 19 jun, 13:05, "David Cressey" <cresse..._at_verizon.net> wrote:
> "Jan Hidders" <hidd..._at_gmail.com> wrote in message
>
> news:1182241089.155428.89490_at_q69g2000hsb.googlegroups.com...
>
>
>
> > On 19 jun, 08:26, "David Cressey" <cresse..._at_verizon.net> wrote:
> > > "paul c" <toledobythe..._at_oohay.ac> wrote in message
>
> > >news:vNFdi.37701$NV3.32514_at_pd7urf2no...
>
> > > I can't see much use for grouping on all attributes. It seems to me
> that
> > > this has to be a null operation.
>
> > That would actually make the math harder, which is often a bad sign.
> > Right now the definition is quite simple:
>
> > R GROUP A AS B = { t[H-A] + (B : { t'[A] | t' in R, t'[H-A]=t[H-A] })
> > | t in R }
>
> > where
> > - H is the set of all attributes of R
> > - t[X] is the projection of tuple t on the set of attributes X
> > - + is tuple concatenation
> > - (B : v) constructs a tuple with a single field B with value v
>
> > If you let A be equal to H then
> > - H-A is the empty set
> > - t[H-A] is the empty tuple () for all t
> > - t[A] = t for all t in R,
> > so you get:
>
> > { () + (B : { t' | t' in R, ()=() }) | t in R } =
> > { (B : { t' | t' in R }) | t in R } =
> > { (B : { t' | t' in R }) } =
> > { (B : R) }
>
> > Your suggestion would create an exception to that rule.
>
> It wasn't my intent to make a suggestion. It was supposed to be an
> observation. An incorrect one, it would appear from your response.
>
> It sounds like I'm mixed up on what GROUP does. In particular, it sounds
> like I was confusing
>
> R GROUP A AS B with
> R GROUP (H-A) AS B
>
> Where can I go for a definition of GROUP?

But I already gave you one! :-) Ok, well, if you insist, Paul C already gave the linke before. On

<http://www.dcs.warwick.ac.uk/~hugh/TTM/APPXA.pdf>

you can read:

[begin quote]
Let relation r have attributes A, B, ..., C, D, E, ..., F. Then the Tutorial D <group>

  r GROUP ( { D, E, ..., F } AS X )

is shorthand for the Tutorial D expression

  ( EXTEND r ADD (

      r AS RR ,
      RELATION { TUPLE { A A, B B, ..., C C } } AS TX ,
      RR COMPOSE TX AS X )

  ) { A, B, ..., C, X }

(where RR and TX are attribute names not already appearing in r), and can therefore be expressed in A.
[end quote]

Here the COMPOSE is like the natural join except it projects the join attributes away. Note that in the above it actually performs a semijoin.

Of course, this is all incredibly involved, clumsy and verbose compared to the elegant and more standard NRC (Nested Relational Calculus), but I digress. :-)

  • Jan Hidders
Received on Tue Jun 19 2007 - 14:04:33 CEST

Original text of this message