Class Functor

java.lang.Object
org.projog.core.predicate.AbstractSingleResultPredicate
org.projog.core.predicate.builtin.construct.Functor
All Implemented Interfaces:
KnowledgeBaseConsumer, PredicateFactory

public final class Functor extends AbstractSingleResultPredicate
functor(T,F,N)

Predicate functor(T,F,N) means "T is a structure with name (functor) F and N number of arguments".

  • Constructor Details

    • Functor

      public Functor()
  • Method Details

    • evaluate

      protected boolean evaluate(Term term, Term functor, Term arity)
      Overrides:
      evaluate in class AbstractSingleResultPredicate
    • createTerm

      private Term createTerm(Term functor, Term arity)
      Creates a term using the given functor (name) and arity (number of arguments).
      Parameters:
      functor - an atom representing the name of the term to create
      arity - a numeric representing the number of arguments of the term to create
      Returns:
      if arity is 0 then an atom will be returned, else a structure will be created.