Re: A Logical Model for Lists as Relations

From: Marshall Spight <marshall.spight_at_gmail.com>
Date: 12 May 2006 10:05:45 -0700
Message-ID: <1147453545.856021.86330_at_d71g2000cwd.googlegroups.com>


JOG wrote:
> Marshall Spight wrote:
> >
> > But a list can be described as a relation. Most simply, an infinite
> > list is a relation from the natural numbers to the target set,
> > and a finite list is a relation from some finite contiguous subset
> > [0..n] of the naturals to the target set. Generalizing, we could
> > describe an n-ary list as a relation with an index attribute and
> > zero or more other attributes.
>
> Do you not find this unsatisfying though?

Actually, I find it quite satisfying, since it means I can, for example,
use the full power of the relational algebra for selection on lists.

> By doing this one is altering
> information that is ordinal in nature to being cardinal.

I don't understand this statement. Can you expand?

> Given one is
> modelling assertions, these indexes come from the aether - they seem
> rather implementational in nature, a physical workaround to the issue
> of ordering.

I don't see it that way. I don't see anything implementational to these equalities:

   "abc" = ['a', 'b', 'c'] = { (0,'a'), (1, 'b'), (2, 'c') }

Rather, they simply provide me a way to work with lists in a set-theoretic
way, rather than in the recursive, or worse, the customary iterative way.

It also means I don't have to introduce a new container type to handle ordered data, which maintains closure and keeps the number of generic containers small (= 1).

Marshall Received on Fri May 12 2006 - 19:05:45 CEST

Original text of this message