Re: Is a function a relation?
Date: Tue, 23 Jun 2009 20:13:19 -0700 (PDT)
Message-ID: <ff5ac241-ad90-4358-8467-c740a7df7065_at_v15g2000prn.googlegroups.com>
On Jun 22, 10:09 pm, Keith H Duggar <dug..._at_alum.mit.edu> wrote:
> On Jun 22, 11:44 pm, David BL <davi..._at_iinet.net.au> wrote:
>
>
>
> > Since Keith popped up recently, I'm interesting in reopening the
> > question of whether a function is a relation (I have a small point to
> > add).
>
> > I'm interpreting "is a" in the same way as D&D. i.e. the question is
> > equivalent to asking whether every function value is a relation value.
>
> > D&D use the CIRCLE and ELLIPSE example to illustrate the idea of type
> > inheritance as specialisation by constraint. CIRCLE is a subtype of
> > ELLIPSE because every value of type CIRCLE is also a value of type
> > ELLIPSE.
>
> > Let E be a variable of type ELLIPSE that happens to hold a value of
> > type CIRCLE. D&D mention that THE_R(E) is not permitted, and it is
> > necessary to instead use THE_R(TREAT_DOWN_AS_CIRCLE(E)). Implicit in
> > this idea is that when an ellipse value happens to also be a circle
> > value, the interpretation of the ellipse as a circle is unambiguous.
>
> > Consider the binary relation with the following graph
>
> > { (x,y) | y = x+1 }
>
> > and the following two functions
>
> > f(x) = x+1
> > g(y) = y-1
>
> > It seems to me that assuming D&D's interpretation of "is a", it cannot
> > be said that a function is a relation because TREAT_DOWN_AS_FUNCTION
> > is ambiguous when provided with a relation variable that holds the
> > value f.
>
> You considered the wrong relation values having the wrong
> attribute names. Here are the correct values
>
> f(x) = x+1 -> { (domain,range) | range = domain + 1 }
> g(y) = y+1 -> { (domain,range) | range = domain - 1 }
>
> corresponding to the f(x) and g(y) you gave.
That's a fine way to go. SML goes that way. But there are other ways to go, and as well as that way works for SML, I think a relational language is going to best be served by a different approach.
Marshall Received on Wed Jun 24 2009 - 05:13:19 CEST