sitelogo
collect/3

collects all clauses of dynamic tuples.

collect(+Term, +Tuple, -TermList)

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.

Arguments

Term                term
Tuple               fact
TermList            list of terms

Examples

assertz(employee(meyer)).
assertz(employee(warren)).
collect(X, employee(X), L). Succeeds with substitution L <- [meyer, warren].

Standard

This predicate is not part of the ISO-Prolog Standard.

See also

asserta/1, assertz/1, abolish/1, load/1, unload/1, loaded/1/2, retract/1, retractall/1, findall/3.


Up read on...
scroll to top managed with ubiCMS