?- member(a, [b, a, c]). true. ?- member(X, [b, a, c]). X = b ; X = a ; X = c ; false. ?- member(happy(fido), [angry(rex), happy(fido)]). true. ?- member(a, [b, [a], c]). false. ?- member([a], [b, [a], c]). true. ?- member(a, Y). Y = [a|_G310] ; Y = [_G309, a|_G313] ; Y = [_G309, _G312, a|_G316] ; Y = [_G309, _G312, _G315, a|_G319] ;… and so on for as long as you press "
;". The response to this last query says that
ais a member of an (uninstantiated) list
ais the first member or the second member or the third member or the fourth member or …
_G313, etc. represent bits of the list
Ythat we have no information about.
See also backtracking.