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 / November 2007

Tip: Looking for answers? Try searching our database.

atomic

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
paul c - 31 Oct 2007 02:45 GMT
I know that Codd wrote his first "big" db paper in 1969.  At that time I
 believe the understanding of physical atoms was simpler than it is
today but the word "atomic" in most people's minds inherited the physics
meaning.

I wonder if 1NF would seem clearer if it were expressed in terms of
"simplest" domains.  I suppose there would still be people who would say
"but if I look at this way, it's not so simple", eg., when they are
talking about some compound key (versus composite key).  But the rest of
us might not get drawn into the confusions they offer.
Bob Badour - 31 Oct 2007 04:02 GMT
> I know that Codd wrote his first "big" db paper in 1969.  At that time I
>  believe the understanding of physical atoms was simpler than it is
[quoted text clipped - 6 lines]
> talking about some compound key (versus composite key).  But the rest of
> us might not get drawn into the confusions they offer.

Even character strings have internal structure. Heck, one can even think
of integers as arrays of binary digits.
paul c - 31 Oct 2007 04:28 GMT
>> I know that Codd wrote his first "big" db paper in 1969.  At that time
>> I  believe the understanding of physical atoms was simpler than it is
[quoted text clipped - 9 lines]
> Even character strings have internal structure. Heck, one can even think
> of integers as arrays of binary digits.

I don't know about that, when I'm thinking of a value in a db, say
"123", it seems enough to think of the whole thing as a symbol.
Bob Badour - 31 Oct 2007 13:24 GMT
>>> I know that Codd wrote his first "big" db paper in 1969.  At that
>>> time I  believe the understanding of physical atoms was simpler than
[quoted text clipped - 12 lines]
> I don't know about that, when I'm thinking of a value in a db, say
> "123", it seems enough to think of the whole thing as a symbol.

I agree. And because the value has an associated data type, the system
defines operations on it. Some of those operations may seem to reveal an
internal structure.
Roy Hann - 31 Oct 2007 08:31 GMT
>I know that Codd wrote his first "big" db paper in 1969.  At that time I
>believe the understanding of physical atoms was simpler than it is today
[quoted text clipped - 5 lines]
> talking about some compound key (versus composite key).  But the rest of
> us might not get drawn into the confusions they offer.

It might seem clearer expressed in that way, but it wouldn't express what he
needed to express.   What he needed to express is the idea that none of his
arguments depend on the internal structure of the values, which they don't,
shouldn't, and can't.

1NF does not *require* that values be atomic.  It asserts that values will
be *treated as* atomic.  Big difference.  Essential difference.

Roy
David BL - 31 Oct 2007 14:07 GMT
On Oct 31, 4:31 pm, "Roy Hann" <specia...@processed.almost.meat>
wrote:

> >I know that Codd wrote his first "big" db paper in 1969.  At that time I
> >believe the understanding of physical atoms was simpler than it is today
[quoted text clipped - 15 lines]
>
> Roy

Can that be formalised?  I agree with Bob that in general we have a
set of operators and they can allow us to see internal structure.
What does it mean for a value to be *treated* as atomic?
paul c - 31 Oct 2007 19:02 GMT
> On Oct 31, 4:31 pm, "Roy Hann" <specia...@processed.almost.meat>
...

>> 1NF does not *require* that values be atomic.  It asserts that values will
>> be *treated as* atomic.  Big difference.  Essential difference.
[quoted text clipped - 4 lines]
> set of operators and they can allow us to see internal structure.
> What does it mean for a value to be *treated* as atomic?

I think it means that relational algebra operators are not allowed to
decompose it.
Marshall - 31 Oct 2007 19:58 GMT
> > Can that be formalised?  I agree with Bob that in general we have a
> > set of operators and they can allow us to see internal structure.
> > What does it mean for a value to be *treated* as atomic?
>
> I think it means that relational algebra operators are not allowed to
> decompose it.

Nice!!!

Marshall
Bob Badour - 31 Oct 2007 20:46 GMT
>> On Oct 31, 4:31 pm, "Roy Hann" <specia...@processed.almost.meat>
>
[quoted text clipped - 12 lines]
> I think it means that relational algebra operators are not allowed to
> decompose it.

Actually, the structure is illusory and representation-dependent.
Domains have operations that appear to reveal internal structure even
when that internal structure may not physically exist.
Marshall - 31 Oct 2007 20:57 GMT
> >> On Oct 31, 4:31 pm, "Roy Hann" <specia...@processed.almost.meat>
>
[quoted text clipped - 16 lines]
> Domains have operations that appear to reveal internal structure even
> when that internal structure may not physically exist.

Agreed.

One hundred and twenty three is an atomic value; a natural
number. The idea that there is a 1, a 2, and a 3 in there is illusory.
(Or rather, it is an artifact of the representation, not an
artifact of the value.)

You can write an expression that will give you those things,
but that shouldn't lead us to any conclusions.

X / 10 % 10 will give us the tens place. But what then
are we to make of X / 9 % 9? It gives us the nines place
in a base 9 number.

Marshall
Bob Badour - 31 Oct 2007 22:44 GMT
>>>>On Oct 31, 4:31 pm, "Roy Hann" <specia...@processed.almost.meat>
>>
[quoted text clipped - 30 lines]
> are we to make of X / 9 % 9? It gives us the nines place
> in a base 9 number.

It's ironic you should mention base 9. It's a little-known fact that, if
a number is evenly divisible by 8, the sum of the digits of the number
in base 9 is also evenly divisible by 8. And if one repeats the process
with that sum until the resulting sum has only one digit and if the
original number was divisible by 8, the one remaining digit will be 8.

It's like magic. So it's really ironic you should mention base 9 in
particular.
David Cressey - 01 Nov 2007 12:56 GMT
> It's ironic you should mention base 9. It's a little-known fact that, if
> a number is evenly divisible by 8, the sum of the digits of the number
[quoted text clipped - 4 lines]
> It's like magic. So it's really ironic you should mention base 9 in
> particular.

This is a joke,  right?  For radix n,  n-1 has this interesting property.
Likewise,  9 has this fun property in decimals.  Bookkeepers in the Bob
Chratchit era used a property much like this one for error detection in
manually managed numbers.

If this were another person posting,  I'd think it was simple oversight.
But you,  BB, are likely to know exactly what I've just said.
Bob Badour - 01 Nov 2007 16:36 GMT
>>It's ironic you should mention base 9. It's a little-known fact that, if
>>a number is evenly divisible by 8, the sum of the digits of the number
[quoted text clipped - 6 lines]
>
> This is a joke,  right?  For radix n,  n-1 has this interesting property.

Shhhhh! You've ruined it! Now nobody will bother converting numbers to
base 9 to see if it actually works. Spoilsport!

> Likewise,  9 has this fun property in decimals.  Bookkeepers in the Bob
> Chratchit era used a property much like this one for error detection in
> manually managed numbers.
>
> If this were another person posting,  I'd think it was simple oversight.
> But you,  BB, are likely to know exactly what I've just said.

If the number is divisible by any factor of n-1, the sum of the digits
will be a multiple of that factor too. Thus, if one repeatedly sums the
digits of a hexadecimal number, one can tell very quickly whether the
number is divisible by 3, 5 or F.

