mem(X,[X|_]). mem(X,[_|Tail]) :- mem(X,Tail). notmem(X,Y) :- not(mem(X,Y)).