member(X,[X|T]).
member(X,[H|T]):-member(X,T).
delfstocc(X,[X|T],T).
delfstocc(X,[Y|T],[Y|T1]):-delfstocc(X,T,T1),!.
delallocc(X,L,L1):-member(X,L),delfstocc(X,L,R),!,delallocc(X,R,L1);write(L).
ـــــــــــ
first , i wrote this code without using the cut , then i tried to put the cut operator after each predicate untill i get the perfect answer but actually i don't understand how it works after using the cut . i know that the cut operator stops prolog from proceeding matching , however i can't use it correctly , so i want help tracing this code by the way , this code simly delete all occurrences of an element in a list .