Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / General DB Topics / DB Theory / September 2005

Tip: Looking for answers? Try searching our database.

Question about Date & Darwen <OR> operator

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mikito Harakiri - 02 Sep 2005 23:05 GMT
Assuming domains x in {1,2} and y in {a,b} what is the result of

{(x=1)} <OR> {(y=a)}

? Is it

x y
- -
1 a
1 b
2 b

or

x y
- -
1 a
1 b
2 a
2 b

?
Marshall  Spight - 03 Sep 2005 00:10 GMT
> Assuming domains x in {1,2} and y in {a,b} what is the result of
>
> {(x=1)} <OR> {(y=a)}

As I understand it, the result would be:

x y
---
1 a
1 b
2 a

which is
{ (x, y) | x = 1 or y = a }

Marshall
Mikito Harakiri - 03 Sep 2005 00:18 GMT
> > Assuming domains x in {1,2} and y in {a,b} what is the result of
> >
[quoted text clipped - 10 lines]
> which is
> { (x, y) | x = 1 or y = a }

>From http://c2.com/cgi/wiki?RelationalAlgebra

a OR b : An extended form of union; if the headings of the operands
differ, then "missing" attributes take on all possible values. Thus the
result may be very large or even infinite. When the operands have the
same heading, then this is the same as a traditional SQL UNION, except
that all duplicates are always removed.

This informal description matches the other alternative. What is the
formal definition?
paul c - 03 Sep 2005 00:35 GMT
>>>Assuming domains x in {1,2} and y in {a,b} what is the result of
>>>
[quoted text clipped - 21 lines]
> This informal description matches the other alternative. What is the
> formal definition?

i assume you're referring to TTM page 56, which i misinterpreted for a
long time.

i believe the answer is not the above, rather there are 4 tuples, two
with x=1, ie. one for each of all possible values of the y domain and
two y=a, ie. one for each of all possible values of the x domain.

i posed another one like this a few months ago and only just realized i
had it wrong, even though somebody else had agreed with me!

i believe that ttm assumes that domains are finite, or at least that
relations are finite which would seem to imply finite domains.

p
Marshall  Spight - 03 Sep 2005 01:02 GMT
> >>As I understand it, the result would be:
> >>
[quoted text clipped - 7 lines]
> with x=1, ie. one for each of all possible values of the y domain and
> two y=a, ie. one for each of all possible values of the x domain.

I note that the above answer *does* have two tuples with x=1, and
two tuples with y=a. However if you count them up you will see
that makes for three, not four.

I don't see how one could argue for the tuple (x=2, y=b) to be
included,
since (x=2, y=b) doesn't satisy the condition that x=1 or y=a. Put
another way, if we project the result over x, we get a value that
wasn't in the x input relation, and if we project over y, we get
a value that wasn't in the y input relation.

Marshall
paul c - 03 Sep 2005 01:07 GMT
Marshall Spight wrote:

>>>>As I understand it, the result would be:
>>>>
[quoted text clipped - 20 lines]
>
> Marshall

you're right; the '2 b' tuple shouldn't be there.

thanks,
paul c
David  Cressey - 08 Sep 2005 14:06 GMT
> you're right; the '2 b' tuple shouldn't be there.

'2 b' or not '2 b',  that is the question, eh?

Sorry.  I couldn't resist.
VC - 03 Sep 2005 01:25 GMT
Hi,

>>>>Assuming domains x in {1,2} and y in {a,b} what is the result of
>>>>
[quoted text clipped - 24 lines]
> i assume you're referring to TTM page 56, which i misinterpreted for a
> long time.

I do not have TTM handy.  Could you kindly reproduce the <OR> definition for
my benefit ?

Thanks.
Marshall  Spight - 03 Sep 2005 01:11 GMT
> >From http://c2.com/cgi/wiki?RelationalAlgebra
>
[quoted text clipped - 6 lines]
> This informal description matches the other alternative. What is the
> formal definition?

