org.xmloperator.lambda2.term.model
Interface TermReducer

All Known Implementing Classes:
TermReducerImpl

public interface TermReducer

Lambda Term reducer.


Method Summary
 boolean booleanValue(Term booleanTerm)
          Returns the boolean value of the given Term, if it represents a boolean.
 Term normalForm(Term term)
          Returns the normal form, if it exists, of the given Term.
 long numeralValue(Term numeralTerm)
          Returns the Church numeral value represented by the given Term if it represents one, elsewhere returns -1L.
 

Method Detail

normalForm

public Term normalForm(Term term)
                throws TooMuchReductionStepException
Returns the normal form, if it exists, of the given Term.

Parameters:
term - a Term.
Returns:
the given Term in normal form, if it exists.
Throws:
java.lang.IllegalArgumentException - if the given term has free variable(s).
TooMuchReductionStepException - if the given step max count is not enough.

booleanValue

public boolean booleanValue(Term booleanTerm)
Returns the boolean value of the given Term, if it represents a boolean.

Returns:
the boolean value of the given Term, if it represents a boolean.
Throws:
java.lang.IllegalArgumentException - if the given Term has free variable(s) or doesn't represent a boolean value.

numeralValue

public long numeralValue(Term numeralTerm)
Returns the Church numeral value represented by the given Term if it represents one, elsewhere returns -1L.

Returns:
the Church numeral value represented by the given Term if it represents one, elsewhere returns -1L.
Throws:
java.lang.IllegalArgumentException - if the given term has free variable(s).