dbTalk Databases Forums  

Is a function a relation?

comp.databases.theory comp.databases.theory


Discuss Is a function a relation? in the comp.databases.theory forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
David BL
 
Posts: n/a

Default Is a function a relation? - 06-22-2009 , 10:44 PM






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.

Reply With Quote
  #2  
Old   
David BL
 
Posts: n/a

Default Re: Is a function a relation? - 06-22-2009 , 11:42 PM






On Jun 23, 11:44 am, David BL <davi... (AT) iinet (DOT) net.au> wrote:

Quote:
Consider the binary relation with the following graph

{ (x,y) | y = x+1 }

I neglected an important assumption: As is customary in the database
community, it is assumed that the attributes of a relation are
identified by name, not by ordinal position (i.e. despite my use of
ordered pairs above - which was for only for convenience).

I should have instead defined the body of the relation as:

{ t | t('y') = t('x') + 1 }

where each t is a tuple, formalised as a mapping from attribute name
to attribute value.

Reply With Quote
  #3  
Old   
Keith H Duggar
 
Posts: n/a

Default Re: Is a function a relation? - 06-23-2009 , 12:09 AM



On Jun 22, 11:44 pm, David BL <davi... (AT) iinet (DOT) net.au> wrote:
Quote:
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.

KHD

Reply With Quote
  #4  
Old   
David BL
 
Posts: n/a

Default Re: Is a function a relation? - 06-23-2009 , 12:35 AM



On Jun 23, 1:09 pm, Keith H Duggar <dug... (AT) alum (DOT) mit.edu> wrote:
Quote:
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.
So you're suggesting that a function is a relation where a special
convention has been followed in the choice of attribute names? Yes
that's one way of looking at it. That would in fact suggest the
interesting idea that one can use the RA to define functions. E.g.
start with some n-ary relation and use projection to get a binary
relation, and rename as required according to this special naming
convention.

Reply With Quote
  #5  
Old   
David BL
 
Posts: n/a

Default Re: Is a function a relation? - 06-23-2009 , 01:14 AM



On Jun 23, 1:35 pm, David BL <davi... (AT) iinet (DOT) net.au> wrote:

Quote:
Yes that's one way of looking at it.
I'll expand on what I mean by that. It seems to me that one could use
special conventions to "show" that just about any type can be regarded
as a specialisation of a relation. E.g. one could say that a whole
number in [0,255] is a relation by introducing symbols to represent
1,2,4,8,...,128 and the relation records a set of symbols that are
then interpreted in the manner of an 8 bit unsigned representation.

Reply With Quote
  #6  
Old   
Cimode
 
Posts: n/a

Default Re: Is a function a relation? - 06-23-2009 , 03:34 AM



On 23 juin, 08:14, David BL <davi... (AT) iinet (DOT) net.au> wrote:
Quote:
On Jun 23, 1:35 pm, David BL <davi... (AT) iinet (DOT) net.au> wrote:

Yes that's one way of looking at it.

I'll expand on what I mean by that. *It seems to me that one could use
special conventions to "show" that just about any type can be regarded
as a specialisation of a relation. *E.g. one could say that a whole
number in [0,255] is a relation by introducing symbols to represent
1,2,4,8,...,128 and the relation records a set of symbols that are
then interpreted in the manner of an 8 bit unsigned representation.
Relations is a possible construct that can represent *any* type if we
are to consider that a type is a set of values. Nevertherless, a
logical computing model (to define among other things the physical
reprentation of domain values) must be defined first (that is what I
spent the last 10 years working onto)...Hope this helps...

Reply With Quote
  #7  
Old   
David BL
 
Posts: n/a

Default Re: Is a function a relation? - 06-23-2009 , 05:33 AM



On Jun 23, 4:34 pm, Cimode <cim... (AT) hotmail (DOT) com> wrote:
Quote:
On 23 juin, 08:14, David BL <davi... (AT) iinet (DOT) net.au> wrote:> On Jun 23, 1:35 pm, David BL <davi... (AT) iinet (DOT) net.au> wrote:

Yes that's one way of looking at it.

I'll expand on what I mean by that. It seems to me that one could use
special conventions to "show" that just about any type can be regarded
as a specialisation of a relation. E.g. one could say that a whole
number in [0,255] is a relation by introducing symbols to represent
1,2,4,8,...,128 and the relation records a set of symbols that are
then interpreted in the manner of an 8 bit unsigned representation.

Relations is a possible construct that can represent *any* type if we
are to consider that a type is a set of values. Nevertherless, a
logical computing model (to define among other things the physical
reprentation of domain values) must be defined first (that is what I
spent the last 10 years working onto)...Hope this helps...
It could be thought that the logical can only exist as an abstraction
over the physical. However I don't believe that's a useful way to
think. In fact I suggest it misses the idea behind physical
independence. What I mean is that the logical doesn't need to be
"realised" or "reified" by the physical at all!

This could be seen as just a metaphysical comment (more specifically
in favour of mathematical realism), but what I really mean is that
pure mathematical systems can for example define things like the
integers in a way that's unique up to isomorphism through the
axiomatic approach, and that perspective is all one needs at the
logical level. I don't see how the physical comes into it at all.
Putting it another way (using the language of a mathematical realist
in denial), database values don't exist in time and space!

