public final class MapList extends Object implements PredicateFactory, PreprocessablePredicateFactory, KnowledgeBaseConsumer
maplist(X,Y) / maplist(X,Y,Z) - determines if a goal succeeds against elements of a list.
maplist(X,Y) succeeds if the goal X can be successfully applied to each elements of the
list Y.
| Constructor and Description |
|---|
MapList() |
| Modifier and Type | Method and Description |
|---|---|
Predicate |
getPredicate(Term[] input)
Returns a
Predicate to be used in the evaluation of a goal. |
boolean |
isRetryable()
Should instances of this implementation be re-evaluated when backtracking?
|
PredicateFactory |
preprocess(Term input) |
void |
setKnowledgeBase(KnowledgeBase kb)
Provides a reference to a
KnowledgeBase. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisAlwaysCutOnBacktrackpublic void setKnowledgeBase(KnowledgeBase kb)
KnowledgeBaseConsumerKnowledgeBase.setKnowledgeBase in interface KnowledgeBaseConsumerpublic PredicateFactory preprocess(Term input)
preprocess in interface PreprocessablePredicateFactorypublic boolean isRetryable()
PredicateFactory
Some goals (e.g. X is 1) are only meant to be evaluated once (the statement is either true or false) while
others (e.g. repeat(3)) are meant to be evaluated multiple times. For instances of Predicate that
are designed to possibly have Predicate.evaluate() called on them multiple times for the same individual
query this method should return true. For instances of Predicate that are designed to only be
evaluated once per individual query this method should return false.
isRetryable in interface PredicateFactorytrue if an attempt should be made to re-evaluate instances of implementing classes when
backtracking, false otherwisepublic Predicate getPredicate(Term[] input)
PredicateFactoryPredicate to be used in the evaluation of a goal.getPredicate in interface PredicateFactoryinput - the arguments to use in the evaluation of the goalPredicate.evaluate()Copyright © 2024. All rights reserved.