Re: more algebra

From: paul c <toledobythesea_at_oohay.ac>
Date: Sun, 11 Apr 2010 13:31:29 GMT
Message-ID: <Rakwn.1479$Z6.511_at_edtnps82>


compdb_at_hotmail.com wrote:
> On Apr 6, 5:05 pm, paul c <toledobythe..._at_oohay.ac> wrote:
>

>> ( r GROUP  ( { N } AS n ) )  =  ( EXTEND  r  ADD  ( RELATION { TUPLE { N
>>   }  AS  n )  { K, n }
>> will be 'true' iff r satisfies the key constraint.

>
> If we are precise it's a bit more complicated:
> ( r GROUP ( { n1, ... } AS n ) ) =
> ( EXTEND r ADD RELATION { TUPLE { n1 AS n1, ... } } AS n )
> { k1, ..., n }
>
>> I admit the above is pretty ugly but underneath it's pretty simple.

>
> Maybe, if you can find natural language to make it clear that this
> captures the idea of key constraint.
>
> You don't need to use COUNT or GROUP/nesting.
> (Ironically the latter, like the former,
> requires an extension to the original algebra.)
> "A k-subtuple can't appear with a second n-subtuple."
> Using calculus (with named arguments):
> FALSE =
> EXISTS k1, ..., n1, ..., _n1, ... :
> r(k1 as k1, ..., n1 as n1, ...)
> AND r(k1 as k1, ..., _n1 as n1, ...)
> AND n1 NOT= _n1 AND ....
> Using algebra (with parallel structure to above):
> DUM =
> ( ( r JOIN (r RENAME { n1 TO _n1, ...}))
> RESTRICT { n1 NOT= _n1, ...}
> ){ALL BUT}
> ...

That is the conventional definition, using cartesian product and rename.   I didn't say you NEED to use GROUP. Received on Sun Apr 11 2010 - 15:31:29 CEST

Original text of this message