It's not clear that type systems particularly help in this purist
mathematical endeavour. I note that the usual axioms of set theory
completely ignore any concept of type. I'd be interested to know
whether modern mathematicians that have researched type theory believe
it's important to mathematical foundations. My understanding is that
Russell only investigated type theory with the aim to avoid paradoxes
by preventing loops, but his work was made redundant by axiomatic
systems like ZFC which is believed to be free of paradoxes.

Reply With Quote
  #8  
Old   
Cimode
 
Posts: n/a

Default Re: Is a function a relation? - 06-23-2009 , 06:17 AM



On 23 juin, 12:33, David BL <davi... (AT) iinet (DOT) net.au> wrote:
Quote:
On Jun 23, 4:34 pm, Cimode <cim... (AT) hotmail (DOT) com> wrote:





On 23 juin, 08:14, David BL <davi... (AT) iinet (DOT) net.au> wrote:> On Jun 23, 1:35 pm, David BL <davi... (AT) iinet (DOT) net.au> wrote:

Yes that's one way of looking at it.

I'll expand on what I mean by that. *It seems to me that one could use
special conventions to "show" that just about any type can be regarded
as a specialisation of a relation. *E.g. one could say that a whole
number in [0,255] is a relation by introducing symbols to represent
1,2,4,8,...,128 and the relation records a set of symbols that are
then interpreted in the manner of an 8 bit unsigned representation.

Relations is a possible construct that can represent *any* type if we
are to consider that a type is a set of values. *Nevertherless, a
logical computing model (to define among other things the physical
reprentation of domain values) must be defined first (that is what I
spent the last 10 years working onto)...Hope this helps...

It could be thought that the logical can only exist as an abstraction
over the physical. *However I don't believe that's a useful way to
think. *In fact I suggest it misses the idea behind physical
independence. *What I mean is that the logical doesn't need to be
"realised" or "reified" by the physical at all!

This could be seen as just a metaphysical comment (more specifically
in favour of mathematical realism), *but what I really mean is that
pure mathematical systems can for example define things like the
integers in a way that's unique up to isomorphism through the
axiomatic approach, *and that perspective is all one needs at the
logical level. *I don't see how the physical comes into it at all.
Putting it another way (using the language of a mathematical realist
in denial), database values don't exist in time and space!

It's not clear that type systems particularly help in this purist
mathematical endeavour.
The problem of achieving physical/logical independence under the
assumption of RMis far more complex than a simple taxonomy exercice.
The need for a specialized computing model is a prerequisite for
implementing relational logical operations.

The computing model must both take into considerations physical
limitations of current systems while allowing sound representation of
logical relational operations.

Quote:
*I note that the usual axioms of set theory
completely ignore any concept of type. *I'd be interested to know
whether modern mathematicians that have researched type theory believe
it's important to mathematical foundations. *My understanding is that
Russell only investigated type theory with the aim to avoid paradoxes
by preventing loops, but his work was made redundant by axiomatic
systems like ZFC which is believed to be free of paradoxes.
RM is a part of set theory. Domains are in fact types that are
defined in a naive way.

Reply With Quote
  #9  
Old   
Brian Selzer
 
Posts: n/a

Default Re: Is a function a relation? - 06-23-2009 , 07:32 AM



"David BL" <davidbl (AT) iinet (DOT) net.au> wrote

Quote:
On Jun 23, 1:09 pm, Keith H Duggar <dug... (AT) alum (DOT) mit.edu> wrote:

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.

So you're suggesting that a function is a relation where a special
convention has been followed in the choice of attribute names? Yes
that's one way of looking at it. That would in fact suggest the
interesting idea that one can use the RA to define functions. E.g.
start with some n-ary relation and use projection to get a binary
relation, and rename as required according to this special naming
convention.
I think that it is not names but roles. Instead of domain and range, think
determinant and dependent. A function is a relation that has defined in its
schema at least one dependent attribute that does not belong to all
determinants. Put it another way: a function is a relation that satisfies
at least one nontrivial functional dependency.

Reply With Quote
  #10  
Old   
Brian Selzer
 
Posts: n/a

Default Re: Is a function a relation? - 06-23-2009 , 11:26 AM



"Brian Selzer" <brian (AT) selzer-software (DOT) com> wrote

Quote:
"David BL" <davidbl (AT) iinet (DOT) net.au> wrote in message
news:09f7bd9a-76f9-47c3-a4fd-8ef4556c2036 (AT) m19g2000yqk (DOT) googlegroups.com...
On Jun 23, 1:09 pm, Keith H Duggar <dug... (AT) alum (DOT) mit.edu> wrote:

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.

So you're suggesting that a function is a relation where a special
convention has been followed in the choice of attribute names? Yes
that's one way of looking at it. That would in fact suggest the
interesting idea that one can use the RA to define functions. E.g.
start with some n-ary relation and use projection to get a binary
relation, and rename as required according to this special naming
convention.

I think that it is not names but roles. Instead of domain and range,
think determinant and dependent. A function is a relation that has
defined in its schema at least one dependent attribute that does not
belong to all determinants. Put it another way: a function is a relation
that satisfies at least one nontrivial functional dependency.
After thinking about this for a moment, I realized that I neglected to
consider pathological cases, such as relations that are not at least in 3NF.
So, with that qualification: a function is a 3NF relation that has defined
in its schema at least one dependent attribute that does not belong to all
determinants; a function is a 3NF relation that satisfies at least one
nontrivial functional dependency.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.