Split list

To split a list: splitlist(ListToBeSplitted, Splititem, BeforeSplit, AfterSplit)

splitlist([],_,[],[]).
splitlist([H|R], H, [], R).
splitlist([H|R], X, [H|S2],E) :-
splitlist(R, X, S2, E).

Or you can just use the built-in append/3:

append(BeforeSplit, [SplitItem|AfterSplit], ListToBeSplit)