Re: Notions of Type
Date: 17 Aug 2006 07:32:11 -0700
Message-ID: <1155825131.908404.180390_at_74g2000cwt.googlegroups.com>
erk wrote:
>
> Sorry if this is obvious to everyone else, but does an algebra include
> only operations defined on values of the type in question?
Yes.
> I ask
> because in relational algebra, at least the rename operator involves a
> different type ("attribute name") than the "core type" (relation).
Very true. Of the various relational operators that have been identified over the years, only a few, like union, are really algebraic. RESTRICT, PROJECT, etc. aren't. Nonetheless people call it an algebra because it's an algebra in spirit, and by extension from the set algebra which really is an algebra. But it's been a problem. In fact, I think no one knew how to make a real relational algebra that was as complete. Some, such as myself, had been looking for a while, but I was never able to get rid of PROJECT.
Note the Tropashko algebra is a true algebra, and is complete.
> > Division is not part of the algebra for any type that includes zero as
>
> As division by zero is undefined, either its denominator type is
> restricted to nonzero, or its range includes "undefined" as a value. If
> there's another option, I can't think of it.
There is another option, and I would claim it's a better one than either of the more popular ones you've identified: partial functions. Division is a partial function. There are bazillions of partial function out there, and they require at least as much attention as the total ones.
http://en.wikipedia.org/wiki/Partial_function
Marshall Received on Thu Aug 17 2006 - 16:32:11 CEST