Re: Lists

From: Thom Fruehwirth <fruehwir_at_mail.csse.monash.edu.au>
Date: Thu 01 Mar 2001 10:52:23 PM GMT
Message-ID: <3A9ED2A7.711AE180@mail.csse.monash.edu.au>
FAROUK AMINU wrote:
> 
> Hi Everyone,
> 
> I have been trying to use lists as elements of a larger list but it seems
> ECLiPSe does not support this. I read in prolog that this is acceptable:
> 
> List = [[a, b], [c,d,e], f]
> 
> I have been trying to use it in lib(fd) unfortunately it seems impossible.
> Can anyone with better Idea kindly help me?
> 
> Especially I would like to know if I can use recursion on lists like this.
> 
> Thank you very much,
> 
> Farouk

Of ocurse you can use any elements in a list (also lists again) in
Eclipse as in any other Prolog and do whatever you like with them
(especially recursion). The lists that occur in the lib(fd) library are
the datastructure to hold the integers that are possible values for a
variable. Of course, if you put a list instaed of an integer, you will
get an error.

If you would like other data than integers in your finite domains, you
could use the corresponding constraint solvers from the chr or ech
libraries of Eclipse.

Thom Fruehwirth
Visiting Professor at Monash University Melbourne
Received on Thu Mar 01 22:50:49 2001

This archive was generated by hypermail 2.1.8 : Wed 16 Nov 2005 06:07:07 PM GMT GMT