Re: constraints in algebra instead of calculus

From: Jan Hidders <hidders_at_gmail.com>
Date: Fri, 15 Jun 2007 08:28:43 -0700
Message-ID: <1181921323.044497.27420_at_w5g2000hsg.googlegroups.com>


On 15 jun, 16:32, Bob Badour <bbad..._at_pei.sympatico.ca> wrote:
> Jan Hidders wrote:
> > On 15 jun, 04:46, paul c <toledobythe..._at_oohay.ac> wrote:
>
> >>paul c wrote:
>
> >>>paul c wrote:
>
> >>>>...
>
> >>>>3) Use TTM-style GROUP/UNGROUP to test that
> >>>>UNGROUP {NK}
> >>>> (GROUP ( (A GROUP {NK} as NK ))
> >>>>= A
> >>>>...
>
> >>>Oops, that last one was completely nuts, can't remember now whatever I
> >>>was thinking. Sorry for wasting people's time.
>
> >>>p
>
> >>Marshall, this mis-step has bugged me for days, for no reason that I can
> >>explain, except that at one time it all seemed crystal-clear and I'm not
> >>sure now whether my memory is bad or whether I was flat-out wrong to
> >>think of GROUP et cetera in this way. This might be what I was trying
> >>to remember:
>
> >>(Assuming D&D's Tutorial D syntax which I've probably mangled but hoping
> >>you get the drift. I've tried to write it slow-motion with a bunch of
> >>relvars and assignments, because I don't think I could avoid those
> >>without error, even when wide-awake and sober.)
>
> >>R is relvar name, A is candidate key, B is set of all the non-key
> >>attributes.
>
> >>1. R1 := R GROUP ( {A} as gA )
> >>2. R2 := R1 GROUP ( {B} as gB)
> >>3. R3 := R GROUP ( {B} as gB )
> >>4. R4 := R3 GROUP ( {A} as gA )
> >>5. R5 := R4{gB} <AND> R2
> >>6. R6 := UNGROUP ( R5 UNGROUP (gB)) (gA) )
> >>7. (constraint) R6 = R
>
> > You can simplify that a bit:
>
> > R1 := (R{B}) GROUP {B} AS gB
> > R2 := (R GROUP {B} AS gB){gB}
> > constraint: R1=R2
>
> That constraint looks like a tautology to me. Can you explain how any
> relation with a B attribute could fail the constraint?

I'm not that well versed in the TTM / Tutorial D notation so I may have abused the notation a bit. To clarify:

- B is a set of attributes (the non-key attributes)
- R{B} denotes the projection of R on the attributes in B
- R GROUP {B} AS C groups the attributes in B and names the resulting
set-valued attribute C

That probably clears it up, but I'll give a small example anyway (note: here B is not a set of attributes but a single attribute):

Assume R = { (A:1, B:2), (A:1, B:3) }

R{B} = { (B:2}, (B:3) }
R1 = R{B} GROUP {B} AS gB = { (gB:{ (B:2} }), (gB:{ (B:3) }) }

(R GROUP {B} AS gB) = { (A:1, gB:{ (B:2}, (B:3) }) } R2 = (R GROUP {B} AS gB){gB} = { (gB:{ (B:2}, (B:3) }) }

So you see that in this case R1 and R2 are not equal, which indicates that {A} is not a superkey in R.

  • Jan Hidders
Received on Fri Jun 15 2007 - 17:28:43 CEST

Original text of this message