Example:
ory :- format("1st clause:\n"), deterministic(D1), format(" Det at (1.1): ~w\n", [D1]), member(X,[alpha,bravo,charlie]), deterministic(D2), format(" Det at (1.2) with '~w': ~w\n", [X,D2]). ory :- format("2nd clause:\n"), deterministic(D1), format(" Det at (2.1): ~w\n", [D1]). ory :- format("3rd clause & done.").
?- bagof(_,ory,_). 1st clause: Det at (1.1): true Det at (1.2) with 'alpha': false Det at (1.2) with 'bravo': false Det at (1.2) with 'charlie': true 2nd clause: Det at (2.1): true 3rd clause & done. true.
Implementation-wise, does this mean predicates not only return "true" or "false" but also an indicator saying "there are no more solutions, no need to call me again" if they can? It would make sense.