| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: A Logical Model for Lists as Relations
JOG wrote:
> Marshall Spight wrote:
>
>>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?
You will run into problems when you get to things like:
{ (MacDonald, Laurier), (Laurier, MacDonald), (MacDonald, Laurier) }
Unless of course you want to record only the order in which Prime Ministers were first elected.
>>>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') }
And what of "ababa" ?
>>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).
Your method does not work in the general case. Whether one uses predecessors and successors or whether one uses an ordered index, one still needs to consider the requirement for at least one candidate key. Received on Fri May 12 2006 - 14:05:45 CDT
![]() |
![]() |