Re: Can relvars be dissymetrically decomposed? (vadim and x insight demanded on that subject)
Date: 19 Jul 2006 12:50:14 -0700
Message-ID: <1153338614.251208.130340_at_h48g2000cwc.googlegroups.com>
Cimode wrote:
> erk wrote:
> > An "evaluation of a specific relation" means that you must be
> > evaluating an expression. Perhaps you mean "dereferencing", which would
> > return the value referenced by a variable?
> No. I mean a relation can be evaluated just as a function can be
> evaluated mathematically speaking.
> When a relvar hold a specific
> relvalue in time, then and only the such evaluation represents an
> relvalue N tuple set.
I have no idea what this means, but what does the evaluation "represent" the rest of the time?
> The definition of the relation itself can not be
> equated to either a specific relvalue nor to a relvar.
Then what is it?
> Besides the
> same relation can be expressed using several relvars: it still is the
> same relation.
So a Relation is a template, or type, for typing variables? If so, I think you should use a term other than "relation," which is already overloaded, as our discussion shows.
> For instance F(x) is expressed as 2 * x + 2 if you express another
> function T(y) as =
> 2 * y + 2 then F = T
Yes, but relations aren't quite the same. For an O-O example, let's say you have an object class called Boob. You can declare variables (references) as follows:
public Boob tweedleDee;
public Boob tweedleDum;
But although they're of the same type, that doesn't mean they're the same thing. Same with relations. Imagine this syntax:
relation T1 = {boob left, boob right} (or whatever you like,
including constraints, such as left != right, except perhaps in
cyclopettes)
...
relvar GREAT_BOOBS as T1;
relvar LOUSY_BOOBS as T1;
So to me, the definition of "same relation" isn't the type, but the
specific relvar. Since each relvar can occur in a database once and
once only, that seems reasonable and useful.
> When the variable x in F or the variable y for T holds the value 2 both
F and T are the same function; changing the name of the free variable
> By analogy F and T are equivalent to relations R1 and R2,
No, they're not. Mathematically, functions are subsets of relations.
> F and T = 2 * 2 + 2 = 6 .
> just as *x* and *y* are relvars, just as *6* is a
> specific relvalue to which relation R1 is evaluated when *x* and *y*
> have a specific relvalue.
This line in particular confuses me.
> I define relation as a specific type of function.
It's the other way around; a function is a specific type of relation.
> For relation
> definition, look for function definition as opposed to variable and
> value definitions.
Variables are a computing construct (and a poor replacement for postconditions and constraints); mathematics deals with values. Forgive the overgeneralization.
> > > An N tuples relvalue necessarily constitutes the *evaluation* a relation
> > > R1 but does not equate to R1.
> >
> > I don't understand this sentence.
> See above analogy.
Which I didn't understand.
> Definition of relation is independent from both relvalues and relvar
> definition.
Then please state the definition.
> > It defines a new function. It doesn't make sense to refer to a changing
But the relations we're talking about aren't exactly the same as
mathematical ones. It would help if you defined relation as you
understand it. In relational model term "relation" means either relvar
or relval - it's loose.
> > function; you're defining a new one - for example, "F(x) = 2" has type
> > ANY -> int, while "F(x) = 2*x + 2" might be int -> int or number ->
> > number.
> Absolutely. Which is why a relation or a function should *not* be
> assimilated by deifnition to either relvar or relvalue.
> > There's no relationship between redefining a function F and changing
> > the relval assigned to a relvar (e.g. via update operations).
> True. I have used the example above the illustrate the danger to
> deifne relation accordingly to either relvalues or relvar. It just
> lead to false reasonning/
????
> The primary purpose of DB constraints through type definitions is *not*
> to restrict tuples in relvars but to restrict relvalues that later
> *fill in* the relvar.
True, I was sloppy.
> Therefore, a relvar can only be filled with
> permissible NTuples relvalues by definition. That is the whole point
> with RM definitions.
True.
- erk