public final class BagOf extends AbstractPredicateFactory implements PreprocessablePredicateFactory
bagof(X,P,L)
- find all solutions that satisfy the goal.
bagof(X,P,L)
produces a list (L
) of X
for each possible solution of the goal
P
. If P
contains uninstantiated variables, other than X
, it is possible that
bagof
can be successfully evaluated multiple times - for each possible values of the uninstantiated
variables. The elements in L
will appear in the order they were found and may include duplicates. Fails
if P
has no solutions.
Constructor and Description |
---|
BagOf() |
Modifier and Type | Method and Description |
---|---|
protected Predicate |
getPredicate(Term template,
Term goal,
Term bag) |
PredicateFactory |
preprocess(Term term) |
getArithmeticOperators, getFileHandles, getKnowledgeBase, getOperands, getPredicate, getPredicate, getPredicate, getPredicate, getPredicate, getPredicates, getProjogListeners, getSpyPoints, getTermFormatter, init, isRetryable, setKnowledgeBase
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getPredicate, isAlwaysCutOnBacktrack, isRetryable
protected Predicate getPredicate(Term template, Term goal, Term bag)
getPredicate
in class AbstractPredicateFactory
public PredicateFactory preprocess(Term term)
preprocess
in interface PreprocessablePredicateFactory
Copyright © 2024. All rights reserved.