I haven't seen one. D&D don't really do anything with formal methods
that I've seen.

I would propose something like

Given
A:(a:Ta,ab:Tab)
B:(b:Tb,ab:Tab)

A <OR> B = { (a,ab,b) |
 ((a,ab) in A cross product Tb)
 union
 ((b,ab) in B cross product Ta)
}

Is that sufficiently formal? What would constitute a
sufficiently formal form?

Marshall
paul c - 03 Sep 2005 01:33 GMT
Marshall Spight wrote:

>>>From http://c2.com/cgi/wiki?RelationalAlgebra
>>
[quoted text clipped - 26 lines]
>
> Marshall

the bit on pg 56  ...
Hs = Hr1 union Hr2
Bs = {ts: exists tr1 exists tr2
        ( ( tr1 in Br1 or tr2 in Br2) and
            ts = tr1 union tr2 }

... D & D call it a formal definition.  i had the impression they wanted
to use <AND> and <OR> to define the other operators, such as product
from that starting point.  personally, i like the connection with
ordinary English, even if i'm often getting the result of <OR> wrong!
(maybe that's why i like it since so many people i know get the English
one wrong too, eg. "i'll see you today or tomorrow" usually means neither!)

i was wondering - if you started with 'cross product' instead of <OR>,
how would you define 'cross product'?

thanks,
pc
VC - 03 Sep 2005 20:30 GMT
> the bit on pg 56  ...
> Hs = Hr1 union Hr2
> Bs = {ts: exists tr1 exists tr2
> ( ( tr1 in Br1 or tr2 in Br2) and
> ts = tr1 union tr2 }

If the above is indeed the <OR> definition,  then I do not understand how it
handles relations with the same header..

Let a tuple be a set of triples <A, T, v> (attribute, type and value).
Further, let r1 and r2 be relations with the same header H.  Now,  what
would be the result of tr1 union tr2 ?  Obviously it's not a relational
tuple any more because there are two attributes with the same name in the
union.  E.g.

tr1 = { <x,int,4>, <y, char,'a'}
tr2 = {<x,int,5>, <y, char,'b'}

tr1 union tr2 = { <x,int,4>, <y, char,'a'>,  <x,int,5>, <y, char,'b'> }

What am I missing ?

> ... D & D call it a formal definition.  i had the impression they wanted
> to use <AND> and <OR> to define the other operators, such as product from
[quoted text clipped - 8 lines]
> thanks,
> pc
paul c - 04 Sep 2005 01:44 GMT
>>the bit on pg 56  ...
>>Hs = Hr1 union Hr2
[quoted text clipped - 17 lines]
>
> What am I missing ?

A friend of mine who has a couple of math degrees and who I think is
pretty smart in many areas, had almost exactly the same problem with the
definition.  My friend's example was similar to yours except that some
attributes or tr1 and tr2 were disjoint.  A couple of years ago, he told
me that he had written to one of the authors suggesting a change but
that he got no reply.

Since then, Alfredo on this group has clarified the meaning for me but
not in a way that I am able to reconcile with the definition as written.
  I've just assumed that's because of either my lack of mathematical
training or my stupidity or more likely, both.

For all I know, you aren't missing anything.  I wish the
mathematicians/philosophers in the group would help me as well as you to
reconcile the definition, too.  The way I've been coping is to change
the last bit, " and ts = tr1 union tr2" to "ts *is a member of* tr1
union tr2" but this seems a little redundant.

It occurred to me that the use of the term "ts" means a set of tuples
rather than one tuple.  After all, Bs is defined as a set of tuples, but
this still seems to me to make that part " and ts = tr1 union tr2"
redundant to my unpracticed eye, ie. if it were removed, what difference
would it make?  In fact, the first time I read it, I concluded,
apparently wrongly, that <OR> and <AND> both produce the cartesian
product when the headings are disjoint.  I still wonder whether this
wouldn't sometimes be a useful identity.

Not much help, I'm sure.

p
VC - 04 Sep 2005 12:36 GMT
>>>the bit on pg 56  ...
>>>Hs = Hr1 union Hr2
[quoted text clipped - 38 lines]
> It occurred to me that the use of the term "ts" means a set of tuples
> rather than one tuple.

Hold on right there.  Let's not complicate the things.  The notation
defining <OR> is a straightforward set definition where the variables range
over elements of set(s) that happen to be tuples.  If you twist the meaning
in the way you suggest,  it completely deviates from the standard math
practice.

> After all, Bs is defined as a set of tuples, but this still seems to me to
> make that part " and ts = tr1 union tr2" redundant to my unpracticed eye,
> ie. if it were removed, what difference would it make?

The 'ts = tr1 union tr2' is crucial.  It says that you obtain the resulting
tuple ts by taking a tuple from the "universl set" corresponding to the r1
header and a tuple from the "universal set" corresponding to the r2 header
and applying the union operation to them.  Unfortunately, the definition
you've supplied does not state those"universal sets" explicitely:

Bs = {ts: exists tr1 exists tr2 ( ( tr1 in Br1 or tr2 in Br2) and ts = tr1
union tr2 }

It can be rewritten as :

Bs = {ts: exists tr1 in Ur1 exists tr2 in Ur2 ( ( tr1 in Br1 or tr2 in Br2)
and ts = tr1 union tr2 }

where Ur1/Ur2 is a set of tuples formed by all possible combination of
values for a given header (a sort of universl set for a given header).

So the formula ts = tr1 union tr2 defines a sort of "cartesian product"
between the universal sets of which tr1 and tr2 are members (it's not really
a cartesian product of course).  Then you can think about the condition (tr1
in Br1 or tr2 in Br2) as a sort of filter applied to 'tr1 union tr2'.

Maybe,  the definition would be more undestandable if written ,
semiformally,  without the quantifiers as:

Bs = {tr1 union tr2:  (tr1 in Br1 and tr2 in Ur2) or (tr2 in Br2 and tr1 in
Ur1)  }

> In fact, the first time I read it, I concluded, apparently wrongly, that
> <OR> and <AND> both produce the cartesian product when the headings are
> disjoint.

Well, for disjoint sets of attributes <AND> produces a cartesian product of
the relations all right. What <OR> produces was explainedby I believe Mr.
Spight. The problem for both <OR> and <AND> are intersecting attributes.

> I still wonder whether this wouldn't sometimes be a useful identity.
>
> Not much help, I'm sure.

Can anyone give at least an informal definition of what <OR> and <AND> are
since the formal one (as quoted ) appear rather nonsensical ?  Without such
definition any discussion is nonsensical too.

> p
Mikito Harakiri - 06 Sep 2005 23:55 GMT
> Can anyone give at least an informal definition of what <OR> and <AND> are
> since the formal one (as quoted ) appear rather nonsensical ?  Without such
> definition any discussion is nonsensical too.

Informal definition is rather easy.

Let x be domain of values {a_1, a_2, ...}
y be domain of values {b_1, b_2, ...}
z be domain of values {c_1, c_2, ...}

Consider the cartesian product space
P={a_1, a_2, ...}x{b_1, b_2, ...}x{c_1, c_2, ...}

Then, relations R_1(x,y) and R_1(y,z) both are cylindric sets in P.
(Cylindric sets are geometric objects which are invariant under
projection). R_1(x,y) <AND> R_1(y,z) is the formal intersection of the
cylindric sets, and R_1(x,y) <OR> R_1(y,z) is their union.
VC - 07 Sep 2005 04:26 GMT
>> Can anyone give at least an informal definition of what <OR> and <AND>
>> are
[quoted text clipped - 10 lines]
> Consider the cartesian product space
> P={a_1, a_2, ...}x{b_1, b_2, ...}x{c_1, c_2, ...}

The defect of this definition is that you use mathematical relations which
are sets of ordered tuples whilst relational tuples are unordered
tuples/sets of (A,T,v) triples. I gave an <OR>/<AND> definition example
using 'relational' tuples rather than ordered tuples earlier in this thread.

> Then, relations R_1(x,y) and R_1(y,z) both are cylindric sets in P.
> (Cylindric sets are geometric objects which are invariant under
> projection). R_1(x,y) <AND> R_1(y,z) is the formal intersection of the
> cylindric sets, and R_1(x,y) <OR> R_1(y,z) is their union.

You do not need to expand the vocabulary with new notions to define
something so simple (apparently) as the  <AND>/<OR> operations.  An
alternative definition might be:

Let R1 and R2 be two relations,  Hr1 and Hr2 their respective headers.
Further,  let Ar1_1, Ar1_2, .., Ar1_m and Ar2_1, Ar_2, .., Ar2_n be sets of
triples (attribute, type,value) formed over entire domains corresponding to
the attributes such that attribute(Ar1_i) in (Hr2 minus Hr1) and
attribute(Ar2_i) in (Hr1 minus Hr2).  Further, let the relations

CR1 = {{t_1} union ..union (t_m} | t_1 in Ar1_1,...,t_m in Ar1_m}
and
CR2 = {{t_1} union ..union (t_n} | t_1 in Ar2_1,..,t_n in Ar2_m}

Then

R1 <AND> R2 = {cr1 union r1| cr1 in CR1, r1 in R1} intersection {cr2 union
r2| cr2 in CR2, r2 in R2}
R1 <OR> R2 = {cr1 union r1| cr1 in CR1, r1 in R1} union {cr2 union r2| cr2
in CR2, r2 in R2}

and the header H = Hr1 union Hr2 in both cases.

What is a "cylidric set" ?  Probably you meant 'cylindric set algebra'
rather than a "cylindric set".  If so, it's unclear whether talking about
databases in terms of cylindric set algebra is more insightful or clarifying
than doing the same in terms of relations and predicates.  If not, what
exactly do you mean by "Cylindric sets are geometric objects which are
invariant under projection" ?
Mikito Harakiri - 07 Sep 2005 21:46 GMT
> What is a "cylidric set" ?  Probably you meant 'cylindric set algebra'
> rather than a "cylindric set".  If so, it's unclear whether talking about
> databases in terms of cylindric set algebra is more insightful or clarifying
> than doing the same in terms of relations and predicates.  If not, what
> exactly do you mean by "Cylindric sets are geometric objects which are
> invariant under projection" ?

I take back my reference to cylindric sets.

Let me give a very succinct lattice definition instead.

A <OR> B == (A /\ 11) \/ (B /\ 11) \/ (A /\ B /\ 00)

where
\/ is (generalized) union
and
/\ is join
Mikito Harakiri - 07 Sep 2005 22:07 GMT
> > What is a "cylidric set" ?  Probably you meant 'cylindric set algebra'
> > rather than a "cylindric set".  If so, it's unclear whether talking about
[quoted text clipped - 13 lines]
> and
> /\ is join

Given fundamental relation decomposition

R = (00 /\ R) \/ (11 /\ R)

it is illustrative to compare A<OR>B with A\/B:

A \/ B = (A /\ 11) \/ (B /\ 11) \/ (A /\ 00) \/ (B /\ 00)
VC - 08 Sep 2005 02:20 GMT
>> What is a "cylidric set" ?  Probably you meant 'cylindric set algebra'
>> rather than a "cylindric set".  If so, it's unclear whether talking about
[quoted text clipped - 9 lines]
>
> A <OR> B == (A /\ 11) \/ (B /\ 11) \/ (A /\ B /\ 00)

Looks OK to me if you define 11 as

(H,B) -- header/body

where H =  Union of all the possible attributes
B =  Set of   (A, T, v)  tuples for all the possible attributes  where v
assume all the possible values from T.  Not quite practical really.

and 00 as ({}, {})

> where
> \/ is (generalized) union
> and
> /\ is join
Mikito Harakiri - 03 Sep 2005 02:31 GMT
> A <OR> B = { (a,ab,b) |
>   ((a,ab) in A cross product Tb)
[quoted text clipped - 4 lines]
> Is that sufficiently formal? What would constitute a
> sufficiently formal form?

My reply that your expression { (x, y) | x = 1 or y = a } is formal
enough is lost somewhere in Google groops:-)

Well, the formal definition of <OR> and <AND> seems to be very
consistent with boolean logic. Take

Relation A
x y
- -
1 a
2 b

and

Relation B
y z
- -
a #
b %

Then, formally relation A is a proposition

x=1 & y=a \/ x=2 & y=b

while relation B is

y=a & z=# \/ y=b & z=%

The <OR> is just formal disjunction

x=1 & y=a \/ x=2 & y=b \/ y=a & z=# \/ y=b & z=%

that could be equivalently transformed into

x=1 & y=a & z=# \/
x=1 & y=a & z=% \/
x=2 & y=b & z=# \/
x=2 & y=b & z=% \/
x=1 & y=a & z=# \/
x=2 & y=a & z=# \/
x=1 & y=b & z=% \/
x=2 & y=b & z=%

followed by collapse of identical disjunction terms. Likewise, the
<AND> operation could be defined. Therefore, the D&D algebra
intuitively looks like boolean algebra, but it is certainly not.
Absorption, doesn't hold: relation headers monothonically increase, so
that there is no way for headers to match. Therefore, this nice boolean
logic must break somewhere. Where?
paul c - 03 Sep 2005 03:38 GMT
>>A <OR> B = { (a,ab,b) |
>>  ((a,ab) in A cross product Tb)
[quoted text clipped - 48 lines]
> x=2 & y=b & z=%
> ...

i like the precise way you put this.  for one thing, it makes it clearer
what <OR> means (ie. 'insert') and almost as clearly what <NOT> <AND>
(ie. 'delete') mean.

> followed by collapse of identical disjunction terms. Likewise, the
> <AND> operation could be defined. Therefore, the D&D algebra
[quoted text clipped - 3 lines]
> logic must break somewhere. Where?
> ...

i may be missing the question (wouldn't be the first time) regarding 'no
way for headers to match', but i presume that's why they have <REMOVE>
in A-algebra (they also require projection in TutorialDee). i'm assuming
you mean something like a db with a couple of hundred relations each of
which had, say, ten attributes of which only one is common with some
other relation, so the equivalent single relation for that database
would have something like 9 X 200 = 1800 attributes (plus many,many,many
tuples!  likely, no person could compose that expression, but maybe
there's a reason for a machine to do it.  i don't know why, though.  if
that's what you mean by 'break', i guess you're right in theory.

FWIW, i tend to think that the headers keep expanding as long as i'm
talking about different things.  as soon as i start talking about the
same things, the headers stay the same.

from what i've read, D & D seem to want the traditional 'closure' idea
of an relational expression, always resulting in a single relation. i've
wondered why we couldn't have two or more relations in a result.  there
must be times when that's just as pragmatic and cheaper in space terms.
still, the A-algebra seems a very neat way to get the single closure effect.

p
Mikito Harakiri - 03 Sep 2005 04:05 GMT
> > followed by collapse of identical disjunction terms. Likewise, the
> > <AND> operation could be defined. Therefore, the D&D algebra
[quoted text clipped - 14 lines]
> there's a reason for a machine to do it.  i don't know why, though.  if
> that's what you mean by 'break', i guess you're right in theory.

Let A be a relation with attributes x and y. Let B has attributes y and
z. Then,

A <OR> (A <AND> B) != A

, since the header of A <AND> B has attributes x,y,z. There is no way
the subsequent <OR> operation to reduce it to x,y.

Likewise,

A <AND> (A <OR> B) = A

The fact that D&D have an operation which reduces the header doesn't
matter.

> from what i've read, D & D seem to want the traditional 'closure' idea
> of an relational expression, always resulting in a single relation. i've
> wondered why we couldn't have two or more relations in a result.  there
> must be times when that's just as pragmatic and cheaper in space terms.
> still, the A-algebra seems a very neat way to get the single closure effect.

Their algebra is closed, no question about it.
paul c - 03 Sep 2005 05:41 GMT
> Let A be a relation with attributes x and y. Let B has attributes y and
> z. Then,
[quoted text clipped - 4 lines]
> the subsequent <OR> operation to reduce it to x,y.
> ...

wouldn't that be a necessary consequence of having n-ary tuples?

(i should have mentioned that they do say that the purpose of the
A-algebra is not to be implemented but rather to define the operators in
the various descriptions in an exact way.  however, i still find this
topic interesting because i wonder about an "A" implementation in spite
of D & D's stated intent. that's also why i wonder if there couldn't be
some consistent and logical way of deciding to produce two or more
relations as a result.  even though <OR> could be avoided entirely, it
is still a clearer way to read some expressions and it has seemed to me
that when <OR> is involved it might make sense to keep its two relations
separate.)

p
vc - 06 Sep 2005 13:50 GMT
> > > followed by collapse of identical disjunction terms. Likewise, the
> > > <AND> operation could be defined. Therefore, the D&D algebra
[quoted text clipped - 22 lines]
> , since the header of A <AND> B has attributes x,y,z. There is no way
> the subsequent <OR> operation to reduce it to x,y.

You are confused by mixing up the language and an interpretation.  If
you consider A <OR> (A <AND> B) as a predicate formula,  then the
identity holds.  One can also claim that the identity holds for the
interpretation as well if one drops the column(s) representing an
entire attribute domain(s) from the result, very much in the same
fashion as when one added them to the original relations (your own
transformation).

> Likewise,
>
> A <AND> (A <OR> B) = A

See above.
Marshall  Spight - 06 Sep 2005 15:34 GMT
> > Let A be a relation with attributes x and y. Let B has attributes y and
> > z. Then,
[quoted text clipped - 11 lines]
> fashion as when one added them to the original relations (your own
> transformation).

I don't believe A <OR> (A <AND> B) will have any columns representing
an entire domain, unless A does already.

(BTW, I find it scales better if we speak of A as having attribute
sets a and ab, and B having attribute sets b and ab. Once we get
into three relations, using x, y, z breaks down, because you have
seven sets of attributes, and you'd never keep them straight if it
was x, y, z, w, v, u, t.)

> > Likewise,
> >
> > A <AND> (A <OR> B) = A
>
> See above.

This result *will* have columns representing an entire domain; those
from B that are not in A, which in my scheme is labeled b.

Marshall
vc - 06 Sep 2005 16:58 GMT
> > > Let A be a relation with attributes x and y. Let B has attributes y and
> > > z. Then,
[quoted text clipped - 14 lines]
> I don't believe A <OR> (A <AND> B) will have any columns representing
> an entire domain, unless A does already.

For the <AND> operation, A will be augmented with additional domains.
Some tuples will be lost because of <AND>,  but for the <OR> operation
A will again be augmented with the same domains retained in their
entirety thanks to the <OR> semantics.  So I believe, the result can be
stipped of the additional domains producing thus A unless I missed
something in this exercise in combinatorics.
Marshall  Spight - 03 Sep 2005 05:07 GMT
> My reply that your expression { (x, y) | x = 1 or y = a } is formal
> enough is lost somewhere in Google groops:-)

Ha! That's happened to me before as well.

> Well, the formal definition of <OR> and <AND> seems to be very
> consistent with boolean logic.
[quoted text clipped - 4 lines]
> that there is no way for headers to match. Therefore, this nice boolean
> logic must break somewhere. Where?

My understanding of the classical definition is that an algebra
is boolean iff:
for binary operators +, *, unary operator ', and elements 1, 0
1) +, * are commutative
2) +, * are distributive
3) for all A, A+0=A, A*1=A  (identity)
4) for all A, A+A'=1, A*A'=0  (complement)

It seems to me that compliment is the problem. The algebra
is obviously commutative. Elsewhere you've said it's distributive
(which seems right.) If we define 0=dum and 1=dee (or what
we've elsewhere called 00 and 01) we get identity, but it breaks
down at complement over <OR>.

A+A'= universal set for header(A)
A*A'=10

Both of these fail to satisfy 4).

Now, we could choose the 1 element to be a+a', and the 0 element
to be A*A'. Then identity and complement work. But it means that
the 1 and 0 elements are specific to some header(A), so you
could say it's a boolean algebra schema, rather than a boolean
algebra. (That is, for every header, you can construct a boolean
algebra for it, but it's not bollean in general.)

I have recently learned that there's an alternative way to specify
a boolean algebra. It is much simpler but I find it harder to
understand.

A "Robbins Algebra" is an algebra that satisfies these equations:
1. commutative
2. associative
3. Robbins Equation: n(n(A+B)+n(A+n(B))) = A.

where n() is the compliment function.

It turns out that every Boolean Algebra is a Robbins Algebra,
and vice versa. Which IIUC means that satisfying the Roobbins
Equation is sufficient to prove distributivity.

Anyway, it's all very complicated.

Oh, one last thought: I understand that every boolean algebra
will be defined over a set that has a cardinality that is a power
of two. This suggests power sets to me, which in turn reminds
me of the fact that we keep running into these algebras as
being specific to a given header.

Marshall
Mikito Harakiri - 07 Sep 2005 01:10 GMT
> > Well, the formal definition of <OR> and <AND> seems to be very
> > consistent with boolean logic.
[quoted text clipped - 30 lines]
> algebra. (That is, for every header, you can construct a boolean
> algebra for it, but it's not bollean in general.)

To summarize, there are actually 2 boolean algebras: the algebra of
headers, or sets of attributes, and the algebra of tuples FOR A FIXED
SET OF ATTRIBUTES. Now these 2 can be combined into relational lattice,
although this  doesn't look straigntforward. Direct product of 2
boolean algebras is boolean algebra, of course, but what is needed is
an equivalency relation that puts the "matching" relations into the
same equivalnce class. Here is an example

A relation

<attributes = {x}, tuples = {(x=1,y=a),(x=1,y=b),(x=2,y=a)}

is equivalent to

<attributes = {x}, tuples = {(x=1,y=a),(x=2,y=a)}

Informally, both relations assert the predicate x=1 & x=2, and the
terms with y are not important.

> I have recently learned that there's an alternative way to specify
> a boolean algebra. It is much simpler but I find it harder to
[quoted text clipped - 10 lines]
> and vice versa. Which IIUC means that satisfying the Roobbins
> Equation is sufficient to prove distributivity.

This is a fascinating topic indeed. It illuminates how undeveloped
Relational algebra is, for example, what is the axiom structure for RA?
VC - 06 Sep 2005 01:12 GMT
[...]
> Well, the formal definition of <OR> and <AND> seems to be very
> consistent with boolean logic. Take
[quoted text clipped - 35 lines]
> x=1 & y=b & z=% \/
> x=2 & y=b & z=%

The above transformation ain't correct.  In fact such transformation cannot
be performed because x,y and z's domains are not specified.

> followed by collapse of identical disjunction terms. Likewise, the
> <AND> operation could be defined. Therefore, the D&D algebra
> intuitively looks like boolean algebra, but it is certainly not.
> Absorption, doesn't hold: relation headers monothonically increase, so
> that there is no way for headers to match. Therefore, this nice boolean
> logic must break somewhere. Where?
Mikito Harakiri - 06 Sep 2005 04:12 GMT
> [...]
> > Well, the formal definition of <OR> and <AND> seems to be very
[quoted text clipped - 39 lines]
> The above transformation ain't correct.  In fact such transformation cannot
> be performed because x,y and z's domains are not specified.

Well, it's not that hard to fix it, right? If domain z is {#,$,%} then
the first conjunct

x=1 & y=a

expands into

x=1 & y=a & z=# \/
x=1 & y=a & z=$ \/
x=1 & y=a & z=% \/

etc.
vc - 06 Sep 2005 13:28 GMT
> > [...]
> > > Well, the formal definition of <OR> and <AND> seems to be very
[quoted text clipped - 50 lines]
> x=1 & y=a & z=$ \/
> x=1 & y=a & z=% \/

Sure,  it's not hard but it's not obvious from your example.  Besides,
you employ a strange language there:

"Then, formally relation A is a proposition"

A relation is not a proposition.  A relation is a set.  Neither is "x=1
& y=a \/ x=2 & y=b" a proposition,  it's a predicate.

More importantly,  you do not transform the predicate "x=1 & y=a" into

"
x=1 & y=a & z=# \/
x=1 & y=a & z=$ \/
x=1 & y=a & z=% \/
"

according to the rues of formal logic,  you interpret it,  narrowly,
according to your need in your chosen domain of interpretation.

Other than that,  the interpetation is OK ;)

> etc.
VC - 04 Sep 2005 13:20 GMT
>> >From http://c2.com/cgi/wiki?RelationalAlgebra
>>
[quoted text clipped - 15 lines]
> A:(a:Ta,ab:Tab)
> B:(b:Tb,ab:Tab)

I am not sure I understand the notation.  Could you clarify  what '(a:Ta,
ab:Tab)' is ?
> A <OR> B = { (a,ab,b) |
>  ((a,ab) in A cross product Tb)
>  union
>  ((b,ab) in B cross product Ta)
> }

Regardless of what Ta, Tb stand for,  I object to the (a, aab) notation
which denotes an ordered pair.  Since a tuple is a set of  (A,T,v) triples,
should not it be {a, ab} ?

> Is that sufficiently formal? What would constitute a
> sufficiently formal form?
>
> Marshall
Marshall  Spight - 04 Sep 2005 15:30 GMT
> "Marshall Spight" <marshall.spight@gmail.com> wrote in message
> >
[quoted text clipped - 6 lines]
> I am not sure I understand the notation.  Could you clarify  what '(a:Ta,
> ab:Tab)' is ?

I try to use the 'x:T' form exclusively to mean 'x has type T.'
Above I'm trying to say, "A has the type: set of (set of attributes
a with type(s) Ta, and set of attributes ab with types Tab.)"

