Welcome to dbFreaks.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

A different definition of MINUS, Part 3

 
Goto page 1, 2, 3, 4, 5, 6
   Database Help (Home) -> Technology and Theory RSS
Next:  SubReport: Determining Size?  
Author Message
paul c

External


Since: Aug 15, 2007
Posts: 659



(Msg. 1) Posted: Wed Dec 17, 2008 6:09 am
Post subject: A different definition of MINUS, Part 3
Archived from groups: comp>databases>theory (more info?)

In the original exchange ( http://www.dbdebunk.com/page/page/1396086.htm
), Date says:

"the operation DELETE SSP WHERE S# = S#('S1') AND P# = P#('P1') ;
is inherently unsafe, since we presumably don't know, in general,
whether there are any other shipments for supplier S1."

Any time Date says something, I think those of us laymen must pay
attention, so let me try and reconcile his comment with my own
conclusion. I don't argue with the adverb "inherently" because I came
to the same conclusion as far as how I expect most people probably
interpret this DELETE statement is concerned. I think I came to this
conclusion from a different angle, though, because in Parts One and Two,
I tried to be careful to keep any notion of language notions such as
assignment or of base or virtual relvars out of the 'algebraic' argument
and talk only of projections of results. (One might say I've implicitly
included virtual relations in that a projection is virtual as far as
tuples are concerned, but my argument is based more on triples than
tuples and a projection on some chosen set of attributes loses no
triples that those attributes have values for.)

Then he says: "But I never claimed--at least, I don't think I ever
claimed!--that the rule for deleting from a join was based purely on
logical inference."

In Parts One and Two I tried to argue that if D (the relation implied by
the WHERE clause) has ANY triple where S# = 'S1', the A-algebra and the
Tutorial D MINUS definition imply that R'{S#} will have no such triple,
similarly for R'{P#} where P# = 'P1'. From the equations in Parts One
and Two, I think we can also see that a D triple where P# = 'P1', would
cause an R'{S#} triple where S# = 'S2' to be 'lost' in the result as
well as any R'{P#} triple where P# = 'P2' and therefore lost from the
join R' = A <AND> B, and similarly from SSP = S <AND> SP. I think this
has nothing to do with any design principle or any implementation rule
that says to 'delete from both sides'. If what I've argued so far makes
sense, I think the 'rule' "delete from both sides" is purely a logical
inference. It is a direct consequence of the MINUS definition applied
with the A-algebra. (I know that it can be dangerous to disagree with
Date, but that's where my approach leads me, apologies to him if I've
made a mis-step.)

Whether people see this consequence as "unsafe" is psychological as far
as I'm concerned. In other words, my conclusion is that there is an
algebraic interpretation of this DELETE statement that leads logically
to results that most people probably don't expect. In this case, the
language keyword "AND" is present and yet the triples that are omitted
from the result involve a notion of "OR".

To my mind, the issue here is really a language issue, not a model
issue. I think it all depends on the definition we choose for MINUS and
when we choose a definition we need to consider what will result when
the algebraic operands in the definition don't have the same headings.
Let me try a different definition that tries to reflect the intention of
deleting only those tuples that have both triples standing for S# = 'S1'
and P# = 'P1'. To keep it as simple as possible, I'll consider only the
situation where the D header is a subset of the R (view) header. What I
think we want in D is a header that is equal to R's header and includes
only the tuples that have both of these triples.

If any relation 'r' is given an additional attribute 'a' that has all
possible values from the domain or type of 'a', we can say that every
tuple in 'r' is implied by the projection r+{Hr} of r{Hr,a}. If we
imagine some relation 'X' that has the 'a' attribute, we can express all
possible 'a' values algebraically as X <OR> <NOT> X. Let me apply this
to D by augmenting it with all possible triples containing the HR
attributes that aren't in D and call it D+:

D+ = ((R <OR> <NOT> R) <AND> D)

The complement of D+ will have tuples that have both triples standing
for, say, S# = 'S2' and P# = 'P1', or, say, for both of S# = 'S1' and P#
= 'P2' and for both of S# = 'S2' and P# = 'P2' and so on. If such pairs
of triples are in tuples of R, they will remain in the result R', so my
definition might be:

