I got a little bit further in this program. My source code is as follows:
remove(L,[],L).
remove([H|T],[H|S],Z) :- remove(T,S,Z).
remove([R|T],[Q|S],[R|Z]) :- remove(T,[Q|S],Z).
This works in a few cases such as:
-? remove([1,2,3,1],[1,1],X).
giving the result of X = [2,3]
However the result...