Re: Iterative union
- From: phantastic@xxxxxxxxxx
- Date: 21 Feb 2007 02:44:47 -0800
On 21 Feb, 11:29, Thorsten Kiefer <toki...@xxxxxxxxxxxxxxxx> wrote:
phantas...@xxxxxxxxxx wrote:
Hi,
I have a list like this: [[[a,b],[b,c]],[[c,d],[d,v]]] where the
number of elements (sublists) is two but number of elements inside
sublist can be random.
I want a list like this: [[a,b,c], [c,d,v]] (in this case)
I have considered union/3 predicate but I don't know how I can iterate
on every member of the list.
Any help?
thanks
Maybe like that :
map(_,[],[]).
map(F,[X|XS],[Y|YS]) :- apply(F,[X,Y]),map(F,XS,YS).
Regards
Thorsten
thanks thorsten i will try
.
- References:
- Iterative union
- From: phantastic
- Re: Iterative union
- From: Thorsten Kiefer
- Iterative union
- Prev by Date: Re: Iterative union
- Next by Date: ACAI-07 Summer School Announcement: Logic for AI
- Previous by thread: Re: Iterative union
- Next by thread: Re: Iterative union
- Index(es):