Ordinarily I wouldn't find it necessary to bring the types in,
but in this case we need to name Ta and Tb specifically because
<OR> has us doing a cross product with the entire set of values
of the type.

> > A <OR> B = { (a,ab,b) |
> >  ((a,ab) in A cross product Tb)
[quoted text clipped - 5 lines]
> which denotes an ordered pair.  Since a tuple is a set of  (A,T,v) triples,
> should not it be {a, ab} ?

The more I think about it, the more I agree that it should be {}.

Marshall
vc - 06 Sep 2005 13:18 GMT
> > "Marshall Spight" <marshall.spight@gmail.com> wrote in message
> > >
[quoted text clipped - 21 lines]
> > >  ((b,ab) in B cross product Ta)
> > > }

OK,  I see what you are doing.  To rephrase:

Let A and B be relations, DA1,...,DAn attribute domains in A but not in
B,
DB1,...,DBn attribute domains in B but not in A.

Then, the body of A <OR> B =
            {x union {y1} ... union {ym} | x in A, y1 in DB1,.., ym in
DBk}
            union
            {a union {y1} ... union {yn} | x in B, y1 in DA1,.., yn in
DAn}

For <AND> substitute 'intersect' for 'union'.

Of course the above reflects my understanding of what is being
discussed here and is completely different from TTM's quoted
definition.

> Marshall
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.