Re: More on lists and sets

From: Mikito Harakiri <mikharakiri_nospaum_at_yahoo.com>
Date: 20 Mar 2006 18:37:24 -0800
Message-ID: <1142908644.870469.119800_at_g10g2000cwb.googlegroups.com>


Mikito Harakiri wrote:
> Definition. List intersection is a cartesian product with equijoin of
> the list nodes and lexicographic order. Example: 1->2->1 /\ 2->1->2 =
> 2->1->1->2
>
> 2 2
> ^ ^
> | \
> 1 1 ------> 1
> ^ ^
> | \
> 2 2
> 1 -> 2 -> 1
>

This is actually amusing. Selection from list is join of two lists. As join/intersection is noncommutative, we have left selection and right selection. Example:

Select all the elements greater than one from list

1->2->1->3->2

Formally we evaluate either

1->2->1->3->2 /\ 'x>1'

or

 'x>1' /\ 1->2->1->3->2

The "list predicate" `x>1' evaluates to infinite list 2->3->4->5->...

Therefore:

1->2->1->3->2 /\ 'x>1' = 2->2->3

'x>1' /\ 1->2->1->3->2 = 2->3->2 Received on Tue Mar 21 2006 - 03:37:24 CET

Original text of this message