R MINUS D is semantically equivalent to the A expression R <AND> <NOT>
D+, ie., R <AND> <NOT> ((R <OR> <NOT> R) <AND> D)

Putting that condition in the form of an equation:

R' = R <AND> <NOT> D+
= R <AND> <NOT> ((R <OR> <NOT> R) <AND> D)

Now let me substitute A <AND> B for R:

R' = A <AND> B <AND> <NOT> (( (A <AND> B) <OR> <NOT> (A <AND> B) )
<AND> D )

The parentheses here are important, but otherwise I'm still assuming the
precedence and associativity I assumed in Part One. Still we can
distribute the long expression on the right that stands for the
complement of D+ over A and B:

R' = (A <AND> <NOT> (( (A <AND> B) <OR> <NOT> (A <AND> B) ) <AND> D ))
<AND>
(B <AND> <NOT> (( (A <AND> B) <OR> <NOT> (A <AND> B) ) <AND> D ))

I believe my previous arguments allow me to take the expressions in the
first and third lines above and add appropriate projections, eg;

R' = (A <AND> <NOT> (( (A <AND> B) <OR> <NOT> (A <AND> B) ) <AND> D ))
{HA}
<AND>
(B <AND> <NOT> (( (A <AND> B) <OR> <NOT> (A <AND> B) ) <AND> D
)) {HA}

so that the first line can be re-written as

A'{HA} = (A <AND> <NOT> (( (A <AND> B) <OR> <NOT> (A <AND> B) ) <AND>
D )) {HA}
= (A <AND> <NOT> D+) {HA}
and similarly for the third line.

This equation is hard to test manually, but I can try a couple of simple
examples.

Assume attributes named a,b,c,d having the domain {1,2} and relations A
and B with these values:

A:
a c
1 1
1 2
2 1

B:
a b d
1 1 2
1 2 1

A <AND> B: /* ie. the value of R */
a b c d
1 1 1 1
1 1 1 2
1 2 2 1

D:
a b
1 1

(A <AND> B) <OR> <NOT> (A <AND> B)
a b c d
1 1 1 1
1 1 1 2
1 1 2 1
1 1 2 2
1 2 1 1
1 2 1 2
1 2 2 1
1 2 2 2
2 1 1 1
2 1 1 2
2 1 2 1
2 1 2 2
2 2 1 1
2 2 1 2
2 2 2 1
2 2 2 2

D+:
a b c d
1 1 1 1
1 1 1 2
1 1 2 1
1 1 2 2

<NOT> D+:
a b c d
1 2 1 1
1 2 1 2
1 2 2 1
1 2 2 2
2 1 1 1
2 1 1 2
2 1 2 1
2 1 2 2
2 2 1 1
2 2 1 2
2 2 2 1
2 2 2 2

R':
a b c d
1 2 2 1

Note that only the tuples where a = 1 AND b = 1 have been 'deleted', not
the one where a = 1 OR b = 1, this gives a similar view result to the TD
example DELETE statement's result.

R'{HA} = (A <AND> <NOT> D+) {HA}
a c
1 2
2 1

Note that NO tuples in A have been 'dropped', which is not similar to
the example DELETE statement's result. I think this might make sense to
most people on the casual grounds that A never had any tuple with both
triples standing for a = 1 AND b = 1.

R'{HB} = (B <AND> <NOT> D+) {HB}
a b d
1 2 1

Note that only one tuple in B has been dropped, the one that has the
same two triples that D has.

If I were to use this different definition of MINUS, if only for the
case where HD is a proper subset of HA union HB, I'd want some kind of
formal exposition that allowed me to predict all possible results,
including ones for empty heading. As for cases where HD overlaps with
HA and HB in other ways or doesn't overlap at all, that would be even
more desireable. Not to mention an implementation that allows easier
validation of expectations compared to results.

In the meantime, let me show one other simpler example involving a
different sort of heading overlap, the degenerate Cartesian Product,
which I think might be important as far as the Principle of
Interchangeability ('POI') is concerned. Suppose relation X has
attribute x with domain (1,2} and Y has attribute x with domain {1,2}, eg.,

X:
x
1
2

Y:
y
1

R = X <AND> Y (Cartesian Product):
x y
1 1
2 1

D:
x y
1 1