Base 9 is actually a little less useful because it can only tell you if
the number is divisible by 2, 4 or 8, and these are often relatively
obvious in other bases in any case.
paul c - 01 Nov 2007 17:09 GMT
>>> It's ironic you should mention base 9. It's a little-known fact that, if
>>> a number is evenly divisible by 8, the sum of the digits of the number
[quoted text clipped - 25 lines]
> the number is divisible by 2, 4 or 8, and these are often relatively
> obvious in other bases in any case.

Heh, personally, I prefer to think of all the numbers in my db as base
10**64 or so with a floating decimal, even if there isn't a dbms that
supports that.  Helps keep me from getting confused by more intricate
representations.
Bob Badour - 01 Nov 2007 17:23 GMT
>>>> It's ironic you should mention base 9. It's a little-known fact
>>>> that, if
[quoted text clipped - 32 lines]
> supports that.  Helps keep me from getting confused by more intricate
> representations.

Is that 10**64 as in "There are 10 kinds of people in the world. Those
who understand binary and those who don't." ?

If so, shouldn't that be 10**1000000 ?
paul c - 01 Nov 2007 18:14 GMT
...
> Is that 10**64 as in "There are 10 kinds of people in the world. Those
> who understand binary and those who don't." ?
>
> If so, shouldn't that be 10**1000000 ?

That's even better.  As the guy in the Mott's Clamato commercial said,
"You think big!".

Or base 1(followed by as many zeroes as possible) raised to base
1(followed by as many zeroes as possible), base 1(followed by as many
zeroes as possible) times.  That would take of it for me.  But as Codd
might have said, the extra operators add complexity without adding
power, so I guess base1(followed by as many zeroes as possible) is a
better abstraction.
paul c - 01 Nov 2007 22:28 GMT
Regarding RVA's, suppose I make up a relation that names all the
children of various fathers.

I might have

F   C
_   _

Joe Jack
Joe Jill

If RVA's are allowed, I could also "say":

F   {C}
_   ___

Joe {Jack, Jill}

(here, I've taken the liberty for graphical reasons of calling the RVA
"{C}".)

I could add another tuple:

F   {C}
_   ___

Joe {Jack, Jill}
Bob {}

This might mean that Bob is the father of the empty set of children.  As
far as the predicate is concerned, this might be seen as contradictory
because if Bob has no children, he can't be a father. (By
"contradictory", I don't mean a contradiction within the database,
rather that the second tuple and the predicate contradict each other.)

For that matter if F is not a primary key, I could say:

F   {C}
_   ___

Joe {Jack, Jill}
Joe {}

which seems to have two such contradictions if such a thing is possible.

If RVA's aren't allowed (and neither are nulls), I think such
contradictions aren't possible.  But similar relations seem possible
without the second contradiction, depending on the predicate, eg., F has
lived with a woman who was mother to the children {C}.  But I still have
the contradiction that the unnamed woman in the second tuple couldn't be
a mother (assuming we don't let lawyers into the discussion).

Maybe that second "contradiction" is just psychological and there is
always another possible predicate that washes it away, such as "Person P
 has the children {C}".  But that second tuple still seems superfluous.

For a predicate like "supplier S supplies the set of parts {P}", it
doesn't seem very useful to use an RVA to say that a supplier supplies
no parts when a relation that avoids RVA's can avoid recording this fact
in the first place.

I suppose if a db language offers no way to construct such relations as
above without using a form of "group" that takes as an operand only
relations that don't contain RVA's, then such relations couldn't arise.

I'm wondering are there applications where RVA values that are "empty"
make sense or are such values just a curious by-product of RVA's?  If
the latter, should they be suppressed or somehow prevented?
Bob Badour - 01 Nov 2007 22:52 GMT
> Regarding RVA's, suppose I make up a relation that names all the
> children of various fathers.
[quoted text clipped - 40 lines]
>
> which seems to have two such contradictions if such a thing is possible.

I don't understand the point of this second example. If you are
describing a predicate where F should be a primary key, then pointing
out that failing to declare the key causes problems seems redundant. If
you are describing a predicate where F should not be a primary key, then
presumably there is nothing whatsoever wrong with the relation above.

> If RVA's aren't allowed (and neither are nulls), I think such
> contradictions aren't possible.  But similar relations seem possible
[quoted text clipped - 18 lines]
> I'm wondering are there applications where RVA values that are "empty"
> make sense or are such values just a curious by-product of RVA's?

Yes, of course, there are lots of such applications (assuming RVAs make
sense.)

  If
> the latter, should they be suppressed or somehow prevented?

Not the latter, which makes the question moot.
paul c - 02 Nov 2007 00:24 GMT
...

>> I'm wondering are there applications where RVA values that are "empty"
>> make sense or are such values just a curious by-product of RVA's?
>
> Yes, of course, there are lots of such applications (assuming RVAs make
> sense.)
> ...

For example?
Bob Badour - 02 Nov 2007 00:53 GMT
> ...
>
[quoted text clipped - 7 lines]
>
> For example?

The set of known salaries for an employee.
paul c - 02 Nov 2007 01:22 GMT
>> ...
>>
[quoted text clipped - 9 lines]
>
> The set of known salaries for an employee.

Thanks and okay, I can accept that such a set can be recorded.  Not
trying to distort that answer since I think you have already expressed
some lack of absolute certainty about RVA's "making any sense", but I
think that if that set is empty, I don't even need an RVA to satisfy the
requirement, all I need to do is define a table/relvar and go home,
courtesy of the closed-world-assumption.  If I were using my foolhardy
(likely) dream system that raised no exceptions, I wouldn't even need to
do that and could write my invoice on the spot!
paul c - 02 Nov 2007 19:19 GMT
...

>> For example?
>
> The set of known salaries for an employee.

If we mean salaries for one employee, eg., a single attribute relations
like:

KnownSalariesForJoe
___________________

{10,000, 20,000},

how could we make sense of:

KnownSalariesForJoe
___________________

{}

?

eg., if the set of known salaries for "Joe" is empty, a dbms that
supports RVA's can record this second relation, but couldn't we just as
well have an empty value for it:

KnownSalariesForJoe
___________________

so I wonder: why allow the predicate to require a set in the first place?

One argument for why might be that the predicate has been agreed to by
all users (after a million dollars was spent assiduously gathering
requirements).  But when it comes to unnecessary requirements I don't
care many how many users agree!

If we mean "known salaries for each employee", I think that phrase
presumes that we can identify each employee which means that Codd's
"normalization" method in his 1970 paper applies, which means in turn (I
think) that we don't need RVA's for this relation, so for me the
question of an empty RVA doesn't "need" to come up.

(I should say that I'd guess Bob B among others here might guess that
I'm talking towards my usual recurring them, to do with RVA's and
recursion, the possible importance of which I admit I haven't been able
to express in concise terms.)
Bob Badour - 02 Nov 2007 22:19 GMT
> ...
>
[quoted text clipped - 38 lines]
> think) that we don't need RVA's for this relation, so for me the
> question of an empty RVA doesn't "need" to come up.

We never "need" RVA's.

> (I should say that I'd guess Bob B among others here might guess that
> I'm talking towards my usual recurring them, to do with RVA's and
> recursion, the possible importance of which I admit I haven't been able
> to express in concise terms.)

Recursive type declarations work just fine without any problems.
Recursive value declarations would not. You seem to keep thinking
recursive type declarations have the same problems as recursive value
declarations. They don't.

