domains
l = integer*
predicates
split(l,l,l)
clauses
split([],[],[]).
split([X|List] , Positive , [X|Negative]) :-
X < 0,
split(List,Positive,Negative).
split([X|List] , [X|Positive] , Negative) :-
X >= 0,
split(List,Positive,Negative).
Output :
Goal: split([-1,1,-2,2,-3,3],PosList,NegList)
PosList=[1,2,3], NegList=[-1,-2,-3]
1 Solution