collects all clauses of dynamic tuples.
collect/3 is a special purpose predicate for collecting all
clauses of a dynamic predicate (all clauses must be facts,
i.e. of the form (Head :- true). It's behaviour is like that of
findall3. However, its optimized for the special purpose
to collect clauses of dynamic predicates.
collect/3 unifies TermList with a list with as many
instantiations of Term as Tuple has solutions of Term.
If Tuple does not succeed then TermList will be unified with
the emtpy list.
Term term Tuple fact TermList list of terms
| assertz(employee(meyer)). | |
| assertz(employee(warren)). | |
| collect(X, employee(X), L). | Succeeds with substitution L <- [meyer, warren]. |
This predicate is not part of the ISO-Prolog Standard.
| scroll to top |
|