Class PredSort
java.lang.Object
org.projog.core.predicate.AbstractSingleResultPredicate
org.projog.core.predicate.builtin.compare.PredSort
- All Implemented Interfaces:
KnowledgeBaseConsumer, PredicateFactory, PreprocessablePredicateFactory
public final class PredSort
extends AbstractSingleResultPredicate
implements PreprocessablePredicateFactory
predsort(X,Y,Z) - sorts a list using the specified predicate.
Sorts the list represented by Y using the predicate represented by X - and attempts to
unify the result with Z. The predicate represented by X must indicate whether the second
argument is equal, less than or greater than the third argument - by unifying the first argument with an atom which
has the value =, < or >.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final classprivate static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intThe arity of the predicate represented by the first argument. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanprivate static booleanevaluatePredSort(PredicateFactory pf, Term predicateName, Term input, Term sorted) preprocess(Term term) Methods inherited from class AbstractSingleResultPredicate
evaluate, evaluate, evaluate, evaluate, evaluate, getArithmeticOperators, getFileHandles, getKnowledgeBase, getOperands, getPredicate, getPredicates, getProjogListeners, getSpyPoints, getTermFormatter, init, isRetryable, setKnowledgeBaseMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface PredicateFactory
getPredicate, isAlwaysCutOnBacktrack, isRetryable
-
Field Details
-
FIRST_ARG_ARITY
private static final int FIRST_ARG_ARITYThe arity of the predicate represented by the first argument.- See Also:
-
-
Constructor Details
-
PredSort
public PredSort()
-
-
Method Details
-
evaluate
- Overrides:
evaluatein classAbstractSingleResultPredicate
-
evaluatePredSort
private static boolean evaluatePredSort(PredicateFactory pf, Term predicateName, Term input, Term sorted) -
preprocess
- Specified by:
preprocessin interfacePreprocessablePredicateFactory
-