# Re: Declaring super types

Date: Wed, 21 Apr 2010 16:51:25 -0700 (PDT)

> On Apr 20, 3:03 pm, r..._at_raampje.lan (Reinier Post) wrote:
>
>
>
>
>
> > >On Apr 19, 1:06 pm, r..._at_raampje.lan (Reinier Post) wrote:
> > >> ... "is a" does have a simple, useful and consistent
> > >> definition for the relational model: for relvars R, S, we can write
>
> > >>   R is a S
>
> > >> as a shorthand for:
>
> > >>   + all attributes of S are attributes of R;
> > >>   + those attributes are a (possibly super)key of R, and
> > >>   + R projected on those attributes is always a subset of S.
> > >>  ...
>
> > >Are you saying
>
> > >"R is a S"
>
> > >is eqivalent to
>
> > >"R join S = R"?
>
> > Hmmm ... that seems a nice shorthand for the first and third clause,
> > but it doesn't imply the second one.

Some typo corrections.

> Well, let's approach this question from math perspective. I suggest
> the "is a" is some [partial] order between a pair of relations, so it
> has to honor 3 laws:
>
> R < R
>
> R < S & S < R -> R = S
>
> R < S & S < T -> R < T
>
> One can prove that the order defined via join satisfies all them. The
> first one follows from join idempotence,
>
> R ^ R = R
>
> the second one from join symmetry,
>
> R ^ S = S ^ Y

R ^ S = S ^ R

> and the third one from join associativity
>
> given:
> 1. R ^ S = R
> 2, S ^ T = S
> ------------
> R ^ T = (R ^ S) ^ T = R ^ (S ^ T) = R ^ S = R
>
> There are two more idempotent symmetric relational algebra operations
> (one is D&D <AND>) that give rize to some other order relations.

typo: <AND> is natural join; I meant <OR>

> However, there is the strong reason to suspect that the order defined
> by join is the most important one (and, therefore, is candidate to
> represent "is a"). This is because the order introduced via
> generalized union (or relational algebra projection) coinsides it!

To recoup: there are four idempotent symmtric relational algebra operations:
natural join, generalized (or inner) union, outer union (aka D&D <OR>), and inner join, giving rise to four orders, only three of which are distinct. (The fact that inner join being non-associative still give rize to some order is rather subtle).

> So, you are suggesting that your definition gives rize to yet another
> order relation? Can you prove its three defining properties?- Hide quoted text -

Your definition seems to be consistent. In QBQL notation it asserts that

r < s & r#s < r#s`

the first condition is lattice order that I describe before. The second part is functional dependency expressed in terms of partitions. Here are partial order properties expressed and verified as QBQL assertions:

r < r & r#r < r#r`. -- reflexivity
r < s & r#s < r#s` & s < r & s#r < s#r -> r = s. -- antisymmetry (r < s & r#s < r#s` & s < t & s#t < s#t`) -> (r < t & r#t < r#t`). -- transitivity Received on Wed Apr 21 2010 - 18:51:25 CDT

Original text of this message