R = { A int, B typeof R } -- works
R = { 1, valueof(R) } -- blowed up real good
paul c - 06 Nov 2007 17:15 GMT
...
> Recursive type declarations work just fine without any problems.
> Recursive value declarations would not. You seem to keep thinking
[quoted text clipped - 3 lines]
> R = { A int, B typeof R } -- works
> R = { 1, valueof(R) } -- blowed up real good

Heh, John Candy is alive. Regarding "R = { A int, B typeof R } --
works", the most literal intepretation seems to me to be that R is the
domain of B.  For a given value of R, there couldn't be any tuple of B
that isn't a tuple of R!

Does this seem nuts too?  I haven't been able to convince myself
otherwise, so far.
paul c - 06 Nov 2007 18:26 GMT
> ...
>> ...  You seem to keep thinking
>> recursive type declarations have the same problems as recursive value
>> declarations. They don't.
... For a given value of R, there couldn't be any tuple of B
> that isn't a tuple of R!
...

Maybe I should have said that R defines a relation the possible values
of which include tuples that are in the domain of B.  So maybe I was
mixing up values with types and instead of talking about R{A int, B
typeof R}, I was confusing it with something like R{A int, B typeof R}
along with a constraint such as B REFERENCES R.
paul c - 06 Nov 2007 18:34 GMT
...

> Maybe I should have said that R defines a relation the possible values
> of which include tuples that are in the domain of B.  

Oops for the umpteenth time, should have written "the possible values of
which include sets of tuples that are in the domain of B".
paul c - 06 Nov 2007 18:38 GMT
...
> along with a constraint such as B REFERENCES R.

and umpteen+1: ... such as B REFERENCES R.A.
Bob Badour - 06 Nov 2007 19:45 GMT
> ...
>
>> along with a constraint such as B REFERENCES R.
>
> and umpteen+1: ... such as B REFERENCES R.A.

B cannot reference R.A because A and B have different types.
paul c - 06 Nov 2007 20:00 GMT
>> ...
>>
[quoted text clipped - 3 lines]
>
> B cannot reference R.A because A and B have different types.

Right.  (I was merrily typing away and not thinking very ponderously.)
paul c - 06 Nov 2007 18:48 GMT
...
> along with a constraint such as B REFERENCES R.

In conventional RM talk, I don't think I've ever seen anybody write "B
REFERENCES R" even though it makes some sense to me, ie., I don't see a
logical reason to disallow it in theory even though it might not be of a
reasonable practical use.  Maybe some people would read it as meaning B
REFERENCES all attributes of R.
David Cressey - 02 Nov 2007 12:17 GMT
> ...
> >>
[quoted text clipped - 6 lines]
>
> For example?

The set of toppings on a pizza.
Roy Hann - 02 Nov 2007 12:29 GMT
>> ...
>> >>
[quoted text clipped - 8 lines]
>
> The set of toppings on a pizza.

We've been here before.  The toppings on a pizza is more like a list (or a
set of lists) because some people, like me, insist that the fresh tomatoes
go on last, and I don't much care what order the peppers and the sausage go
on, as long as they go on before the cheese.  Silly, but illustrative.

Roy
Roy Hann - 02 Nov 2007 12:44 GMT
> We've been here before.  The toppings on a pizza is more like a list (or a
> set of lists)

Oops.  I meant a list of sets.

Roy
David Cressey - 02 Nov 2007 14:18 GMT
> >> ...
> >> >>
[quoted text clipped - 13 lines]
> go on last, and I don't much care what order the peppers and the sausage go
> on, as long as they go on before the cheese.  Silly, but illustrative.

Ahh, good.  I've waited since 2003 for someone in this newsgroup to tell
whether the toppings on a pizza are a set or a list.  Until your answer,
just now,  no one really rose to the challenge.  Thanks!

Your answer raises the question of whether in a pizzeria like Domino's,  the
order of toppings stated by the client should be preserved in the order, so
that the chef can honor the customer's wishes,  or whether it should be
retained as a set,  and let the chef exercise judgement (or conform to
standards) with regard to the order that the toppings are added.

This is pretty far afield of database theory.  However,  participants in the
newsgroup expend a great deal of effort discussing whether list processing
systems like Lisp are suitable for representing sets,  and also whether set
processing systems like SQL are suitable for representing lists  (or trees,
by extension).

It's clear that a set can be stored in a list,  by simply allowing order in
the list to be an arbitrary and capricious feature added to the
representation.  It's likewise clear that a list can be stored in a set of
tuples,  simply be adding an attribute that determines order in the list.
Nevertheless,  the boundless energy of the participants continues to raise
this issue, from time to time.
paul c - 02 Nov 2007 16:13 GMT
>> ...
>>>> I'm wondering are there applications where RVA values that are "empty"
[quoted text clipped - 5 lines]
>
> The set of toppings on a pizza.

If I may dodge the ordering question for now and continue with my casual
 graphics, how could a relation like the following be useful?
(assuming one pizza per order and ignoring pizza size)

PizzasOrdered:

Order {Toppings}
_____ __________

1     {Tomato, Sausage, Cheese}
1     {}
Roy Hann - 02 Nov 2007 16:24 GMT
> If I may dodge the ordering question for now and continue with my casual
> graphics, how could a relation like the following be useful? (assuming one
[quoted text clipped - 7 lines]
> 1     {Tomato, Sausage, Cheese}
> 1     {}

If the predicate is something like "The kitchen is currently cooking <order>
pizzas with <toppings>", where <order> is a count.  (i.e. someone has
ordered just a crust--my son would, and someone else has ordered a proper
pizza.)  I could no doubt invent other possible interpretations.  My
question is, what predicate did you intend me to use when answering your
question?

Roy
paul c - 02 Nov 2007 16:34 GMT
>> If I may dodge the ordering question for now and continue with my casual
>> graphics, how could a relation like the following be useful? (assuming one
[quoted text clipped - 14 lines]
> question is, what predicate did you intend me to use when answering your
> question?

I think your predicate is fine.  I just don't see how both tuples might
apply to same pizza.
paul c - 02 Nov 2007 16:40 GMT
>>> If I may dodge the ordering question for now and continue with my
>>> casual graphics, how could a relation like the following be useful?
[quoted text clipped - 16 lines]
>
> I think your predicate is fine.  ...

Sorry, let me take that first sentence back as I didn't notice at first
that you are called <order> a count.  So I guess I should say the
predicate I had in mind was "the pizza for order <order> has the set of
toppings <toppings>.

I still wonder why one would want both tuples to apply to the same pizza.
Roy Hann - 02 Nov 2007 16:45 GMT
> I still wonder why one would want both tuples to apply to the same pizza.

You wouldn't.  So, you would have to constrain <order> to be a logical key
to prevent anyone trying to say it does.

Roy
Bob Badour - 02 Nov 2007 16:48 GMT
>>>> If I may dodge the ordering question for now and continue with my
>>>> casual graphics, how could a relation like the following be useful?
[quoted text clipped - 23 lines]
>
> I still wonder why one would want both tuples to apply to the same pizza.

With your predicate, I doubt one would, which is why one would declare a
candidate key that would reject the relation.
paul c - 02 Nov 2007 17:07 GMT
...
>> I still wonder why one would want both tuples to apply to the same pizza.
>
> With your predicate, I doubt one would, which is why one would declare a
> candidate key that would reject the relation.

I agree with that and with Roy H who I think has said the same thing.
     I ask myself how many ways could such a relation arise and the
answer seems to be only one: because somebody defined it and populated
it, eg., at least I don't think it could be produced with projection and
group operators from some other relation(s).  Not saying there isn't
another way, just that I don't see one.

So for the examples so far, it seems that even if they aren't
contradictory according to theory, I'd say they are at least a bit wacky
as far as their predicates are concerned, unless a primary key is
specified that doesn't include the "set" or RVA attributes.
paul c - 02 Nov 2007 17:21 GMT
> ...
>>> I still wonder why one would want both tuples to apply to the same
[quoted text clipped - 10 lines]
> another way, just that I don't see one.
> ...

Oops again, I guess it's quite possible with UNION.  (I had been
deluding  myself that relations of such a "form" were never a
consequence of algebraic closure.)
Bob Badour - 02 Nov 2007 22:23 GMT
> ...
>
[quoted text clipped - 10 lines]
> group operators from some other relation(s).  Not saying there isn't
> another way, just that I don't see one.