D+ = (R <OR> <NOT> R) <AND> D:
x y
1 1

<NOT> D+:
x y
1 2
2 1
2 2

R'{HR} = R{HR} <AND> <NOT> D+:
x y
2 1

In the result for R', the tuple that has both of the D triples, ie. x =
1 and y = 1, has been dropped, which seems compatible with the POI.

X'{HX} = (X <AND> <NOT> D+) {HX}:
x
1
2

But the X' result has dropped no tuples.

Y'{HY} = (Y <AND> <NOT> D+) {HY}:
y
1

If we produce R' from X' <AND> Y', R' = R!

Neither has the Y' result dropped any tuples and we have a situation
where R = X <AND> Y, but R' is NOT equal to X' <AND> Y', in other words
DELETE R WHERE X = 1 AND Y = 1 does nothing! I think the casual
explanation for this result is sort of patent - neither X nor Y can ever
have a tuple with two triples. Somewhere Date mentions to the effect
that the POI means there should be "no arbitrary or unnecessary"
differences between base and virtual relvars. From a purely (I hope)
algebraic standpoint, it looks to me that the different MINUS definition
must imply a difference. Personally, I'd say it is a necessary
difference, not an arbitrary one.

This is why I think McGoveran might be right if he is saying that there
are times when a user must be aware of virtual relvars in order to
appreciate dbms results.

 >> Stay informed about: A different definition of MINUS, Part 3 
Back to top
Login to vote
paul c

External


Since: Aug 15, 2007
Posts: 659



(Msg. 2) Posted: Wed Dec 17, 2008 6:44 am
Post subject: Re: A different definition of MINUS, Part 3 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

paul c wrote:
....
> I believe my previous arguments allow me to take the expressions in the
> first and third lines above and add appropriate projections, eg;
>
> R' = (A <AND> <NOT> (( (A <AND> B) <OR> <NOT> (A <AND> B) ) <AND> D ))
> {HA}
> <AND>
> (B <AND> <NOT> (( (A <AND> B) <OR> <NOT> (A <AND> B) ) <AND> D ))
> {HA}
> ...

typo': that second projection {HA} should read {HB}.

 >> Stay informed about: A different definition of MINUS, Part 3 
Back to top
Login to vote
paul c

External


Since: Aug 15, 2007
Posts: 659



(Msg. 3) Posted: Wed Dec 17, 2008 12:29 pm
Post subject: Re: A different definition of MINUS, Part 3 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

paul c wrote:
,,,
> Neither has the Y' result dropped any tuples and we have a situation
> where R = X <AND> Y, but R' is NOT equal to X' <AND> Y', in other words
> DELETE R WHERE X = 1 AND Y = 1 does nothing! ...

Oops, just noticed, that was pretty clumsy, what I wrote denies
everything I've been saying all along and I didn't mean that. I should
have said it subjunctively: "... if we had a situation where R' were not
equal to X' <AND> Y', we would have a serious contradiction in the
algebra, so R' IS equal to X' <AND> Y' and no tuples are dropped from
the result...". I stand by the rest, ie., the DELETE statement does
nothing.

(I don't know why Date referred to the statement as an "operation".
Personally, I think calling it an operation takes a turn that might risk
confusing a language implementation with the algebra the language
interprets or, equally, is based on. But as long as I live, I imagine
there will always be nuances he suggests that will puzzle me.)

Also, I want to comment further on what 'BS' said in a reply about an
algebra and it not having any notion of 'before' or 'after'. I agree
that the A-algebra doesn't have such notions, which in fact is one of
its advantages, eg., there are fewer concepts in an algebra to confuse
us (and I do mean the plural 'us'). As Darwen likes to point out, logic
isn't concerned with meaning, which is its advantage because we can
choose the analogues we want to use it for. It's like when McCarthy
talked about submarines not being able to swim. They can't but we can
pretend that they can pretend to (apologies to Bob B for the possible
homomorphism, but even D&D overload the verb 'to know' when they talk
about dbms's! As Djiksta said, when you get right down to it, all a
program does is manipulate symbols. What the symbols mean is up to 'us').

But I would like to ask how is that a result can't be interpreted as an
'after value' when an algebraic equation does allow us to talk of a
result of algebraic operations? What's more, no matter what changes
happen over time, such an equation, if it doesn't contradict any others,
as well as the result, is always true.

