edu.cs.ai.kreator.logic
Class Functor

java.lang.Object
  extended by edu.cs.ai.kreator.logic.Functor

public class Functor
extends java.lang.Object

This class models a functor in first-order logic.

Author:
Matthias Thimm

Field Summary
static org.apache.log4j.Logger LOG
           
 
Method Summary
static Functor create(LanguageFactory lang, java.lang.String name, int arity)
          Constructs a new functor with the given name and arity.
static Functor createOrGet(LanguageFactory lang, java.lang.String name, int arity)
          Return an already existing functor or, if necessary, constructs a new functor with the given name and arity.
 int getArity()
           
 LanguageFactory getLanguageFactory()
          Returns the LanguageFactory this functor object belongs to.
 java.lang.String getName()
           
 Sort getSort()
           
 java.lang.String toLatex()
          Returns a Latex grammar conform string to generate variables, rules (conditionals) etc.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOG

public static final org.apache.log4j.Logger LOG
Method Detail

create

public static Functor create(LanguageFactory lang,
                             java.lang.String name,
                             int arity)
                      throws WriteProtectionException
Constructs a new functor with the given name and arity.

Parameters:
name - a string.
arity - an arity
languageFactory - the LanguageFactory the functor will be registered to
Throws:
java.lang.IllegalArgumentException - if a functor with the same name already exists
WriteProtectionException

createOrGet

public static Functor createOrGet(LanguageFactory lang,
                                  java.lang.String name,
                                  int arity)
                           throws WriteProtectionException
Return an already existing functor or, if necessary, constructs a new functor with the given name and arity.

Parameters:
name - a string.
arity - an arity
languageFactory - the LanguageFactory the functor will be or is already registered to
Throws:
WriteProtectionException

getSort

public Sort getSort()
Returns:
always the sort "Thing". (MT: Why is that so?)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toLatex

public java.lang.String toLatex()
Description copied from interface: Latexable
Returns a Latex grammar conform string to generate variables, rules (conditionals) etc.

Returns:
a Latex grammar conform string.

getName

public java.lang.String getName()

getArity

public int getArity()

getLanguageFactory

public LanguageFactory getLanguageFactory()
Returns the LanguageFactory this functor object belongs to.

Returns:
the lang