If one has an operation that groups relations, then it's easy to declare
an expression that evaluates as an RVA--even an empty RVA.

> So for the examples so far, it seems that even if they aren't
> contradictory according to theory, I'd say they are at least a bit wacky
> as far as their predicates are concerned, unless a primary key is
> specified that doesn't include the "set" or RVA attributes.

Let's turn the predicate around:

Price    Toppings
-----    ========
$10      { cheese, pepperoni, mushroom }
$5       {}

I used double-underscore to indicate the primary key.
Bob Badour - 02 Nov 2007 16:45 GMT
>>> If I may dodge the ordering question for now and continue with my
>>> casual graphics, how could a relation like the following be useful?
[quoted text clipped - 17 lines]
> I think your predicate is fine.  I just don't see how both tuples might
> apply to same pizza.

According to his predicate, they are different pizzas. If you intend him
to use a different predicate, perhaps you should specify the predicate.
paul c - 02 Nov 2007 16:54 GMT
>>>> If I may dodge the ordering question for now and continue with my
>>>> casual graphics, how could a relation like the following be useful?
[quoted text clipped - 20 lines]
> According to his predicate, they are different pizzas. If you intend him
> to use a different predicate, perhaps you should specify the predicate.

But I specified one pizza per order!
Bob Badour - 02 Nov 2007 22:25 GMT
>>>>> If I may dodge the ordering question for now and continue with my
>>>>> casual graphics, how could a relation like the following be useful?
[quoted text clipped - 23 lines]
>
> But I specified one pizza per order!

And in Roy's predicate, the 1 indicates how many pizzas with the given
toppings. If each order has 1 pizza, the relation describes two orders.
David Cressey - 02 Nov 2007 19:59 GMT
> >> ...
> >>>> I'm wondering are there applications where RVA values that are "empty"
[quoted text clipped - 17 lines]
> 1     {Tomato, Sausage, Cheese}
> 1     {}

You are presenting us with some data,  and then asking what it means.  Why
not tell us what it means,  and then maybe one if can figure out if the
representation is a useful one.

Also,  how does the example you gave us differ from:

> Order {Toppings}
> _____ __________
>
> 1     {Tomato, Sausage, Cheese}
> 1     {Pepperoni}

Lastly,  I regard tomato suace and cheese as an essential part of the pizza,
and not a "topping" as such.  I realize that this is quite subjective.  But
I claim that, if you order a pizza with no toppings from Domino's,  that
this is what you will get:  crust, tomato sauce, and cheese.
Roy Hann - 02 Nov 2007 20:03 GMT
> Lastly,  I regard tomato suace and cheese as an essential part of the
> pizza,
> and not a "topping" as such.  I realize that this is quite subjective.
> But
> I claim that, if you order a pizza with no toppings from Domino's,  that
> this is what you will get:  crust, tomato sauce, and cheese.

So if cheese isn't a topping, what is extra cheese made of?

Roy
Bob Badour - 02 Nov 2007 22:26 GMT
>>Lastly,  I regard tomato suace and cheese as an essential part of the
>>pizza,
[quoted text clipped - 4 lines]
>
> So if cheese isn't a topping, what is extra cheese made of?

It's made of extra, of course.
paul c - 03 Nov 2007 15:18 GMT
...
> Also,  how does the example you gave us differ from:
>
[quoted text clipped - 8 lines]
> I claim that, if you order a pizza with no toppings from Domino's,  that
> this is what you will get:  crust, tomato sauce, and cheese.

Thanks Roy H, Bob B and David C for the reasonable criticisms of my
clumsy question.  At the  moment, I can think only of a reply for this
one.  Whatever one thinks of the Domino's chain, David C is right about
the tomato paste even though I always order pizza with tomato which in
civilized places means additional tomato slices on top.  I feel
qualified to say this having grown up in a places where every fourth
back yard had tomato plants and from the late 1950's pizzerias were more
common than hamburger drive-ins in the USA.  Today I live in a place
which is quite uncivilized as far as Italian food culture goes but there
is some competition among Asian eateries, which I enjoy.  So-called
pizza without tomato sauce is quite common here, sometimes the thing is
more than an inch thick, every time I've mistakenly ordered it, I gagged.
Bob Badour - 03 Nov 2007 21:51 GMT
> ...
>
[quoted text clipped - 25 lines]
> pizza without tomato sauce is quite common here, sometimes the thing is
> more than an inch thick, every time I've mistakenly ordered it, I gagged.

I know an Italian, from Italy, who likes his pizza with a little olive
oil, some seafood, maybe some garlic and other herbs. No cheese, no tomato.
paul c - 04 Nov 2007 02:22 GMT
>> ...
>>
[quoted text clipped - 29 lines]
> I know an Italian, from Italy, who likes his pizza with a little olive
> oil, some seafood, maybe some garlic and other herbs. No cheese, no tomato.

In a good joint (IMO) as soon as you sit down, before you even order
there will be bread on the table, maybe even from several kinds of bread
dough and little saucers of oil.  There is olive oil and there is olive
oil.  I used to be able to tell from the oil whether I would order from
the menu or just get drunk on the house wine.
Gene Wirchenko - 05 Nov 2007 02:32 GMT
[snip]

>Lastly,  I regard tomato suace and cheese as an essential part of the pizza,
>and not a "topping" as such.  I realize that this is quite subjective.  But
>I claim that, if you order a pizza with no toppings from Domino's,  that
>this is what you will get:  crust, tomato sauce, and cheese.

    I like feta cheese.  It is a topping.  One of my favourites is
feta, tomato, and mushrooms.

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
    I have preferences.
    You have biases.
    He/She has prejudices.
David Cressey - 05 Nov 2007 05:56 GMT
> [snip]
>
[quoted text clipped - 5 lines]
>      I like feta cheese.  It is a topping.  One of my favourites is
> feta, tomato, and mushrooms.

I agree that feta cheese is a topping,  regardless of my claim that "cheese"
is not a topping.  I'll even go along with calling "extra cheese"  a
topping,  even though it's made of the same stuff as "cheese".

I just goes to show you how subjective the subject matter really is.
Roy Hann - 01 Nov 2007 23:48 GMT
> Maybe that second "contradiction" is just psychological and there is
> always another possible predicate that washes it away, such as "Person P
> has the children {C}".  But that second tuple still seems superfluous.

A set of values without an explicit predicate is just noise.  It isn't even
capable of being said to be contradictory without one.  So you always need
the predicate.  If you have a proposition you need to assert and no
predicate that it fits, you need to introduce one.

