Q:

Need to split lists using Delimite operation in SWI-prolog

I am trying my hands on prolog. 
I want to do following operation:
Suppose, I have a list = [7/5,6/4,5/4,6/3]
And I want to split it in two lists:
list 1 will contain [7,6,5,6] 
list 2 will contain [5,4,4,3]
Could you please help me with this?

A:

I could not find library(lambda) so I don't know how that works---where is this library? Why don't you say which Prolog implementation you use? It is maybe more easy to help then?
This is how it can be done otherwise with textbook Prolog:
split_fractions([], [], []).
split_fractions([X/Y|XYs], [X|Xs], [Y|Ys]) :-
    split_fractions(XYs, Xs, Ys).

This just says that if the list is empty, the two lists are empty; and if the list has a X/Y at head, then other lists have X and Y at heads, and same for rest of lists.
Or you can use maplist like @lurker says:
split_fractions(XYs, Xs, Ys) :-
    maplist(frac_num_den, XYs, Xs, Ys).

frac_num_den(X/Y, X, Y).

And if you find library(lambda) in this link:
http://www.complang.tuwien.ac.at/ulrich/Prolog-inedit/lambda.pl
You can save this file and then if you start swipl in the same directory as lambda.plyou can write:
?- use_module(lambda).
true.

%%                                !!!
?- XYs = [a/1, b/2, c/3], maplist(\ (X/Y)^X^Y^true, XYs, Xs, Ys).
XYs = [a/1, b/2, c/3],
Xs = [a, b, c],
Ys = [1, 2, 3].

I have not read the documentation but it seems the empty space I marked with !!! is significant.
From here:
http://www.complang.tuwien.ac.at/ulrich/Prolog-inedit/ISO-Hiord.html
It seems "documentation" is on that link and in the lambda.pl file. I could not find fast where it explains why the whitespace must be there.
And because I don't want to leave anyone out, here is another lambda library for SWI that I found, this one is available directly:
?- use_module(library(yall)).
true.

?- maplist([X/Y, X, Y]>>true, [a/1, b/2, c/3], Xs, Ys).
Xs = [a, b, c],
Ys = [1, 2, 3].

but maybe it is much better without lambda altogether.

