Implement the member predicate as a one-liner
Solution: member(X, [Y|T]) :- X = Y; member(X, T). Demonstration: ?- member(a, []). fail. ?- member(a, [a]). true ; fail. ?- member(a, [b]). fail. ?- member(a, [1, 2, 3, a, 5, 6, a]). true ; true ; fail. How it works: We are looking for an occurrence of the first argument, X, in the the … Read more