It is simple to invent algebraic operands that can be interpreted as
'before' and 'after', one just makes up names, eg., R' and R. The names
can stand double-duty too in that (consistent) equations are invariant.

Personally I am coming to believe that the only "dire consequences" one
can encounter turn up when one talks about the RM in terms of a language
implementation, instead of sticking either to the algebra or to the
calculus. Whether dire or not, I judge them to be self-inflicted
consequences.
 >> Stay informed about: A different definition of MINUS, Part 3 
Back to top
Login to vote
Brian Selzer

External


Since: Jan 15, 2008
Posts: 527



(Msg. 4) Posted: Wed Dec 17, 2008 11:12 pm
Post subject: Re: A different definition of MINUS, Part 3 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"paul c" wrote in message

> paul c wrote:
> ,,,
>> Neither has the Y' result dropped any tuples and we have a situation
>> where R = X <AND> Y, but R' is NOT equal to X' <AND> Y', in other words
>> DELETE R WHERE X = 1 AND Y = 1 does nothing! ...
>
> Oops, just noticed, that was pretty clumsy, what I wrote denies everything
> I've been saying all along and I didn't mean that. I should have said it
> subjunctively: "... if we had a situation where R' were not equal to X'
> <AND> Y', we would have a serious contradiction in the algebra, so R' IS
> equal to X' <AND> Y' and no tuples are dropped from the result...". I
> stand by the rest, ie., the DELETE statement does nothing.
>
> (I don't know why Date referred to the statement as an "operation".
> Personally, I think calling it an operation takes a turn that might risk
> confusing a language implementation with the algebra the language
> interprets or, equally, is based on. But as long as I live, I imagine
> there will always be nuances he suggests that will puzzle me.)
>
> Also, I want to comment further on what 'BS' said in a reply about an
> algebra and it not having any notion of 'before' or 'after'. I agree that
> the A-algebra doesn't have such notions, which in fact is one of its
> advantages, eg., there are fewer concepts in an algebra to confuse us (and
> I do mean the plural 'us'). As Darwen likes to point out, logic isn't
> concerned with meaning, which is its advantage because we can choose the
> analogues we want to use it for. It's like when McCarthy talked about
> submarines not being able to swim. They can't but we can pretend that
> they can pretend to (apologies to Bob B for the possible homomorphism, but
> even D&D overload the verb 'to know' when they talk about dbms's! As
> Djiksta said, when you get right down to it, all a program does is
> manipulate symbols. What the symbols mean is up to 'us').
>
> But I would like to ask how is that a result can't be interpreted as an
> 'after value' when an algebraic equation does allow us to talk of a result
> of algebraic operations? What's more, no matter what changes happen over
> time, such an equation, if it doesn't contradict any others, as well as
> the result, is always true.
>
> It is simple to invent algebraic operands that can be interpreted as
> 'before' and 'after', one just makes up names, eg., R' and R. The names
> can stand double-duty too in that (consistent) equations are invariant.
>
> Personally I am coming to believe that the only "dire consequences" one
> can encounter turn up when one talks about the RM in terms of a language
> implementation, instead of sticking either to the algebra or to the
> calculus. Whether dire or not, I judge them to be self-inflicted
> consequences.

It isn't about implementation: it's about the logic that underpins the RM.
Regardless of how many possible values there can be for a database, only one
can actually be the value of the database at any set point in time.
Algebraic expressions derive information from the actual value of the
database; updates, on the other hand, assert which possible value for the
database is also the actual value. Common sense tells us to discard a
result that is based upon a false premise, so it follows that the result of
an algebraic expression that involves a possible value for the database that
is not also the actual value is just as useless. The algebra and the
calculus are therefore limited in their utility to answering queries from
the actual value of the database and have absolutely nothing to do with
selecting which possible value is also the actual value. In other words,
neither the algebra nor the calculus are sufficient when it comes to
database updates. As a consequence, a 'purely algebraic' approach here is
contraindicated.

There's nothing wrong it using the algebra or the calculus for what they
were designed for, which is answering queries, or even for calculating the
resulting set of relations that are becoming the new value for the database,
but it's important to remember that it is the result that is assigned, and
that the assignment principle doesn't require that the result be
recalculated once the assignment has been made. Consider:

x := x + 1

replaces the contents of the variable x with the result of incrementing the
current value in x. This is in accord with the assignment principle because
the rhs of the assignment is only evaluated once.
 >> Stay informed about: A different definition of MINUS, Part 3 
Back to top
Login to vote
Cimode

External


Since: Feb 07, 2008
Posts: 126



(Msg. 5) Posted: Thu Dec 18, 2008 12:31 pm
Post subject: Re: A different definition of MINUS, Part 3 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hope this will publish adequately...

R-D= R - (R ∩ D) = R-[(RXD) - (R ∆ D)] = R U R∆D - RXD

R=[{1},{2},{4}]
D= [{1},{3}]

R-D = [{1},{2},{4}] U [{2}, {3}] - [{1, 1}{1, 2}{1, 4} {3, 1} {3, 2}
{3, 4}]
=[{1}{2}{3}{4}] - [{1, 1}{1, 2}{1, 4} {3, 1} {3, 2}{3, 4}]
=[{1}{2}{3}{4}] - [{1}, {3}]
=[{2}{4}]
 >> Stay informed about: A different definition of MINUS, Part 3 
Back to top
Login to vote
Cimode

External


Since: Feb 07, 2008
Posts: 126



(Msg. 6) Posted: Thu Dec 18, 2008 12:36 pm
Post subject: Re: A different definition of MINUS, Part 3 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 18 déc, 20:31, Cimode wrote:
> Hope this will publish adequately...
>
> R-D= R - (R ∩ D) = R-[(RXD) - (R ∆ D)] = R  U R∆D -  RXD
>
> R=[{1},{2},{4}]
> D= [{1},{3}]
>
> R-D = [{1},{2},{4}] U [{2}, {3}] - [{1, 1}{1, 2}{1, 4} {3, 1} {3, 2}
> {3, 4}]
> =[{1}{2}{3}{4}] - [{1, 1}{1, 2}{1, 4} {3, 1} {3, 2}{3, 4}]
> =[{1}{2}{3}{4}] - [{1}, {3}]
> =[{2}{4}]

To be more precise, I should have written

R-D= R - (R ∩ D) = R-[(RXD) - (R ∆ D)] = R U R∆D - DXR --> Does make
a difference when headers are brought into the equation...

Apologies..
 >> Stay informed about: A different definition of MINUS, Part 3 
Back to top
Login to vote
vadimtro

External


Since: Jul 29, 2008
Posts: 26



(Msg. 7) Posted: Thu Dec 18, 2008 1:17 pm
Post subject: Re: A different definition of MINUS, Part 3 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Dec 17, 8:12 pm, "Brian Selzer" wrote:
> Regardless of how many possible values there can be for a database, only one
> can actually be the value of the database at any set point in time.
> Algebraic expressions derive information from the actual value of the
> database; updates, on the other hand, assert which possible value for the
> database is also the actual value.  Common sense tells us to discard a
> result that is based upon a false premise, so it follows that the result of
> an algebraic expression that involves a possible value for the database that
> is not also the actual value is just as useless.  The algebra and the
> calculus are therefore limited in their utility to answering queries from
> the actual value of the database and have absolutely nothing to do with
> selecting which possible value is also the actual value.  In other words,
> neither the algebra nor the calculus are sufficient when it comes to
> database updates.  As a consequence, a 'purely algebraic' approach here is
> contraindicated.

Purely algebraic approach,,,, all the way to go. Consider a linear (or
more general polynomial system), e.g.

x + y = t
x - y = s

It is a mapping of input set of variables (vector) into an output set.
To extend the analogy to view updates, we also have an input delta
vector mapped into the output delta. In this particular example, it is
easy to establish that the view update problem (that is calculating
input delta vector from output one) is well defined.

Contrast this to relational model where a view is a mapping from a set
of base relations into some output relation variable. We have two
differences
i. The algebra
ii. The number of equations, because a view is defined as a single
equation