Introducing a new predicate doesn't "wash" anything away.  You make it sound
like you would collect values and hope that someday you will find out what
they mean.  But really you work the other way round, starting with the
definition of a predicate that allows you always to assert the propositions
you are interested in, in the form of tuples.

Two indentical-looking tuples can mean entirely different things.  I can
think of any number of meanings for {Roy, 47}.  Maybe it's my name and age.
Or my name and the number of illegitimate children I have.  Or maybe it's my
father's name and his house number.  Who knows, until I tell you?

Roy
paul c - 02 Nov 2007 00:24 GMT
...
> Two indentical-looking tuples can mean entirely different things.  I can
> think of any number of meanings for {Roy, 47}.  Maybe it's my name and age.
> Or my name and the number of illegitimate children I have.  Or maybe it's my
> father's name and his house number.  Who knows, until I tell you?
>
> Roy

I'm still looking for an example of a predicate that uses RVA's where an
empty RVA in a tuple makes sense.
dawn - 02 Nov 2007 20:20 GMT
> ...
>
[quoted text clipped - 7 lines]
> I'm still looking for an example of a predicate that uses RVA's where an
> empty RVA in a tuple makes sense.

I suspect that makes sense to me might not to you ;-) but I'll toss
out an optional list of keywords in a predicate as a possible empty
RVA in a tuple.  Another example is OtherLastNames, FormerLastNames or
AliasLastNames.  One row in the tuple might include only a "maiden
name" for a person, another might have two other last names used by
this person (other than the value of LastName in this row) and a third
might be the empty set.  HTH  --dawn
David Cressey - 02 Nov 2007 21:05 GMT
> > ...
> >
[quoted text clipped - 15 lines]
> this person (other than the value of LastName in this row) and a third
> might be the empty set.  HTH  --dawn

AHA!  I knew that mentioning pizza toppings would cause you to uncloak!
dawn - 04 Nov 2007 01:32 GMT
> > > ...
>
[quoted text clipped - 20 lines]
>
> AHA!  I knew that mentioning pizza toppings would cause you to uncloak!- Hide quoted text -

I guess I could smell it from several newsgroups away, David, 'cause I
love pizza (discussions), especially those with the cheese on the
bottom like they make in Chicago, and then there are those colorful
cars that also tickle my fancy.

I'll go back now to designing keyword attributes and other weak
properties as multivalues, modeling data in Non-First-Normal Form
(given that First Normal Form refers to the form formerly known as
1NF).  cheers!.  --dawn
paul c - 03 Nov 2007 16:49 GMT
>> ...
>>
[quoted text clipped - 13 lines]
> this person (other than the value of LastName in this row) and a third
> might be the empty set.  HTH  --dawn

This is the trouble with English, which I believe has hundreds of
thousands more words than any other language, possibly because most of
them were stolen from other languages but that's beside the point.

In ordinary talk, it is so deceptively easy to include the ordinary
adjective "optional" when talking about predicates while ignoring the
traditional sense of logical predicates that involves quantifiers.
Things might be clearer if all db talk was conducted in Latin.  But I'd
say it should be or the other, not like CJ Date mixing in his "mutatis
mutandis" and so forth with his English.
Bob Badour - 03 Nov 2007 21:52 GMT
>>> ...
>>>
[quoted text clipped - 28 lines]
> say it should be or the other, not like CJ Date mixing in his "mutatis
> mutandis" and so forth with his English.

Incidentally, Edsger Dijkstra recommended practising computing science
in a second language.
David Cressey - 04 Nov 2007 12:25 GMT
> >>> ...
> >>>
[quoted text clipped - 31 lines]
> Incidentally, Edsger Dijkstra recommended practising computing science
> in a second language.

Yo tambiƩn lo recomiendo.
Jon Heggland - 02 Nov 2007 08:25 GMT
Quoth paul c:
> F   {C}
> _   ___
[quoted text clipped - 20 lines]
> If RVA's aren't allowed (and neither are nulls), I think such
> contradictions aren't possible.

It is nothing to do with RVAs. You could with as much justification say
that the relations ((Joe was born in 1970), (Bob was born in 2009)) or
((Joe was born in 1970), (Joe was born in 1975)) are contradictory.

> I'm wondering are there applications where RVA values that are "empty"
> make sense or are such values just a curious by-product of RVA's?

Consider the standard example of relvars and keys. Though of course,
empty RVA values are in some sense a by-product of RVAs... :)
Signature

Jon

paul c - 02 Nov 2007 15:56 GMT
,,,
>> I'm wondering are there applications where RVA values that are "empty"
>> make sense or are such values just a curious by-product of RVA's?
>
> Consider the standard example of relvars and keys. Though of course,
> empty RVA values are in some sense a by-product of RVAs... :)

The relvars and keys example might be a little more interesting than
mine.  I'd say this is because D&D emphasize that an empty header can be
a key.  But if it is, then there would be only one tuple for a given
relation that has an empty RVA, no other tuples for that RVA.  I suppose
if RVA's weren't allowed, a dbms that didn't support RVA's would have to
 presume the empty header as a key when no other set of attributes was
specified.
paul c - 02 Nov 2007 15:59 GMT
...
> The relvars and keys example might be a little more interesting than
> mine.  I'd say this is because D&D emphasize that an empty header can be
> a key.  But if it is, then there would be only one tuple for a given
> relation that has an empty RVA, no other tuples for that RVA.  ...

Oops, should have said ",no other tuples about that relation's keys".
Jon Heggland - 05 Nov 2007 07:27 GMT
Quoth paul c:
> The relvars and keys example might be a little more interesting than
> mine.  I'd say this is because D&D emphasize that an empty header can be
> a key.  But if it is, then there would be only one tuple for a given
> relation that has an empty RVA, no other tuples [about that relation's
> keys].

Yes, but this is only a special case of the constraint that no key may
be a proper subset of another key for the same relation. It is not some
strange nullological phenomenon.

> I suppose
> if RVA's weren't allowed, a dbms that didn't support RVA's would have to
> presume the empty header as a key when no other set of attributes was
> specified.

I see no need for presumption. Without RVAs, an AMI would probably be in
order, and by not associating any attributes with it, one would have an
explicitly empty key, no?
Signature

Jon

paul c - 05 Nov 2007 15:42 GMT
> Quoth paul c:
>> The relvars and keys example might be a little more interesting than
[quoted text clipped - 15 lines]
> order, and by not associating any attributes with it, one would have an
> explicitly empty key, no?

I'd see it exactly as an application presumption if the catalog had a
value in the "AMIS" table that wasn't in the "KEYS" table (unless the
dbms didn't support empty headers as keys.)  The single table/relvar
allowing RVA's seems neater to me, more exact than using two relvars.

Bob B's example of pizza prices seems more exact too.  Some pricing apps
might be simpler because of it.
Jon Heggland - 07 Nov 2007 07:39 GMT
Quoth paul c:
>> I see no need for presumption. Without RVAs, an AMI would probably be in
>> order, and by not associating any attributes with it, one would have an
[quoted text clipped - 3 lines]
> value in the "AMIS" table that wasn't in the "KEYS" table (unless the
> dbms didn't support empty headers as keys.)

It would be in the "KEYS" relvar, but not in the "KEYATTRIBUTES" relvar,
I think... though it makes little sense to discuss this without
specifying the design completely.

> The single table/relvar
> allowing RVA's seems neater to me, more exact than using two relvars.

