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

Date and McGoveran comments on view updating 'problem'

 
Goto page 1, 2, 3
   Database Help (Home) -> Technology and Theory RSS
Next:  Reset Navigation Pane  
Author Message
paul c

External


Since: Aug 15, 2007
Posts: 659



(Msg. 1) Posted: Mon Dec 08, 2008 3:25 pm
Post subject: Date and McGoveran comments on view updating 'problem'
Archived from groups: comp>databases>theory (more info?)

A few years ago, the dbdebunk.com site had an exchange at:

http://www.dbdebunk.com/page/page/1396086.htm

which I found very interesting. I haven't seen that exchange mentioned
much here but I think it is likely very important. The three
"possibilities" Date mentions for his chosen example seem wrong to me,
but McGoveran's comments intrigued me more.

The example Date gives is:

DELETE SSP WHERE S# = S#('S1') AND P# = P#('P1') ;

To avoid irrelevant nuances from the SQL world that this syntax might
suggest, I find it clearer to cast the statement more algebraically as:

SSP' = SSP MINUS D

where SSP' stands for the result and D stands for the relation, whatever
it is, that we can deduce from the WHERE clause and MINUS is equivalent
to <AND> in the formal definitions that Date and Darwen use in TTM
(making this MINUS not so restrictive as their definition of MINUS).

If the closure that McGoveran mentions is possible, then we would expect
the same SSP' result value no matter whether SSP', SSP or D are views or
base relations, ie., any of the following combinations:

SSP' SSP D
1 base base base
2 base base view
3 base view base
4 base view view
5 view base base
6 view base view
7 view view base
8 view view view

(I think this is an example of what Codd called logical data
independence, it is like how in ordinary arithmetic we can express a
square in many different ways, eg. 18**2 = 324 = 18 * 18 = (17 * 17) +
17 + 18, etc.)

Some people might say that it's patent that D is not a base relation,
because Date's statement as written doesn't name it, but it seems to me
that logical independence requires that we must consider the possibility
that it could be base if suitable syntax were used. To put it another
way, inferring that D is a view is reading more into the statement than
what is stated.

Regardless of whether D is a view or base, from what the original syntax
states, it would seem that D contains only one tuple, if it contained
more than one presumably the statement ought to indicate that somehow.
If D is a join view, one might think that its base relation or relations
could contain tuples no projections of which appear in the join. If
that's so, then I think it's clear that the author of the statement must
be intending that multiple relations are to be 'deleted', which seems to
deny closure, at least closure that entails a single resulting relation.
So it seems to me that if the statement is considered to be 'legal' we
must take it as given that D is a single relation.

If D is base and since it has only one tuple, it must be possible to
rewrite D as:

D = A JOIN B