I never understood why view update problem is scoped to a single view.
In a typical usage scenario -- database schema evolution -- a set of
base tables is substituted with a set of views, and the user can see
the whole update transaction as affecting multiple views. Therefore,
it is not unreasonable to generalize view updates to a *system* of
view equations. Why do we want to do that? Two reasons:
1. Database constraints are equations, and this generalization is a
natural way to encompass them.
2. Information preservation. This one is easier to explain by the
familiar linear system example. If there is not enough (linearly
independent) equations, then there is a fundamental ambiguity of the
inverse map that calculates input delta vector from the output.
 >> Stay informed about: A different definition of MINUS, Part 3 
Back to top
Login to vote
paul c

External


Since: Aug 15, 2007
Posts: 659



(Msg. 8) Posted: Fri Dec 19, 2008 6:47 am
Post subject: Re: A different definition of MINUS, Part 3 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

wrote:
....
>
> Purely algebraic approach,,,, all the way to go. Consider a linear (or
> more general polynomial system), e.g.
>
> x + y = t
> x - y = s
>
> It is a mapping of input set of variables (vector) into an output set.
> To extend the analogy to view updates, we also have an input delta
> vector mapped into the output delta. In this particular example, it is
> easy to establish that the view update problem (that is calculating
> input delta vector from output one) is well defined.
>
> Contrast this to relational model where a view is a mapping from a set
> of base relations into some output relation variable. We have two
> differences
> i. The algebra
> ii. The number of equations, because a view is defined as a single
> equation
>
> I never understood why view update problem is scoped to a single view.
> In a typical usage scenario -- database schema evolution -- a set of
> base tables is substituted with a set of views, and the user can see
> the whole update transaction as affecting multiple views. Therefore,
> it is not unreasonable to generalize view updates to a *system* of
> view equations. Why do we want to do that? Two reasons:
> 1. Database constraints are equations, and this generalization is a
> natural way to encompass them.
> 2. Information preservation. This one is easier to explain by the
> familiar linear system example. If there is not enough (linearly
> independent) equations, then there is a fundamental ambiguity of the
> inverse map that calculates input delta vector from the output.
>
>

I made some more equations and tried some different cases. As long as I
adjust for different headers, it all seems determinate.. Where the fun
begins is when R = A <AND> B and A and B have equal headings and
different extensions. This case seems to be indeterminate, which I find
somehow reassuring, because when they are combined into one I find
that the tuples that are not joined involve exclusive OR. I could
venture that McGoveran might say that this case is trying to join
contradictory propositions! This particular result somehow increases my
confidence in the purely algebraic analysis. (Also the remaining case
where A and B have equal headings and equal extensions, where it looks
like the algebra has only one solution, deleting from both A and B,
gives evidence that the pure algebra is pretty consistent and rather
faithful.)

Would you like try to your hand on the case where A and B have equal
headings and extensions to see if you get what I get?
 >> Stay informed about: A different definition of MINUS, Part 3 
Back to top
Login to vote
paul c

External


Since: Aug 15, 2007
Posts: 659



(Msg. 9) Posted: Fri Dec 19, 2008 7:02 am
Post subject: Re: A different definition of MINUS, Part 3 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

paul c wrote:
...
> Would you like try to your hand on the case where A and B have equal
> headings and extensions to see if you get what I get?
>

eg. show that 1) when A <AND> B is indeterminate, the equations can
always be rewritten as a union with the term A <XOR> B and 2) A <AND> B
is only indeterminate when A and B have equal headings and unequal
extensions.

I'm guessing this might be a more fruitful avenue than talking about
which relvars should change.
 >> Stay informed about: A different definition of MINUS, Part 3 
Back to top
Login to vote
vadimtro

External


Since: Jul 29, 2008
Posts: 26



(Msg. 10) Posted: Fri Dec 19, 2008 10:29 am
Post subject: Re: A different definition of MINUS, Part 3 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Dec 19, 6:47 am, paul c wrote:
> Would you like try to your hand on the case where A and B have equal
> headings and extensions to see if you get what I get?

I'm not sure what you mean by "extension". Wouldn't two relations x
and y such that their headings and content equals be the same
relation?

x ^ R00 = y ^ R00 &
x ^ R11 = y ^ R11 ->
x = y

is a theorem in RL.

I can't establish join view update under any "reasonable" condition.
Here is my reworked calculation

x - base relation
dx - its increment
y - base relation
dy - its increment
dz - increment of join view

