which(_).

f(X) :- which(a), member(X,[1,2,3]).
f(X) :- which(b), atom(X).
f(X) :- which(recursing), f(X).