Date lays his comment out by talking of one-to-many relationships but
I'd rather wonder how many tuples or rows could A and B have? On the
face of it, each could have more than one. But the original statement
doesn't suggest that at all. The tendency to see things in syntax that
aren't there seems endemic. I think McGoveran was indicating that in his
various points, ie. as far as a symbol manipulating program is
concerned, A and B can each have only one tuple/row, otherwise the dbms
must expect the statement to state to the contrary. We can't say
whether A and B have the same attributes or 'heading', but we do know
(since SSP is a running example of Date's) that {S#, P#} is a key of
SSP. Like all constraints, it must be applied by the dbms before giving
results. We know from Heath's Theorem ( see the first question at
http://www.bridgeport.edu/sed/fcourses/cs450/Assignments/Selected_Prob...s_From_)
that D must be equal to any of its projections that include {S#, P#} so
if A and B include the S# and P# attributes, they must have only one row
each, otherwise D would have more than one tuple/row. If they don't
include both S# and P#, A or B might have more than one row, but if so,
that isn't evident in the original DELETE statement so I would say we
should not admit that possibility to the problem. Let's assume from
here on that A = D{attributes of S} and B = D{attributes of SP}.

We could also rewrite D as:

D = A UNION B

In this case, obviously neither A nor B can have more than one row, but
one of them could have none. If one of them has no rows, then either D
= A or D = B, which in this example is no different than saying D = D
and which doesn't change the problem for me.

In the above ways of rewriting D mechanically, the complement of D (eg.,
<NOT> D) has every tuple that could be constructed from the values that
the domains of the attributes allow, in other words, all but one row,
for example the projection of that complement on {S#, P#} will contain
the tuple <S1, P2> (this seems important to me). If we open up the TTM
algebra a bit and don't require a MINUS operator that depends on equal
headings for its operands, we can write SSP MINUS D as SSP <AND>
(<NOT>D). By the algebraic laws we could equally rewrite the original
statement as:

SSP'
= (S <AND> SP) <AND> (<NOT> D)
= (S <AND> SP) <AND> (<NOT> (A <AND> B))
= (S <AND> (<NOT> A)) <AND> (SP <AND> (<NOT> B))

(I've tried to keep this long syntax as simple as possible by omitting
key constraints.)

Now to quote Date from that dbdebunk exchange:

"The rules say: Delete the tuple for S1 from relvar S and delete the
tuple for S1 and P1 from relvar SP. So what happens? There are three
possibilities:

1. If there are no other shipments for supplier S1, the overall
operation succeeds.

2. If there are some other shipments for supplier S1 and no other
updates are done (i.e., there are no side effects), the overall
operation fails on a referential integrity violation.

3. If there are some other shipments for supplier S1 and deleting
supplier S1 from relvar S "cascades" to delete those shipments from
relvar SP, the overall operation fails on a violation of The Assignment
Principle."

Date seems to be starting with the rule and then examining the practical
effects. I would rather start with the (mechanical) algebra, so let me
ignore the rule and see what happens: The first of the three
possibilities goes away because I've thrown the rule away (ie., I'm not
assuming up front that Supplier S1 must be deleted from S). I would
like to throw the second away on the grounds of closure, ie., that if
closure is possible, there are no logical exceptions, only results in
the form of relations (if that's possible, it would be an improvement on
arithmetic where division by zero is an exception but this doesn't
prevent a dbms from raising exceptions for psychological reasons). As
for the third, and as I suggested above, the logical complement of A in
my rewriting will include the tuple <S1, P2, ...>, which means when it
is <AND>'ed with S, Supplier S1 won't be deleted from S, thus no "other
shipments" would be deleted from SP. I don't see that Date's Assignment
Principle is violated at all.

In the exchange, I found McGoveran's comment about 'relative complement'
intriguing. In this example, I'm guessing it means that the rule of
deleting from 'both sides' is wrong, also that characterizing the base
relations to be updated according to entity-relationship terms is not
very useful. Whereas I think an algebraic exposition must embody
whatever concepts are necessary. I would like to be able to prove that
there is no way to mechanically rewrite (by 'mechanically', I mean
without introducing meaning that isn't explicit) the original statement
that gives any other result, but my logical equipment isn't capable or
proving that kind of meta-conclusion one way or another. (All I've done
in this long-winded post is fasten on one particular re-writing.) But
if that could be done, it would give me confidence that updates of joins
and probably unions too is logically possible, not only that, but
logically entailed.

 >> Stay informed about: Date and McGoveran comments on view updating 'problem' 
Back to top
Login to vote
paul c

External


Since: Aug 15, 2007
Posts: 659



(Msg. 2) Posted: Mon Dec 08, 2008 3:25 pm
Post subject: Re: Date and McGoveran comments on view updating 'problem' [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

paul c wrote:
....
> where SSP' stands for the result and D stands for the relation, whatever
> it is, that we can deduce from the WHERE clause and MINUS is equivalent
> to <AND> in the formal definitions that Date and Darwen use in TTM
> (making this MINUS not so restrictive as their definition of MINUS).
> ...

Oops, should have said equivalent to <AND> (<NOT> ...). Also, by "not
so restrictive, I mean that the 'headings' of the operands could be
different.

 >> Stay informed about: Date and McGoveran comments on view updating 'problem' 
Back to top
Login to vote
vadimtro

External


Since: Jul 29, 2008
Posts: 26



(Msg. 3) Posted: Mon Dec 08, 2008 3:25 pm
Post subject: Re: Date and McGoveran comments on view updating 'problem' [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I welcome the fact that you have switched from traditional RA
operators to simpler set (D&Ds "A"lgebra: <AND>, <OR>, and <NOT>).
Next, you seemed to approach view update problem algebraically, but
stopped short of writing actual equations for base relations, views,
their increments, and constraints. Here they are:

The base relations:

S - Suppliers
SP - SuppliedParts

Foreigh key constraint between S and SP is formally written as:

(SP ^ S') v R00 = R00.

where I leveraged standard relational lattice operators: "^" - join,
"v" - generalized union, and R00 empty relation with empty header (aka
D&D TABLE_DUM). Informally, foreign key constraint asserts that
SuppliedParts antijoined with Suppliers produce an empty relation.

Next, lets represent the insertion into the view, which is a join of S
and SP, as a relation D (Delta). Therefore, D has the same header as
SP ^ S, which is formally written as

(SP ^ S) ^ R00 = D ^ R00.

Our final assumption is that we insert new supplier data, therefore D
should have no S# in common with the existing data:

(D ^ (SP v S)) ^ R00 = R00.

These three equations are all our knowlwedge about SP ^ S view
updates. Now we plug them (together with RL axiom system) into
Prover9, and derive

(SP v D) ^ (S v D) = (SP ^ S) v D.

with a single press of a button! Informally, under some very natural
conditions (the 3 assertions that I described early) an increment to
the view SP ^ S can be decomposed into independent increments of the
base relations S and D.
 >> Stay informed about: Date and McGoveran comments on view updating 'problem' 
Back to top
Login to vote
vadimtro

External


Since: Jul 29, 2008
Posts: 26



(Msg. 4) Posted: Mon Dec 08, 2008 4:13 pm
Post subject: Re: Date and McGoveran comments on view updating 'problem' [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Dec 8, 2:59 pm, paul c wrote:
> Thanks.  Although the relational lattice has seemed a fuzzy to me (no
> doubt that's my fault as usually takes me years before I feel confident
> in a mathematical topic), I gather that this example is about "insert"
> to JOIN.  

By "fuzzy" you certainly have meant "too formal"? Because, a
mathematician would certainly label all these view update discussions
and ad-hock rules as "fuzzy". Since you are freely operating within
D&D system of <AND>, <OR>, <NOT> operations, it is not much of
difference to adopt RL; in fact join and negation are the same! The
difference between D&D system and RL is that the authors didn't really
reinforce their algebra with axioms to allow any manipulations.
(Sometime ago I mentioned how these both systems fit together).

As for deletion here is my worksheet. The first two assertions stay
the same:

(SP ^ S') v R00 = R00.
(SP ^ S) ^ R00 = D ^ R00.

Next, we delete one (or several) tuple(s) from S ^ SP, therefore the
delta relation D should be just a subset of the S ^ SP (because we
have already established that S ^ SP and D have the same headers):

D ^ (SP ^ S) = D.

Now, we are proving the following decomposition

(SP v D')^(S v D') = (SP ^ S) v D'.

(in the previous message I forgot to mention that the unary quote
operation is negation).

Again, in Prover9 the deduction is purely mechanical (it took 53 sec
on my machine).

> Just guessing but I gather that RL could be seen as a
> alternative way of understanding RM, maybe more fundamental in some ways
> and maybe has some more useful mechanical theoretical tools, so I wonder
> what happens with "delete" to JOIN (which I believe is the operation
> that many people find controversial)?

We are able to formally deduce that deletion in the base realtion
corresponds to the deletions from the base relations. Therefore, there
is nothing controversial about deletion from join, unless my
assumptions (written formally as equations) are wrong.

> BTW, ever since I first read about it, I've tried to use the TTM algebra
> in my head because the small and tight definitions make it easier to
> check my thoughts by comparing results in terms of relations.  But I
> find most other people tune out when I use them to explain myself.  

Tell me about people tuning out... There are perhaps 5 people in the
world who buy in this RL stuff:-)

> Also BTW, because I didn't think it affected the problem, I wasn't
> assuming any foreign key, but if I did I could express the one involving
> S and SP as: SP{S#} & S{S#} = SP{S#} (where & means <AND>).

Actually, you are right. I removed the foreign key constraint from
assumptions, and it still derives the deletion assertion! (Certainly,
if I remove one of the other two assertions, the Mace4 finds a
counterexample).
 >> Stay informed about: Date and McGoveran comments on view updating 'problem' 
Back to top
Login to vote
vadimtro

External


Since: Jul 29, 2008
Posts: 26



(Msg. 5) Posted: Mon Dec 08, 2008 4:36 pm
Post subject: Re: Date and McGoveran comments on view updating 'problem' [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Dec 8, 3:16 pm, paul c wrote:
> paul c wrote:
> > ... so I wonder
> > what happens with "delete" to JOIN (which I believe is the operation
> > that many people find controversial)?
> > ...
>
> Just as they find "insert" to UNION.  The main argument seems to be that
> the operation is not deterministic when trying to decide on a base table
> by base table basis what to change, ie., there are three combinations of
> base values that could produce the same tuple in a view.  McGoveran
> seemed to be saying that this argument is the wrong one, doesn't take in
> all available information because it manipulates extensions without
> concern as to the implications of the predicates and values involved
> before the insert or delete is tried.

OK, the union view update. Assume the folowing relation

M - Males
F - Femails
D - Delta of M v F

The assertions:
1. M disjunct to F
(M ^ F) ^ R00 = R00.
This may be not necessary, although we'll demonstrate that we won't be
able to derive view update even under this additional assertion.
2. M and F having the same headers
M ^ R00 = F ^ R00.
3. D and F having the same headers
D ^ R00 = F ^ R00.
4. Added tuples (D) are disjoint with F
(D ^ F) ^ R00 = R00.
5. Added tuples are disjoint with M
(D ^ M) ^ R00 = R00.

It *doesn't* follow that we can insert D into M
M v D = (M v F) v D.
This is, again, established by Mace4 finding a two element
counterexample.

> It just seemed to me that if one started with the algebra and could
> somehow gauge all possible expressions as to what their resulting
> relations would be, one might find that McGoveran is right and if not,
> show that the problem is more complicated than he suggested.  It also
> seemed to me that for such an exercise, if one had the right mental
> machinery, one could ignore the practical restrictions that are usually
> followed, such as common headings for union and run-time exceptions that
> some think will confuse dumb users.

IMO D&D ad-hock rules approach for view update problem is futile.
 >> Stay informed about: Date and McGoveran comments on view updating 'problem' 
Back to top
Login to vote
paul c

External


Since: Aug 15, 2007
Posts: 659



(Msg. 6) Posted: Mon Dec 08, 2008 6:25 pm
Post subject: Re: Date and McGoveran comments on view updating 'problem' [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

wrote:
> I welcome the fact that you have switched from traditional RA
> operators to simpler set (D&Ds "A"lgebra: <AND>, <OR>, and <NOT>).
> Next, you seemed to approach view update problem algebraically, but
> stopped short of writing actual equations for base relations, views,
> their increments, and constraints. Here they are:
>
> The base relations:
>
> S - Suppliers
> SP - SuppliedParts
>
> Foreigh key constraint between S and SP is formally written as:
>
> (SP ^ S') v R00 = R00.
>
> where I leveraged standard relational lattice operators: "^" - join,
> "v" - generalized union, and R00 empty relation with empty header (aka
> D&D TABLE_DUM). Informally, foreign key constraint asserts that
> SuppliedParts antijoined with Suppliers produce an empty relation.
>
> Next, lets represent the insertion into the view, which is a join of S
> and SP, as a relation D (Delta). Therefore, D has the same header as
> SP ^ S, which is formally written as
>
> (SP ^ S) ^ R00 = D ^ R00.
>
> Our final assumption is that we insert new supplier data, therefore D
> should have no S# in common with the existing data:
>
> (D ^ (SP v S)) ^ R00 = R00.
>
> These three equations are all our knowlwedge about SP ^ S view
> updates. Now we plug them (together with RL axiom system) into
> Prover9, and derive
>
> (SP v D) ^ (S v D) = (SP ^ S) v D.
>
> with a single press of a button! Informally, under some very natural
> conditions (the 3 assertions that I described early) an increment to
> the view SP ^ S can be decomposed into independent increments of the
> base relations S and D.

Thanks. Although the relational lattice has seemed a fuzzy to me (no
doubt that's my fault as usually takes me years before I feel confident
in a mathematical topic), I gather that this example is about "insert"
to JOIN. Just guessing but I gather that RL could be seen as a
alternative way of understanding RM, maybe more fundamental in some ways
and maybe has some more useful mechanical theoretical tools, so I wonder
what happens with "delete" to JOIN (which I believe is the operation
that many people find controversial)?

BTW, ever since I first read about it, I've tried to use the TTM algebra
in my head because the small and tight definitions make it easier to
check my thoughts by comparing results in terms of relations. But I
find most other people tune out when I use them to explain myself. The
chapter 4 in the original TTM was by itself worth the price of the book
to me because before that I just talked about "uniform sentences" and
had an even harder time trying to explain to people what I meant. It
was also harder to understand myself! I even overload &, | and ^ to save
writing but also to emphasize the parallels with simple logic.
Overloading those operators has never bothered me even though I know
many technocrats don't like it. I don't mind if bakers make bread
instead of baking it or manufacturers make products rather than build them.

Also BTW, because I didn't think it affected the problem, I wasn't
assuming any foreign key, but if I did I could express the one involving
S and SP as: SP{S#} & S{S#} = SP{S#} (where & means <AND>).
 >> Stay informed about: Date and McGoveran comments on view updating 'problem' 
Back to top
Login to vote
paul c

External


Since: Aug 15, 2007
Posts: 659



(Msg. 7) Posted: Mon Dec 08, 2008 6:25 pm
Post subject: Re: Date and McGoveran comments on view updating 'problem' [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

paul c wrote:

> ... so I wonder
> what happens with "delete" to JOIN (which I believe is the operation
> that many people find controversial)?
> ...

Just as they find "insert" to UNION. The main argument seems to be that
the operation is not deterministic when trying to decide on a base table
by base table basis what to change, ie., there are three combinations of
base values that could produce the same tuple in a view. McGoveran
seemed to be saying that this argument is the wrong one, doesn't take in
all available information because it manipulates extensions without
concern as to the implications of the predicates and values involved
before the insert or delete is tried.

It just seemed to me that if one started with the algebra and could
somehow gauge all possible expressions as to what their resulting
relations would be, one might find that McGoveran is right and if not,
show that the problem is more complicated than he suggested. It also
seemed to me that for such an exercise, if one had the right mental
machinery, one could ignore the practical restrictions that are usually
followed, such as common headings for union and run-time exceptions that
some think will confuse dumb users.
 >> Stay informed about: Date and McGoveran comments on view updating 'problem' 
Back to top
Login to vote
paul c

External


Since: Aug 15, 2007
Posts: 659



(Msg. 8) Posted: Tue Dec 09, 2008 12:25 pm
Post subject: Re: Date and McGoveran comments on view updating 'problem' [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

wrote:
> On Dec 8, 2:59 pm, paul c wrote:
>> Thanks. Although the relational lattice has seemed a fuzzy to me (no
>> doubt that's my fault as usually takes me years before I feel confident
>> in a mathematical topic), I gather that this example is about "insert"
>> to JOIN.
>
> By "fuzzy" you certainly have meant "too formal"? ...

Oh no, I didn't mean RL is fuzzy, rather my understanding is fuzzy. I'd
say the more formal the definitions, the better, except that the more
numerous and detailed the concepts are, the harder they are for somebody
like me who thinks math is important and fundamental but is relatively
inexperienced in math logic. I gather that lattices are a way to
encompass various algebras, not just D&D's, but in general I don't have
the experience to make very many useful comments about RL.

Because, a
> mathematician would certainly label all these view update discussions
> and ad-hock rules as "fuzzy".

Not being a mathematician, I can't argue with that, but at least until I
can make more sense of view updating I'd perhaps agree that Date's rules
might be a solution that over-simplifies the problem. I didn't find
what McGoveran said to be fuzzy, eg., literally incoherent. Even if I
don't yet see all the implications of McGoveran's points, they didn't
strike me as adhoc, even if this sounds like talking out of both sides
of my mouth. (I say Date, not D&D, because I gather Darwen also has
objections to Date's rules.)

Since you are freely operating within
> D&D system of <AND>, <OR>, <NOT> operations, it is not much of
> difference to adopt RL; in fact join and negation are the same! The
> difference between D&D system and RL is that the authors didn't really
> reinforce their algebra with axioms to allow any manipulations.
....

I thought they didn't need to do that (because Frege, Russel, Codd and
many others had already done that work)! Maybe we are at cross-purposes
and you are talking about manipulations that D&D don't admit.

> (Sometime ago I mentioned how these both systems fit together).
> ...

Regarding join and negation being the same in RL & D&D, I vaguely
remember being intrigued by the lattice union when you (I think) brought
it up here more than a year ago and then sometime later you (I think)
changed the definition from one that resembled projection from multiple
operands to one that retained the attributes in the operands.

From my (incomplete) reading of D&D, I'd say D&D downplay their <OR>,
mentioning it mainly only in the contexts of inserting to a base and
defining so-called "union-compatible" views. In their definition, it is
a mere one-word change in the D&D formal definition to make <OR> similar
to or even the same as what I thought the RL union was, but it seemed to
me that doing so would disturb the parallel between their operators and
the 16 dyadic boolean operators, which would undermine the rest of their
foundation, eg, using de Morgan's laws to deal with the
closed-world-assumption. That to me is a big thing to give up.

I'm not sure what the current RL meaning for union is, but discarding
the traditional <OR> interpretation/connection also drops something I
think they don't mention much (I'm not sure if they mention it at all),
the usefulness of material implication for constraints, such as "Part P3
must be Red". In D&D's algebra, this can be defined as a relation
expression with a form something like (<NOT> condition) <OR> (value)
where condition looks something like <P# 'P3'> and value something like
<COLOUR 'Red'>. Logically, that can be <AND>'ed with any result of
their algebra. I take it this is all courtesy of the heritage they
built on. I'm not saying RL can't do similar (I don't know enough to
know how) and I'm not saying that an implementation shouldn't have
shortcuts or optimizations, I'm just saying that the D&D <OR> is needed
for this ability (if Codd's closure is assumed). When it comes to
mathematical philosophy, I'm in a bit over over my head but I believe
that kind of ability amounts to the effect of treating data design as a
way of proving a theorem.

(Another maybe unrelated comment I have about the D&D <OR> is that I
sometimes wonder if it is overloaded in a way that is different from the
usual programming meaning of 'overloaded'. The usual meaning is that
the same operator is applied to different kinds of things. But D&D
define "INSERT" through UNION and UNION through <OR> at the same time as
they allow a view to involve <OR>. They are careful to always require
the <OR>'ed operands to have same headings, so perhaps they aren't
overloading in the sense I mean. Still it is a subtlety that sometimes
trips me up when trying to write predicates down - I can't escape
feeling that <OR> here is applied to the same things (relations) in
different ways, one way for insert to a base and another when looking at
a union view - that's what I mean by overloading. Maybe the answer is
to simply think of the D&D algebra being used in different ways at
different times, eg., 'user' language versus definition language, but it
still makes me wonder if McGoveran was right when he said that users
might have to distinguish between views and bases.)
 >> Stay informed about: Date and McGoveran comments on view updating 'problem' 
Back to top
Login to vote
paul c

External


Since: Aug 15, 2007
Posts: 659



(Msg. 9) Posted: Tue Dec 09, 2008 2:26 pm
Post subject: Re: Date and McGoveran comments on view updating 'problem' [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

wrote:
....
> As for deletion here is my worksheet. The first two assertions stay
> the same:
>
> (SP ^ S') v R00 = R00.
> (SP ^ S) ^ R00 = D ^ R00.
> ...

Thanks. (I'm not ignoring this, but can't reply until I refresh my
memory about RL and see if I can adapt my version of the problem to it.
I'm assuming that the papers at arxiv reflect the present version of RL.)
 >> Stay informed about: Date and McGoveran comments on view updating 'problem' 
Back to top
Login to vote
JOG

External


Since: Jan 17, 2008
Posts: 164



(Msg. 10) Posted: Wed Dec 10, 2008 5:25 pm
Post subject: Re: Date and McGoveran comments on view updating 'problem' [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Dec 8, 9:32 pm, wrote:
> I welcome the fact that you have switched from traditional RA
> operators to simpler set (D&Ds "A"lgebra: <AND>, <OR>, and <NOT>).
> Next, you seemed to approach view update problem algebraically, but
> stopped short of writing actual equations for base relations, views,
> their increments, and constraints. Here they are:
>
> The base relations:
>
> S - Suppliers
> SP - SuppliedParts
>
> Foreigh key constraint between S and SP is formally written as:
>
> (SP ^ S') v R00 = R00.
>
> where I leveraged standard relational lattice operators: "^" - join,
> "v" - generalized union, and R00 empty relation with empty header (aka
> D&D TABLE_DUM). Informally, foreign key constraint asserts that
> SuppliedParts antijoined with Suppliers produce an empty relation.
>
> Next, lets represent the insertion into the view, which is a join of S
> and SP, as a relation D (Delta). Therefore, D has the same header as
> SP ^ S, which is formally written as
>
> (SP ^ S) ^ R00 = D ^ R00.
>
> Our final assumption is that we insert new supplier data, therefore D
> should have no S# in common with the existing data:
>
> (D ^ (SP v S)) ^ R00 = R00.

Hi Vadim, this seems like an elegant approach but was hoping a quick
clarification concerning generalized union before I committed more
time to it. In your example would I be correct in thinking that: SP v
S = S

and hence your last statement above decomposes to:
(D ^ S) ^ R00 = R00

If so that would mean that tuples in D must feature a previously
unsees S# right? This confused me given the key to (SP ^ S) is {S#,
P#} not {S#} (or it rather made me think I had perhaps missed
something along the line). Thanks in advance for any clarification you
can offer, Jim.

>
> These three equations are all our knowlwedge about SP ^ S view
> updates. Now we plug them (together with RL axiom system) into
> Prover9, and derive
>
> (SP v D) ^ (S v D) = (SP ^ S) v D.
>
> with a single press of a button! Informally, under some very natural
> conditions (the 3 assertions that I described early) an increment to
> the view SP ^ S can be decomposed into independent increments of the
> base relations S and D.
 >> Stay informed about: Date and McGoveran comments on view updating 'problem' 
Back to top
Login to vote
paul c

External


Since: Aug 15, 2007
Posts: 659



(Msg. 11) Posted: Thu Dec 11, 2008 9:26 am
Post subject: Re: Date and McGoveran comments on view updating 'problem' [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

JOG wrote:
> On Dec 8, 9:32 pm, wrote:
>> I welcome the fact that you have switched from traditional RA
>> operators to simpler set (D&Ds "A"lgebra: <AND>, <OR>, and <NOT>).
>> Next, you seemed to approach view update problem algebraically, but
>> stopped short of writing actual equations for base relations, views,
>> their increments, and constraints. Here they are:
>>
>> The base relations:
>>
>> S - Suppliers
>> SP - SuppliedParts
>>
>> Foreigh key constraint between S and SP is formally written as:
>>
>> (SP ^ S') v R00 = R00.
>>
>> where I leveraged standard relational lattice operators: "^" - join,
>> "v" - generalized union, and R00 empty relation with empty header (aka
>> D&D TABLE_DUM). Informally, foreign key constraint asserts that
>> SuppliedParts antijoined with Suppliers produce an empty relation.
>>
>> Next, lets represent the insertion into the view, which is a join of S
>> and SP, as a relation D (Delta). Therefore, D has the same header as
>> SP ^ S, which is formally written as
>>
>> (SP ^ S) ^ R00 = D ^ R00.
>>
>> Our final assumption is that we insert new supplier data, therefore D
>> should have no S# in common with the existing data:
>>
>> (D ^ (SP v S)) ^ R00 = R00.
>
> Hi Vadim, this seems like an elegant approach but was hoping a quick
> clarification concerning generalized union before I committed more
> time to it. In your example would I be correct in thinking that: SP v
> S = S
>
> and hence your last statement above decomposes to:
> (D ^ S) ^ R00 = R00
>
> If so that would mean that tuples in D must feature a previously
> unsees S# right? This confused me given the key to (SP ^ S) is {S#,
> P#} not {S#} (or it rather made me think I had perhaps missed
> something along the line). Thanks in advance for any clarification you
> can offer, Jim.
>
>> These three equations are all our knowlwedge about SP ^ S view
>> updates. Now we plug them (together with RL axiom system) into
>> Prover9, and derive
>>
>> (SP v D) ^ (S v D) = (SP ^ S) v D.
>>
>> with a single press of a button! Informally, under some very natural
>> conditions (the 3 assertions that I described early) an increment to
>> the view SP ^ S can be decomposed into independent increments of the
>> base relations S and D.
>

I hope Vadim will answer these questions.

In the meantime, I'd like to point out that based on

http://arxiv.org/pdf/0807.3795,

SP v S = S can't be true given the usual attributes Date ascribes to SP
and S, for example Supplier_Name or somesuch is in S but not in SP. I
think it could be true for SP{S#, P#} V S{S#} = S{S#} with a further
proviso that S# is a foreign key. Vadim, can you cover this point in
your answer to JOG?


Apart from the above, I'd also like to say that as far as my original
question is concerned, I don't think key constraints need to be presumed
in order to examine the algebraic possibilities. First, while it may
well be that the dbms catalog reflects key constraints, Date's example
is a "delete", so as long as it involves applying only <AND> <NOT> to S
or SP, no new tuples that didn't satisfy the key constraint could be
introduced. Foreign key constraints could be important if certain S
tuples end up being deleted (this may contradict what I said in a
previous post). Second, the TTM A-algebra includes no notion of a
proper subset of attributes being "key" (or foreign "key" for that
matter), only the notion of all attribute values in a tuple standing for
a unique tuple within a relation. So it seems to me that any Prover9
demonstration ought to have a main example that ignores key constraints,
not to say that couldn't be buttressed with examples that include keys.


Another question I have is whether anybody here knows whether Prover9
depends on a lattice formulation, or could it be applied using the TTM
A-algebra instead?
 >> Stay informed about: Date and McGoveran comments on view updating 'problem' 
Back to top
Login to vote
vadimtro

External


Since: Jul 29, 2008
Posts: 26



(Msg. 12) Posted: Thu Dec 11, 2008 10:51 am
Post subject: Re: Date and McGoveran comments on view updating 'problem' [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Dec 10, 5:25 pm, JOG wrote:
> On Dec 8, 9:32 pm, wrote:
>
>
>
> > I welcome the fact that you have switched from traditional RA
> > operators to simpler set (D&Ds "A"lgebra: <AND>, <OR>, and <NOT>).
> > Next, you seemed to approach view update problem algebraically, but
> > stopped short of writing actual equations for base relations, views,
> > their increments, and constraints. Here they are:
>
> > The base relations:
>
> > S - Suppliers
> > SP - SuppliedParts
>
> > Foreigh key constraint between S and SP is formally written as:
>
> > (SP ^ S') v R00 = R00.
>
> > where I leveraged standard relational lattice operators: "^" - join,
> > "v" - generalized union, and R00 empty relation with empty header (aka
> > D&D TABLE_DUM). Informally, foreign key constraint asserts that
> > SuppliedParts antijoined with Suppliers produce an empty relation.
>
> > Next, lets represent the insertion into the view, which is a join of S
> > and SP, as a relation D (Delta). Therefore, D has the same header as
> > SP ^ S, which is formally written as
>
> > (SP ^ S) ^ R00 = D ^ R00.
>
> > Our final assumption is that we insert new supplier data, therefore D
> > should have no S# in common with the existing data:
>
> > (D ^ (SP v S)) ^ R00 = R00.
>
> Hi Vadim, this seems like an elegant approach but was hoping a quick
> clarification concerning generalized union before I committed more
> time to it. In your example would I be correct in thinking that: SP v
> S = S
>
> and hence your last statement above decomposes to:
> (D ^ S) ^ R00 = R00
>
> If so that would mean that tuples in D must feature a previously
> unsees S# right? This confused me given the key to (SP ^ S) is {S#,
> P#} not {S#}  (or it rather made me think I had perhaps missed
> something along the line). Thanks in advance for any clarification you
> can offer, Jim.

You are correct, I made a typo. The assertion
(D ^ (SP v S)) ^ R00 = R00.
collapsed D to a nullary relation so the case becomes vacuous.

Let be more careful. We have:
1. (SP ^ S) ^ R00 = D ^ R00
"D and SP ^ S have the same header"
2. (D ^ (SP ^ S)) v R00 = R00
"D is addition of tuples to SP ^ S, therefore D is disjoint with SP ^
S "
We want to derive that insertion into SP ^ S is equivalent to
inserting projections of D into base relations S and SP. Formally:
(SP v D)^(S v D) = (SP ^ S) v D.

Let's rename the variables as follows
SP -> x
S -> y
D -> z
and write what we want to prove as conditional assertion:

(x ^ y) ^ R00 = z ^ R00 &
(z ^ (x ^ y)) ^ R00 = R00
-> (x v z) ^ (y v z) = (x ^ y) v z.

Here as usual the "&" is Prover9 logical conjunction and the "->" is
implication. It looks very similar to distributivity of union over
join at page 5 of http://arxiv.org/ftp/arxiv/papers/0807/0807.3795.pdf!

Not surprisingly, it can be proved with the following assumptions:
x ^ y = y ^ x.
(x ^ y) ^ z = x ^ (y ^ z).
x ^ (x v y) = x.
x v y = y v x.
(x v y) v z = x v (y v z).
x v (x ^ y) = x.
(R00 ^ (x v y) = R00 ^ (x v z)) -> (x ^ (y v z) = (x ^ y) v (x ^ z)).
where the first 6 are the standard lattice axioms, and the last one is
the familiar SDC.
 >> Stay informed about: Date and McGoveran comments on view updating 'problem' 
Back to top
Login to vote
vadimtro

External


Since: Jul 29, 2008
Posts: 26



(Msg. 13) Posted: Thu Dec 11, 2008 11:11 am
Post subject: Re: Date and McGoveran comments on view updating 'problem' [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Dec 11, 5:37 am, paul c wrote:
> Another question I have is whether anybody here knows whether Prover9
> depends on a lattice formulation, or could it be applied using the TTM
> A-algebra instead?

Prover9 is a general purpose theorem prover, so it can accommodate any
algebra. It has it's own limitations, of course. As the number of
operations&axioms grows up, you'll be quickly frustrated with Prover9
(or any other automatic tool for that matter) inability to deduce
useful properties. This is why keeping algebra simple is paramount.

Regarding algebraic version of TTM aka "A"lgebra, you'll have to
overcome technical difficulty of projection being not really pure
algebraic operation. FWIW, the posting
http://groups.google.com/group/comp.databases.theory/browse_thread/thr.../de5c7c
describes how D&D "A"lgebra fits into a "bi-lattice" system of one
unary operation, 4 binary operations, and 4 constants. The symmetry of
this system is skewed in a peculiar way, but it remains to be seen if
the inclusion of the "*" and "+" adds any more power compared to RL
described in
http://arxiv.org/ftp/arxiv/papers/0807/0807.3795.pdf
 >> Stay informed about: Date and McGoveran comments on view updating 'problem' 
Back to top
Login to vote
vadimtro

External


Since: Jul 29, 2008
Posts: 26



(Msg. 14) Posted: Thu Dec 11, 2008 11:31 am
Post subject: Re: Date and McGoveran comments on view updating 'problem' [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Dec 11, 5:37 am, paul c wrote:
> In the meantime, I'd like to point out that based on
>
> http://arxiv.org/pdf/0807.3795,
>
> SP v S = S can't be true given the usual attributes Date ascribes to SP
> and S, for example Supplier_Name or somesuch is in S but not in SP.  I
> think it could be true for SP{S#, P#} V S{S#} = S{S#} with a further
> proviso that S# is a foreign key.

Correct, there is no restriction onto S and SP whatsoever. There are
two natural conditions on delta relation D, however. It should have
the same header as join of S and SP, and be disjoint with the S ^ SP
view.
 >> Stay informed about: Date and McGoveran comments on view updating 'problem' 
Back to top
Login to vote
vadimtro

External


Since: Jul 29, 2008
Posts: 26



(Msg. 15) Posted: Thu Dec 11, 2008 1:28 pm
Post subject: Re: Date and McGoveran comments on view updating 'problem' [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Dec 8, 4:13 pm, wrote:
> As for deletion here is my worksheet
.....
> Now, we are proving the following decomposition
>
> (SP v D')^(S v D') = (SP ^ S) v D'.

This assertion is wrong. If D is the set of tuples that we delete from
SP ^ S, then the condition is:

(SP ^ (D' v (SP ^ R00))) ^ (S ^ (D' v (S ^ R00))) = (SP ^ S) ^ D'

Informally, on the right side we have a relation which is the result
of deleting D tuples from SP ^ S. On the left side is a relation that
is a join of two base relations SP and S, each trimmed with some
projection of D.

I fail to derive it with any assumptions, except the obvious, like
demanding that D acted only on SP (or S). Therefore, there might be
some truth to people questioning the validity of deletion from join
view...
 >> Stay informed about: Date and McGoveran comments on view updating 'problem' 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
View challenge - I have a number of tables as below: employee(*employeeid, ....) schedule(*scheduleid, recur_interval, ...) emp_schedule(*employeeid, *scheduleid, *valid_from, valid_to) workshift(*scheduleid, *shiftid, starttime, endtime) recur_interval indicates the..

Another motivational example for inverse view - Consider table PolarCoordinates ( theta real, R real, ) with constraints R>0, 0<=theta<pi view CartesianCoordinates select R*cos(theta) AS x, R*sin(theta) AS y from PolarCoordinates This view is clearly updateable, all we ne...

Principal of view equality? - I was just looking at Codd's RM 2 book again (the rather short chapter on views from acm.org) and it seemed to me that what he wrote took it as essential that a view must always equal the expression that defines the view. If so, does this in effect..

is pivoted phones view updateable? - Tchuzhie Giri wrote: > It is not "OK" so long as one does not have your rules of updatability. > You put a pile of symbols on the pile of symbols: it does not have > sense without the rules. Please provide the rules, simple examples...

Avoiding an inline view using DML only - Hi. A user enters a date range (ie. 2 dates, '2008-04-01' and '2008-04-03'), the problem is to determine how many open events exist on each day in this interval. Assume that the "events" table has a "start_date" and an "end_dat...
   Database Help (Home) -> Technology and Theory All times are: Pacific Time (US & Canada)
Goto page 1, 2, 3
Page 1 of 3

 
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 ]