x ^ R00 = dx ^ R00 & % x and dx have the same headers
y ^ R00 = dy ^ R00 & % y and dy have the same headers
x ^ R00 = y ^ R00 & % x and y have the same headers
x ^ R00 = dz ^ R00 & % x and dz have the same headers
(dz ^ (x ^ y)) v R00 = R00 & % dz disjoint with x ^ y
(x v dx) ^ (x v dy) = (x ^ y) v dz % application of increments on
the base relations
% is the same as increment on
join view
-> x v dx = x v dz.

QBQL output:
*** False Assertion ***
dx = {<x=1,>,<x=2,>,}
dy = {<x=1,>,}
dz = {}
y = {<x=1,>,}
x = {<x=1,>,}

Generally, I'm not sure if this focus on a single join view update
makes any sense. I understand D&D motivation behind it, but their
approach is different. They are trying to establish a set of (ad-hock)
view update rules for each and every basic RA operation. Then, view
update of any complex view would be just a composition of basic rules.
However, the futility of this idea is obvious from algebraic point of
view. Unconditional view updates of basic RA operations are impossible
(for example projection loses information). As soon as they started
making premises, they lost me because it doesn't look like their
method is anything more than case analysis that have any chances to be
scaled up to practical problems.

Speaking of practice, here is an example of nontrivial database schema
reorganization:

TABLE contact (
id NUMBER,
voice VARCHAR2(10),
fax VARCHAR2(10)
);

might require additional cellular column. Instead of growing the
table, however, it is better to reorganize it like this:

CREATE TABLE newcontact (
id NUMBER,
phonetype VARCHAR2(5),
number VARCHAR2(10)
);

Each record in the old contact table

ID VOICE FAX
----------------------------------
1 4150000000 4081111111
2 80012345672 6501234567

is equivalent to 2 records in the newcontact table

ID PHONETYPE NUMBER
---------------------------------
1 VOICE 4150000000
1 FAX 4081111111
2 VOICE 8001234567
2 FAX 6501234567

The view is updatable, but I fail to see how this can be established
within D&D framework.
 >> Stay informed about: A different definition of MINUS, Part 3 
Back to top
Login to vote
paul c

External


Since: Aug 15, 2007
Posts: 659



(Msg. 11) Posted: Fri Dec 19, 2008 11:16 am
Post subject: Re: A different definition of MINUS, Part 3 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

wrote:
> On Dec 19, 6:47 am, paul c wrote:
>> Would you like try to your hand on the case where A and B have equal
>> headings and extensions to see if you get what I get?
>
> I'm not sure what you mean by "extension". Wouldn't two relations x
> and y such that their headings and content equals be the same
> relation?
> ...

I meant values like this:
A:
x y
1 2

B:
1 2
1 3

In my equations so far, A <AND> B for these values is the only
non-determinate conclusion the A-algebra comes to (using my adjusted
MINUS definition). Note that if B has only the 'tuple' (1, 2) I believe
the result is determinate, ie. fine. (Strange as it may sound, I find
both results re-assuring, even though I would not have predicted that
last week!)

Thanks for your work-up, will try to understand as a cross-check of what
I'm seeing. Am starting to see McGoveran's point, but if I've got it
right, I think there is a better solution. Noe I'm thinking that the
problem doesn't start with update, it starts with JOIN.
 >> Stay informed about: A different definition of MINUS, Part 3 
Back to top
Login to vote
Cimode

External


Since: Feb 07, 2008
Posts: 126



(Msg. 12) Posted: Fri Dec 19, 2008 11:25 am
Post subject: Re: A different definition of MINUS, Part 3 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

[Snipped example]
<<As soon as they started
making premises, they lost me because it doesn't look like their
method is anything more than case analysis that have any chances to
be
scaled up to practical problems. >>
Precisely. I would go further as to say that hoping that using solely
algebra would be sufficient to achieve such resultis nothing more than
the holy graal of RL. As you mentionned in an earlier post, the
example of lack of quantifiersi is one major obstacle most current
DandD work seem to ignore without consequence or awareness of the
price to pay.

Regards.. .
 >> Stay informed about: A different definition of MINUS, Part 3 
Back to top
Login to vote
Cimode

External


