The only difference between ** bagof/3** and ** setof/3** is that
** bagof/3** leaves repeated solutions in the answer.
Note that ** bagof/3** is less expensive than ** setof/3**.

Also note that, if there are no solutions then both ** bagof/3**
and ** setof/3** fail!
If you want a predicate that behaves like ** setof/3** (or ** bagof/3**)
but succeeds
with an empty list if there are no solutions then write something like:

which will behave in the desired way.all(X,Y,Z):-setof(X,Y,Z),

!.

all(X,Y,[]). [-5pt]

Mon May 24 20:14:48 BST 1999