how to use findall setof prolog code example Example: how to use findall in prolog ?- findall(X,g(a,X),Bag). Bag = [].