Re: Notions of Type

From: paul c <toledobythesea_at_oohay.ac>
Date: Thu, 17 Aug 2006 17:32:24 GMT
Message-ID: <IK1Fg.412054$iF6.306974_at_pd7tw2no>


Marshall wrote:
> paul c wrote:

>> Marshall wrote:
>>> erk wrote:
>>>> ...

> Consider PROJECT:
>
> PROJECT: Relation, Set-of-attributes -> Relation
>
> So for PROJECT of an x,y point over x, we pass it two
> things:
>
> 1) A relation defined over attributes x and y
> 2) ???
> and it returns
> 3) A relation defined over attribute x (aka "profit")
>
> Whoops! Doesn't fit the template. The second argument isn't
> a relation. So, strictly speaking, this is not an algebraic operator,
> because it isn't closed over the type Relation. Exercise for the
> reader: what *is* the type of the other argument? This should
> make your head hurt a least a little bit.
> ...

Thanks for that. Is it not equally reasonable to have:

PROJECT: Relation, Relation -> Relation

and pass it

  1. A relation defined over attributes x and y > 2) A relation defined over attribute y > and it returns > 3) A relation defined over attribute x (aka "profit")

I don't know the formalism for this, but I had thought that if I have a value (or even type) R{x,y}, a value R{x} is implied by definition (implied in the sense that if one has a value, the other has a value, similarly for types) and that all Project does is expose the implication, just as TABLE_DEE and DUM do if I project 'nothing'.

Is this too shallow?

P Received on Thu Aug 17 2006 - 19:32:24 CEST

Original text of this message