Bag holds all alternatives for Var in Goal. Bag might hold
duplicates. Equivalent to bagof, using the existence operator
(^) on all free variables of Goal. Succeeds with Bag = [] if
Goal fails immediately.
The findall/4 variation is a difference-list version of
findall/3.
True when List is the next chunk of maximal Count instantiations
of Template that reprensents a solution of Goal. For example:
?- findnsols(5, I, between(1, 12, I), L).
L = [1, 2, 3, 4, 5] ;
L = [6, 7, 8, 9, 10] ;
L = [11, 12].
- Errors
- -
domain_error(not_less_than_zero, Count)
if Count is less
than 0. - -
type_error(integer, Count)
if Count is not an integer.
- Compatibility
- - Ciao, but the SWI-Prolog version is non-deterministic.