org.rubato.logeo.functions
Interface Function

All Known Implementing Classes:
AbstractFunction, CompositeFunction, IntegerFunction, ModuleMorphismFunction, RealFunction

public interface Function

This is the general interface for functions with an arbitrary number of arguments. Arguments and results are always denotators. To implement a function, extend the AbstractFunction class or one of the specialized function classes like IntegerFunction.

Author:
Gérard Milmeister

Method Summary
 Function compose(Function f)
          Returns a new function, the composition of this and f, i.e., this(f(x)).
 Denotator evaluate(Denotator... denotators)
          Evaluates the function with a list of arguments.
 int getArity()
          Returns the arity of the function.
 Form getInputForm(int i)
          Returns the ith argument form.
 java.lang.String getName()
          Returns the name of the function.
 Form getOutputForm()
          Returns the result form.
 boolean hasSig(Form[] inputForms, Form outputForm)
          Checks if the function has the given signature.
 

Method Detail

evaluate

Denotator evaluate(Denotator... denotators)
                   throws RubatoException
Evaluates the function with a list of arguments.

Throws:
RubatoException

getArity

int getArity()
Returns the arity of the function.


compose

Function compose(Function f)
                 throws RubatoException
Returns a new function, the composition of this and f, i.e., this(f(x)).

Throws:
RubatoException - is composition fails

getName

java.lang.String getName()
Returns the name of the function.


getInputForm

Form getInputForm(int i)
Returns the ith argument form.


getOutputForm

Form getOutputForm()
Returns the result form. Must be implemented in a subclass.


hasSig

boolean hasSig(Form[] inputForms,
               Form outputForm)
Checks if the function has the given signature.