IF Computer > MINERVA > Manual > Reference > Predicates > Clause creation and destruction > collect/3

collect/3

MINERVA
ifcomputer logo
f
Expert Services on the Web

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.

document: http://www.ifcomputer.co.jp/MINERVA/Manual/Reference/Predicates/clause_creat_destruct/collect/print_de.html
published 2008/11/17 update 2003/2/26 (c) 1996-2006 IF Computer Japan
IF Computer 5-28-2 Sendagi, Bunkyo-ku Tel +81-3-5814-3352 start (AT) ifcomputer.com
Customer Support Tokyo 113-0022 Japan   http://www.ifcomputer.com
Back> managed with ubiCMS