PROLOG PROGRAM TO SPLIT A LIST IN TWO LISTS SUCH THAT ONE LIST CONTAINS NEGATIVE NUMBERS AND ONE CONTAINS POSITIVE NUMBERS.
domains list=integer* predicates split(list,list,list) clauses split([],[],[]). split([X|L],[X|L1],L2):- X>= 0, !, split(L,L1,L2). split([X|L],L1,[X|L2]):- split(L,L1,L2). Output : Goal: split([1,2,-3,4,-5 ,2],X,Y) X=[1,2,4,2], Y=[-3,-5] 1 Solution