domains
x = integer
l = integer*
predicates
dividelist(l,l,l)
clauses
dividelist([],[],[]).
dividelist([X],[X],[]).
dividelist([X1,X2|List],[X1|List1],[X2|List2]) :-
dividelist(List,List1,List2).
Output :
Goal: dividelist([1,2,3,4,5,6,7,8],List1,List2)
List1=[1,3,5,7], List2=[2,4,6,8]
1 Solution