List Subsets

Simon sorrynomail at
Tue Nov 18 23:15:25 CET 2003


I'm hoping you could show me examples of how a functional/declarative
language could be used to consicely describe resticted subsets of elements.
I'm looking for a 'specification' style definition so any ideas/input would
be very welcome.

Thanks for your time,
Say I have a list of items which is considered ordered...

['iA', 'iB', 'iC', 'iD', 'iE', 'iF']

  which could also be enumerated if needed...
  [(0,'iA'), (1,'iB'), (2,'iC'), (3,'iD'), (4,'iE'), (5,'iF')]

How would I go about writing definitions such that I could calculate...

a) All ordered subsets.

b) All continuous ordered subset.

c) All fixed relations, such as 2 items spaced by 2.

More information about the Python-list mailing list