Re: Principle of Orthogonal Design(B

From: David BL(B <davidbl_at_iinet.net.au>
Date: Thu, 7 Feb 2008 03:46:22 -0800 (PST)
Message-ID: <3c684a2b-92e3-4bb2-99a6-5e1831715977_at_h11g2000prf.googlegroups.com>


On Feb 7, 6:44 pm, JOG <j..._at_cs.nott.ac.uk> wrote:
> On Feb 7, 1:13 am, David BL <davi..._at_iinet.net.au> wrote:
>
>
>
>
>
> > On Feb 7, 2:45 am, Marshall <marshall.spi..._at_gmail.com> wrote:
>
> > > On Feb 5, 1:54 pm, Jan Hidders <hidd..._at_gmail.com> wrote:
> > > > On 5 feb, 22:06, Marshall <marshall.spi..._at_gmail.com> wrote:
>
> > > > > However, suppose we have a binary predicate P over
> > > > > domain X and we want to assert it is reflexive? In predicate
> > > > > logic we can use the same name twice and express this
> > > > > very conveniently:
>
> > > > > Ax in X: P(x,x)
>
> > > > > How would we do this if P's attributes were already bound
> > > > > to the names "x" and "y"?
>
> > > > Roughly the same, except you indicate the role in the predicate with
> > > > the attribute names. So assume that attribute names are 'a' and 'b':
>
> > > > Ax in X: P(a=x,b=x)
>
> > > I see. Okay, this is a very small change indeed. Basically we
> > > are just specifying attributes using the same syntax as is
> > > used in named-argument function invocation, in languages
> > > that support that feature. This still relies on using the
> > > quantifiers to introduce new names. And the attribute
> > > names of different relations are always insulated from
> > > each other: a relation may be in the scope of a quantifier,
> > > but it is never in the scope of another relation.
>
> > > This seems like it will work as a logical language (where
> > > the results are always boolean) but I don't see how it
> > > could work in a query language, because it doesn't
> > > specify/unify the attribute names of the result relation.
>
> > > An example:
>
> > > Suppose we have
> > > P(a, b)
> > > Q(a, b)
> > > as subsets of X*X
>
> > > and we want to join P and Q on P.b = Q.a.
>
> > > Ax in X: Ey in X: Ez in X: P(a=y, b=x) & Q(a=x, b=z)
>
> > > I guess I should go read about the tuple relational calculus
> > > and see what it does...
>
> > It seems to me that a role name is tied to a complete sentence that a
> > variable appears in. In the following example
>
> > parent(P,C) :- P is the parent of child C.
>
> > P has the role of "parent", and C has the role of "child".
>
> > Now consider
>
> > grandparent(GP,GC) :- parent(GP,P), parent(P,GC).
>
> In terms of Marshall's example of a join I see the above as saying:
> $B"P(Bx parent(p:a,c:x) $B"J(B parent(p:x,c:b) $B"N(B grandparent(gp:a,gc:b)

A minor comment: when I see '$B"N(B' I assume it means all apparently free variables are in fact bound and are implicitly universally quantified. Therefore your existential quantifier seems redundant to me.

Also note that

   ($B"P(Bx p(x)) $B"*(B q

$B"N(B ~($B"P(Bx p(x)) $B"K(B  q
$B"N(B ($B"O(Bx ~p(x)) $B"K(B q
$B"N(B $B"O(Bx (~p(x) $B"K(B q)
$B"N(B $B"O(Bx (p(x) $B"*(B q)

so I'd be careful not to inadvertently create confusion with the scope of that existential quantifier. I guess it's customary for $B"N(B to have a lower precedence?

> But even better, if we use the set enumerations of the predicates, we
> can state the result of a join using standard set builder notation:
> Grandparents = { {gp:a, gc:b} | {p:a, c:x}, {p:x, c:b} $B":(B Parents }
>
> Mmmm, set notation = tasty goodness.
>
>
>
> > Within the conjunctive query on the rhs, there are three distinct
> > roles: grandparent GP, parent P and grandchild GC.
>
> > In the syntax
>
> > P(a=y, b=x) & Q(a=x, b=z)
>
> > I don't see any reason why we can't think of 'x', 'y' and 'z' as the
> > three role names in the result relation.
>
> I'm unclear what you mean here - x,y and z are values no?

I would say they are free variables that have not yet bound to any value.

http://en.wikipedia.org/wiki/Free_variable

I was thinking that predicate P implicitly has two free variables named a,b and in the expression P(a=y, b=x), those implicit a,b have been bound (in this case to free variables named x,y).

I would think P(a=y) could be interpreted as a predicate with free variables named y and b. ie there is the option of only renaming a subset of the implicit free variables.

Furthermore the syntax could support binding or renaming of free variables in arbitrary expressions. Eg

    (P(a=y, b=x) & Q(a=x, b=z)) (x=w)

has free variables w,y,z. Received on Thu Feb 07 2008 - 12:46:22 CET

Original text of this message