Neater, definitely. (I'm not sure what you mean by "exact".) But wasn't
your argument that RVAs are messy because of (perceived) possibility of
inconsistency? Anyway, the structural design is neater, but the
constraint to ensure that the key attributes are in fact attributes in
the key's relvar, might be more complicated.
Signature

Jon

David BL - 03 Nov 2007 04:04 GMT
> I'm wondering are there applications where RVA values that are "empty"
> make sense or are such values just a curious by-product of RVA's?  If
> the latter, should they be suppressed or somehow prevented?

In January I started a thread called "RA with MV attributes", in which
I provided a formal definition of a join operator.  It basically takes
set intersections on the joined attributes.  Here is the example I
used to show it in action, where we are joining on cars...

r1(Names,Cars)
   bill,            car1,car2,car4
   john,fred        car3

r2(Cars,Colours)
  car1,car3,car4    red
  car2              green

r1 |X| r2 (Names,Cars,Colours)
  bill              car1,car4     red
  bill              car2          green
  john,fred         car3          red
  john,fred                       green

Note the suspicious last tuple which has an empty set of cars that are
green.

Marshall pointed out that it's rather like a full outer join.

In that thread I suggested that we could interpret this in FOPL by
defining a mapping back to conventional predicates with single valued
attributes, based on taking cross products of the multi-valued
attributes.  Furthermore under that interpretation the above result
comes back to an inner join!

Note therefore that the last tuple actually maps to zero predicates.

So r1 |X| r2 is *interpreted* as

  Name              Car           Colour
  --------------------------------------
  bill              car1          red
  bill              car4          red
  bill              car2          green
  john              car3          red
  fred              car3          red

The MV approach suffers from a troubling non-uniqeness of
representation.  I don't know if this is really a problem or not.

BTW, in that thread Bob pointed out that a naive definition of
projection gives the wrong answers.  Clearly a correct definition of
projection would be straightforward given the reinterpretation in
single valued attributes.

I'm not sure whether the idea has any merit. It possibly could if one
is faced with a problem domain with lots of missing information, and
many, many 6NF predicates that would become painful to work with.  In
certain problem domains the space reduction could be significant.
There are potential benefits for both the user and the DBMS
implementation
paul c - 03 Nov 2007 16:25 GMT
>> I'm wondering are there applications where RVA values that are "empty"
>> make sense or are such values just a curious by-product of RVA's?  If
[quoted text clipped - 31 lines]
>
> Note therefore that the last tuple actually maps to zero predicates.
...

I've sometimes wondered whether something like this might offer
occasional convenience, but as stated I find it hard to reconcile with
the "first principles" that I tend to follow (or like to think I
follow).  Not to say D&D's basic definitions are the only ones that can
be used, but I think we'd have to have agreement on how the operators
apply.  For example, if I understand D&D, r1 |x| r2 above would be empty.

Also I think it is risky in this particular newsgroup to use the term
"MV" because there are some posters for whom that stands for something
far afield from relational theory so the threads can get quite murky,
full of cross-purposes.

To me, it seems inherent in D&D's approach that when we name a relation
and its attributes, we are also implicitly defining other relations that
have only a subset of those attributes.  But the predicates of the
implicit relations are existentially qualified, ie., their possible
extensions depend on the actual extension of the original relation.
 For example, in your r1 |x| r2, it seems to mean among other things
that there exist green cars that john and fred own at the same time as
there exist no green cars that they could own because the only green car
is car2 and they don't own it.

Secondly, if I have a relation with the first three rows of r1 |x| r2
above (header Names, Cars, Colours),

>    bill              car1,car4     red
>    bill              car2          green
>    john,fred         car3          red

and I wish to insert the fact, and only that fact, that john and fred
own a green car (if that is what you intend the fourth row to mean),
some language might allow me to do that without mentioning the Cars
attribute, but I don't think it would be a D&D language because in D&D,
"insert" is defined on <OR> and that would mean at minimum we'd need to
insert tuples with all possible values of the Cars attribute, eg.,

john,fred                 green
john,fred car1            green
john,fred car1,car2       green

... and so forth.

Personally, I've thought for a couple of years that it might be useful
to try to entertain a logical system that supports something akin to
what you are talking about but first I think the underlying logical
operators would need to be worked out including any precedences that
might be required.

When I see the word "space", I usually infer that that the writer is
talking about a physical layer.  If that's the case here, I still don't
think that will wash away my logical questions unless the user interface
 includes physical operators, which I think is not a good idea.

I suspect that you might be more technically capable than I am of
revising the first principles in a way that might support what you are
driving at and I hope you will try.  Even if it doesn't result in a
logical system, I think the exercise is good.

ps: (I mention D&D because I find their definitions are more precise
than Codd's and also because I'm not sure if he ever entertained subsets
of headers - from what I've read I think he only talked of header
elements and didn't worry about "empty" headers, but I could be wrong.)
paul c - 03 Nov 2007 17:29 GMT
..  But the predicates of the
> implicit relations are existentially qualified, ...

instead of qualified, meant to say quantified.  (I suppose it is
attributes that express qualification.)
David BL - 05 Nov 2007 03:59 GMT
> >> I'm wondering are there applications where RVA values that are "empty"
> >> make sense or are such values just a curious by-product of RVA's?  If
[quoted text clipped - 38 lines]
> the "first principles" that I tend to follow (or like to think I
> follow).

I appreciate that point of view.

> Not to say D&D's basic definitions are the only ones that can
> be used, but I think we'd have to have agreement on how the operators
> apply.  For example, if I understand D&D, r1 |x| r2 above would be empty.

Consider that we have a function I (an "interpretation") that maps a
relation with MV attributes to an "equivalent" relation with SV
attributes.  Formally this simply takes cross products.  For example,
in the above example I(r1) is

   Name              Car
 --------------------------
   bill              car1
   bill              car2
   bill              car4
   john              car3
   fred              car3

and I(r2) is

   Car               Colour
 --------------------------
   car1              red
   car3              red
   car4              red
   car2              green

I think it is straightforward to prove the following in the general
case

    I(r1 |x| r2) = I(r1) |x| I(r2)

where |x| on the LHS is the join operator on relations with MV
attributes, and |x| on the RHS is the conventional inner join on
relations with SV attributes.

So there is a rather simple relationship with the conventional join
operator.

> Also I think it is risky in this particular newsgroup to use the term
> "MV" because there are some posters for whom that stands for something
> far afield from relational theory so the threads can get quite murky,
> full of cross-purposes.

Yes, unfortunate baggage!

> To me, it seems inherent in D&D's approach that when we name a relation
> and its attributes, we are also implicitly defining other relations that
> have only a subset of those attributes.  But the predicates of the
> implicit relations are existentially qualified, ie., their possible
> extensions depend on the actual extension of the original relation.

Is this what you mean (in Prolog):

   r(Name,Car,Colour) :- Name owns Car with Colour.

   r1'(Name,Car) :- r(Name,Car,Colour).

or in natural language

   r1'(Name,Car) :- there exists Colour such that r(Name,Car,Colour).

A question that interests me is whether r1 = r1', where

   r1(Name,Car) :- Name owns Car.

It seems related to the problem of how to deal with missing
information.  Consider that we have recorded the fact that Sue owns
car17 but we don't know what colour it is.  Then this fact could
appear in r1\r1'.

Mixed up in this question is the distinction between base relations
and derived relations.

>   For example, in your r1 |x| r2, it seems to mean among other things
> that there exist green cars that john and fred own at the same time as
> there exist no green cars that they could own because the only green car
> is car2 and they don't own it.

Excellent point.  I have been thinking the same thing.   To that end I
have been looking at modifying my join operator to strip out the
tuples where the intersection on the joined attributes is empty.

I think I was led astray because my main reason for considering all
this is to support missing data.

Here's a proposal for a new MV join operator...

I'll define r1(x,y) |x| r2(y,z),  where y is the common attributes to
join on.

For each tuple t1 from r1, and each tuple t2 from r2 the MV join
operator should potentially add as many as three tuples into the join
result r = r1 |x| r2 as follows.

1.   if t1(y) intersect t2(y) <> {}
        r += (t1(x), t1(y) intersect t2(y), t2(z))

2.   r += (t1(x), t1(y)\t2(y), {})

3.   r += ({}, t2(y)\t1(y), t2(z))

[Aside: This could pollute the result with redundant information - no
doubt a symptom of the non-uniqueness of representation, and for those
reasons I'm liking this MV approach less and less.  To treat missing
data I'm probably better off defining an analogous relational
interpretation of tables which may contain 0 or 1 value at a given
row, column position]

Anyway, I think the following properties will be true...

    I(r1) =  I( proj( r1 |x| r2 , {x,y} ) )
    I(r2) =  I( proj( r1 |x| r2 , {y,z} ) )
    I(r1 |x| r2) = I(r1) |x| I(r2)

I really should write formal proofs before risking wasting your time!

If these results hold then we have an *information preserving* join
operator.  What interests me is to use this formalism as a basis for
understanding missing information.

It seems that there can be lots of different projection-
interpretations because in general projection and interpretation don't
commute.  I'm alluding to the distinction between r1,r1' above.

As another example consider the following distinctions

   person1(N) :- N is the name of a person

   person2(N) :- N is the name of a person known to own a car

   person3(N) :- N is the name of a person known to own a car
                 with a known colour.

The reason for wanting to normalise r(Names,Cars,Colours) into base
relations r1(names,Cars) and r2(Cars,Colours) is to avoid redundancy
and those nasty update anomalies.  This only depends on 3NF.

I suspect at this point we need a different example to illustrate
where the MV attribute formalism might be useful.  ie one where we
moving from 5NF to 6NF causes relations to be decomposed.  I'm
suggesting that we leave the base relations in 5NF and use empty sets
to support missing information.  The main departure with conventional
RM/RA is the idea that the projection operator is parameterised by two
sets of attributes!

    project'( r, X1, X2) =  project(  I (project(r, X1)), X2 )

Anyway, that's enough hand waving for now!

> Secondly, if I have a relation with the first three rows of r1 |x| r2
> above (header Names, Cars, Colours),
[quoted text clipped - 15 lines]
>
> ... and so forth.

I agree.  I'm suspicious of allowing for stating the fact that john
and fred own a green car without providing the identity of the car
that they own.

> Personally, I've thought for a couple of years that it might be useful
> to try to entertain a logical system that supports something akin to
[quoted text clipped - 16 lines]
> of headers - from what I've read I think he only talked of header
> elements and didn't worry about "empty" headers, but I could be wrong.)
paul c - 05 Nov 2007 16:52 GMT
...

>> Not to say D&D's basic definitions are the only ones that can
>> be used, but I think we'd have to have agreement on how the operators
[quoted text clipped - 31 lines]
> relations with SV attributes.
> ...

Are you suggesting cross product as an additional fundamental operator?
If we're instead talking about cartesian product, I take it that r1
could be written like this:

Name         Car
-----------  ------------
{bill}       {car1,car2,car4}
{john,fred}  {car3}

and r2 like this:

Car               Colour
----------------  ---------
{car1,car3,car4}  {red}
{car2}            {green}

if those make sense, by the D&D definition of "cartesian product", I
think r1 |x| r2 would be empty and I presume so would I(r1 |x| r2).
paul c - 05 Nov 2007 17:01 GMT
...
> if those make sense, by the D&D definition of "cartesian product", I
> think r1 |x| r2 would be empty and I presume so would I(r1 |x| r2).

Sorry, let me take that back, I think I should have said intersection,
not cartesian product.
Bob Badour - 05 Nov 2007 18:50 GMT
> ...
>
[quoted text clipped - 3 lines]
> Sorry, let me take that back, I think I should have said intersection,
> not cartesian product.

The join is empty. The intersection is empty. If one renamed one of the
"car" attributes to something else, the join would have 4 rows.
paul c - 06 Nov 2007 02:29 GMT
>> ...
>>
[quoted text clipped - 6 lines]
> The join is empty. The intersection is empty. If one renamed one of the
> "car" attributes to something else, the join would have 4 rows.

I think it would have 20!
Bob Badour - 06 Nov 2007 02:40 GMT
>>> ...
>>>
[quoted text clipped - 8 lines]
>
> I think it would have 20!

r1:

Name         Car
-----------  ------------
{bill}       {car1,car2,car4}
{john,fred}  {car3}

r2:

Car               Colour
----------------  ---------
{car1,car3,car4}  {red}
{car2}            {green}

r1 join ( r2 rename Car as Vehicle ):

Name           Car                 Vehicle            Colour
-------------  ------------------  -----------------  ---------------
{bill}         {car1,car2,car4)    {car1,car3,car4}   {red}
{bill}         {car1,car2,car4)    {car2}             {green}
{john,fred}    {car3}              {car1,car3,car4}   {red}
{john,fred}    {car3}              {car2}             {green}

I count 4 rows.
paul c - 06 Nov 2007 03:02 GMT
>>>> ...
>>>>
[quoted text clipped - 33 lines]
>
> I count 4 rows.

Okay, I thought you were using the sources from David B's post about his
"I" function which would have 20.
Bob Badour - 06 Nov 2007 03:16 GMT
>>>>> ...
>>>>>
[quoted text clipped - 36 lines]
> Okay, I thought you were using the sources from David B's post about his
> "I" function which would have 20.

I don't bother reading David's posts. I only see what you excerpt, and
when I replied to you this time, I was replying to you.
paul c - 06 Nov 2007 03:18 GMT
...

>>> r1 join ( r2 rename Car as Vehicle ):
>>>
[quoted text clipped - 12 lines]
> I don't bother reading David's posts. I only see what you excerpt, and
> when I replied to you this time, I was replying to you.

Okay, I'll try to remember that.
David BL - 06 Nov 2007 07:02 GMT
> >>>>> ...
>
[quoted text clipped - 41 lines]
>
> - Show quoted text -

I wish Bob would read my posts; his insights would be valuable.
Roy Hann - 06 Nov 2007 10:39 GMT
>> I think it would have 20!
>
[quoted text clipped - 22 lines]
>
> I count 4 rows.

I have been on the fence about RVAs for years.  I can see why Date and
others (including you guys) want to talk about them for the purpose of
understanding where the theory takes you.  But this little exchange shows me
that I never want to see RVAs implemented in any product.  (I am not talking
about paul's confusion about the relations in question.)

I don't care if there is a problem that can be solved only with RVAs, the
misery they would invite just wouldn't be worth it.  The old joke says if we
ever teach computers to understand English we will find out that programmers
can't write it.  If we ever produce a product that supports RVAs we will
find out programmers are wanting in that area too.

Roy
paul c - 06 Nov 2007 16:22 GMT
...
> I have been on the fence about RVAs for years.  I can see why Date and
> others (including you guys) want to talk about them for the purpose of
[quoted text clipped - 7 lines]
> can't write it.  If we ever produce a product that supports RVAs we will
> find out programmers are wanting in that area too.

Even though they seem to make logical sense, I'd have to agree with
anybody who says they are cumbersome and might be a PITA for a
programmer who had to use them all them day long.  Just because
something might be a logical possibility doesn't make it reasonable in
general.

One thing that annoys me about them is how they allow two attributes
with the same name to be thought of as "in the same outer relation", if
you will.  I find it hard to even talk about them without using "nested
English".  I can imagine an EAV fanatic using them to make a system
where every query or change requires RENAME clauses.

But I'd like to suggest that even though I throw the term RVA around,
pretty loosely too, I'm not sure all these posts have been about RVA's
but rather something else, even if that something else is not well
defined in the context of the rest of RT.  Perhaps "set-valued
attributes" describes it better.  These might just be a figment of my
imagination, as I have been expressing them rather casually, assuming
that there is a way to define a relation that could avoid RENAME when it
is manipulated.
Jon Heggland - 07 Nov 2007 08:13 GMT
Quoth paul c:
> One thing that annoys me about them is how they allow two attributes
> with the same name to be thought of as "in the same outer relation", if
> you will.

What do you mean? That an RVA might have an attribute with the same name
as an attribute in the enclosing relation? If you think of these as "in
the same outer relation", it is your thinking that is faulty, I'd say. I
don't see the difference between this and an attribute having a possrep
with a component name that is the same as a different attribute. But
perhaps I'm misinterpreting you.

> But I'd like to suggest that even though I throw the term RVA around,
> pretty loosely too, I'm not sure all these posts have been about RVA's
> but rather something else, even if that something else is not well
> defined in the context of the rest of RT.  Perhaps "set-valued
> attributes" describes it better.

Definitely; all the examples I've bothered to read (and write) have been
using unary "RVAs" without attribute names, so one might as well talk
about SVAs (which don't seem to be in dire need of better definition).
And I find this amusing, as I've gotten the impression that there has
been established a tentative consensus here that SVAs and indeed all
kinds of XVAs /except/ RVAs are fine and dandy, and don't violate 1NF;
but that RVAs are dangerous, and lead to second-order logic,
inconsistency, confusion and excessive renaming---apparently because the
relational engine "understands" them. Pish and tosh, I say. Cumbersome,
yes. Mostly useless, yes. Fundamentally different from other data types, no.
Signature

Jon

paul c - 07 Nov 2007 14:34 GMT
> Quoth paul c:
>> One thing that annoys me about them is how they allow two attributes
[quoted text clipped - 8 lines]
> perhaps I'm misinterpreting you.
> ...

I think you read me right, for me faulty thinking is easy when two
different things have the same name.
Jon Heggland - 07 Nov 2007 08:13 GMT
Quoth Roy Hann:
> I have been on the fence about RVAs for years.  I can see why Date and
> others (including you guys) want to talk about them for the purpose of
[quoted text clipped - 4 lines]
> I don't care if there is a problem that can be solved only with RVAs, the
> misery they would invite just wouldn't be worth it.

What misery, exactly? It's easy to design relvars with confusing
predicates using them, but that goes for boolean-valued attributes as
well. :)

If people just stopped thinking of RVAs as special in any way, and just
thought of relations as perfectly normal values, a lot of confusion
would go away.
Signature

Jon

David BL - 06 Nov 2007 06:45 GMT
> ...
>
[quoted text clipped - 35 lines]
>
> Are you suggesting cross product as an additional fundamental operator?

Oops.  That was silly.  I should have said cartesian product.

> If we're instead talking about cartesian product, I take it that r1
> could be written like this:
[quoted text clipped - 13 lines]
> if those make sense, by the D&D definition of "cartesian product", I
> think r1 |x| r2 would be empty and I presume so would I(r1 |x| r2).

I was treating mv-relations as formally different from sv-relations.
D&D's definitions only apply to sv-relations.

The interpretation I() maps an mv-relation to an sv-relation.  For
each mv-tuple, we take the cartesian product of the sets of values for
each attribute to yield a set of corresponding sv-tuples.

Definition:  Let r' = I(r).  Then

   attribs(r') = attribs(r)
   tuples(r') =
       { t' |  exists t in r and
               for all a in attribs(r), t'(a) is an element of t(a)
       }

If r1,r2 are sv-relations then the attributes map to single values
which are sets, and then I agree that r1 |x| r2 would be empty.

If r1,r2 are mv-relations then the attributes map to multiple values
which are again represented using sets.  However mv-relations have
different semantics, a different join operator and r1 |x| r2 is not
empty.

On another note, I've been thinking of an interesting partial ordering
on mv-tuples that is associated with information redundancy :

   t1 <= t2  if
       attribs(t1) is a subset of attribs(t2)  and
       for each attrib a in attribs(t1),  t1(a) is a subset of t2(a)

t1 <= t2 means that t1 is (information) redundant with respect to t2.

It seems to me that missing values should be treated merely as fewer
propositions in the context of a 2vl.

This provides a clue for how to define intersection, union and
difference operators on mv-relations.

I'm thinking of the following...

Intersection
--------------

Let t1,t2 be mv-tuples.  Then t = (t1 intersect t2) is defined as
follows

   attribs(t) = (attribs(t1) intersect attribs(t2))
   for each a in attribs(t),  t(a) = ( t1(a) intersect t2(a) )

This can be regarded as the largest amount of information consistent
with

   t1 => (t1 intersect t2)   and
   t2 => (t1 intersect t2)

Now an mv-relation is a union of mv-tuples, and evidently the union of
all the information expressed by the mv-tuples.  By the distributive
laws (on union and intersection) it makes sense to define

   r1 intersect r2 = { t1 intersect t2 | t1 in r1 and t2 in r2 }

I think it should be possible to prove

   I(r1 intersect r2) = I(r1) intersect I(r2).

Union
-----

Let t1,t2 be mv-tuples. (t1 union t2) could be defined as the smallest
amount of information consistent with

   (t1 union t2) => t1  and
   (t1 union t2) => t2

However that won't in general be reducible to a single tuple, so the
analogy with the intersection case breaks down.

Definition:  Let attribs(t) be a subset of X.  Let t' = extend(t,X)
represent the extension of t onto X by defining

for all a in attribs(t),  t'(a) = t(a)
for all a in  X\attribs(t),  t'(a) = {}

Note that extending a tuple with empty sets doesn't change the
information content.  More formally

   extend(t,X) <=> t

Definition:  r = r1 union r2 satisfies

   attribs(r) = attribs(r1) union attribs(r2)
   tuples(r) =
       { extend(t1,attribs(r)) | t1 in r1 } union
       { extend(t2,attribs(r)) | t2 in r2 }

I think it should be possible to prove

   I(r1 union r2) = I(r1) union I(r2).

Note the nice feature that this union operator is defined on all mv-
relations - ie r1,r2 don't need to be "union compatible".

Difference
----------

The analogy with intersection doesn't carry over for a simple
definition of r1\r2 in terms of t1\t2.  I'm not surprised that it gets
more complex here because negation in the presence of missing
information is tricky!  I think it should relate back to the idea of
"negation as failure&q