Since: Feb 07, 2008
Posts: 126



(Msg. 13) Posted: Fri Dec 19, 2008 11:26 am
Post subject: Re: A different definition of MINUS, Part 3 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 19 déc, 19:16, paul c wrote:
 Noe I'm thinking that the
> problem doesn't start with update, it starts with JOIN.
Yep. Just starts.
 >> Stay informed about: A different definition of MINUS, Part 3 
Back to top
Login to vote
paul c

External


Since: Aug 15, 2007
Posts: 659



(Msg. 14) Posted: Fri Dec 19, 2008 11:37 am
Post subject: Re: A different definition of MINUS, Part 3 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Cimode wrote:
> [Snipped example]
> <<As soon as they started
> making premises, they lost me because it doesn't look like their
> method is anything more than case analysis that have any chances to
> be
> scaled up to practical problems. >>
> Precisely. I would go further as to say that hoping that using solely
> algebra would be sufficient to achieve such resultis nothing more than
> the holy graal of RL. As you mentionned in an earlier post, the
> example of lack of quantifiersi is one major obstacle most current
> DandD work seem to ignore without consequence or awareness of the
> price to pay.
>
> Regards.. .

I think around 1972 Codd wrote a proof that the algebra was logically
equivalent to FOPC, later others (I forget their names) corrected a few
errors and proved the equivalence. This is why I'm happy to try to show
things with the algebra, even though it can be tedious trying to see the
forest for the trees.
 >> Stay informed about: A different definition of MINUS, Part 3 
Back to top
Login to vote
Cimode

External


Since: Feb 07, 2008
Posts: 126



(Msg. 15) Posted: Fri Dec 19, 2008 11:48 am
Post subject: Re: A different definition of MINUS, Part 3 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 19 déc, 19:37, paul c wrote:
> Cimode wrote:
> > [Snipped example]
> > <<As soon as they started
> > making premises, they lost me because it doesn't look like their
> > method is anything more than case analysis that have any chances to
> > be
> > scaled up to practical problems. >>
> > Precisely.  I would go further as to say that hoping that using solely
> > algebra would be sufficient to achieve such resultis nothing more than
> > the holy graal of RL.  As you mentionned in an earlier post, the
> > example of lack of quantifiersi is one major obstacle most current
> > DandD work seem to ignore without consequence or awareness of the
> > price to pay.
>
> > Regards.. .
>
> I think around 1972 Codd wrote a proof that the algebra was logically
> equivalent to FOPC, later others (I forget their names) corrected a few
> errors and proved the equivalence.  This is why I'm happy to try to show
> things with the algebra, even though it can be tedious trying to see the
> forest for the trees.

To my knowledge, Codd never mentionned that FOPC would be sufficient
to clarify RL. Choosing to work *solely* on that angle is a matter of
personal choice.

Regards...
 >> Stay informed about: A different definition of MINUS, Part 3 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Thinking about MINUS - The discussion over in "Curious SQL question" started me thinking (after I got over my embarassment at posting a wrong solution). Suppose you started with these two primitive concepts: A universal set, called U (whatever that is) and MIN...

Relation Definition - I'll try this another way (persistence is my middle name?). I use a precise definition of "relation" from mathematics. It is in the glossary mAsterdam collected that I sent out a few days ago. However, it seems that most folks here use so...

Towards a definition of atomic - AFAIK the conventional wisdom is that no absolute definition of atomic exists for domain types. Throwing caution to the wind, in this post I wish to conjecture a definition of atomic that, perhaps with some more effort at its formalisation, can provide....

which part of IM is this ? - sorry to bug you but... if i want to define a datum in terms of who owns what, what branch of IM is it ? (yes i know it's not a computer-bound thing) f'rinstance SSN... a SSN is a conduit between the govt and a unique citizen (who's decided to join....

Problem with Nested Sets - Hello, I have a table which represents a tree of forums using nested sets. Here are the fields: id, root_id, left, right, level, label. I have a string which is like a path. For example, Forum/Sub-forum/Sub-sub-forum I want to get the id of the forum..
   Database Help (Home) -> Technology and Theory All times are: Pacific Time (US & Canada)
Goto page 1, 2, 3, 4, 5, 6
Page 1 of 6

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]