org.xmloperator.lambda2.term.model
Interface Term

All Known Subinterfaces:
Abstraction, Application, Variable
All Known Implementing Classes:
Abstraction0Impl, Application1Impl, TermImpl, VariableImpl

public interface Term

A term of the lambda-calculus.


Field Summary
static int TYPE_ABSTRACTION
           
static int TYPE_APPLICATION
           
static int TYPE_VARIABLE
           
 
Method Summary
 Abstraction buildAbstraction()
          Builds and returns an Abstraction whose body is this Term and which has no bound variable.
 Abstraction buildAbstraction(Variable boundVariable)
          Builds and returns an Abstraction whose body is this Term and with the given bound variable.
 Abstraction buildAbstraction(Variable[] boundVariables)
          Builds and returns an Abstraction whose body is this Term and with the given bound variables.
 Application buildApplication(Term argument)
          Builds and returns an Application whose function is this Term and the argument is given.
 Application buildApplication(Term argument, long functionExponent)
          Builds and returns an Application whose function is this Term and the argument is given.
 java.util.Set freeVariables()
          Returns the set of free variables of this Term.
 int getTermType()
          Returns the type of this term.
 boolean isAbstraction()
          Returns true if this Term is an Abstraction.
 boolean isApplication()
          Returns true if this Term is an Application.
 boolean isVariable()
          Returns true if this Term is a Variable.
 java.lang.String toText()
          Returns a text representation of this Term.
 

Field Detail

TYPE_VARIABLE

public static final int TYPE_VARIABLE
See Also:
Constant Field Values

TYPE_ABSTRACTION

public static final int TYPE_ABSTRACTION
See Also:
Constant Field Values

TYPE_APPLICATION

public static final int TYPE_APPLICATION
See Also:
Constant Field Values
Method Detail

getTermType

public int getTermType()
Returns the type of this term.

Returns:
the type of this term. It is one of the constants TYPE_*

isVariable

public boolean isVariable()
Returns true if this Term is a Variable.

Returns:
true if this Term is a Variable.

isAbstraction

public boolean isAbstraction()
Returns true if this Term is an Abstraction.

Returns:
true if this Term is an Abstraction.

isApplication

public boolean isApplication()
Returns true if this Term is an Application.

Returns:
true if this Term is an Application.

freeVariables

public java.util.Set freeVariables()
Returns the set of free variables of this Term.

Returns:
the set of free variables of this Term.

toText

public java.lang.String toText()
Returns a text representation of this Term. Exemple(Delta): "\x1x2.x1x2".

Returns:
a text representation of this Term. Exemple(Delta): "\x1x2.x1x2".

buildAbstraction

public Abstraction buildAbstraction()
Builds and returns an Abstraction whose body is this Term and which has no bound variable.

Returns:
the Built Abstraction.

buildAbstraction

public Abstraction buildAbstraction(Variable boundVariable)
Builds and returns an Abstraction whose body is this Term and with the given bound variable.

Parameters:
boundVariable - a Variable used once within this Term.
Returns:
the Built Abstraction.

buildAbstraction

public Abstraction buildAbstraction(Variable[] boundVariables)
Builds and returns an Abstraction whose body is this Term and with the given bound variables.

Parameters:
boundVariables - a set of variables used each once within this Term.
Returns:
the Built Abstraction.

buildApplication

public Application buildApplication(Term argument)
Builds and returns an Application whose function is this Term and the argument is given.

Parameters:
argument - a Term.
Returns:
the build Application.

buildApplication

public Application buildApplication(Term argument,
                                    long functionExponent)
Builds and returns an Application whose function is this Term and the argument is given. The function exponent may also be given.

Parameters:
argument - a Term.
functionExponent - a function exponent.
Returns:
the build Application.