Re: A Logical Model for Lists as Relations

From: Marshall Spight <marshall.spight_at_gmail.com>
Date: 10 May 2006 07:18:17 -0700
Message-ID: <1147270697.205500.197950_at_j73g2000cwa.googlegroups.com>


Brian Selzer wrote:
> "Marshall Spight" <marshall.spight_at_gmail.com> wrote in message
> >
> > 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.
>
> I thought that whole numbers begin with 0 and natural numbers begin with 1.

I went searching for a reference and was surprised to discover that there is no agreement on these terms!

> "A", 15
> "B", 33
> "C", 2
>
> If the value 88 is to be inserted between 15 and 33, you get:
>
> "A", 15
> "AM", 88
> "B", 33
> "C", 2

Interesting! You have proposed the list-analog of tree encoding.

I'd still prefer real lists, though.

Marshall Received on Wed May 10 2006 - 16:18:17 CEST

Original text of this message