Wednesday, October 14, 2009

Member.pro Lab4 part6

% checks to see if a given element is in a given list, returns yes or no.

mem(A, [A|_]). % Given element is a member if it matches the head.
mem(A, [_|Tail]) :-
mem(A, Tail). % Givem element is a member if it matches the tail.