|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.xmloperator.lambda.tree.generate.ChurchNumerals
Factories for Church numerals.
Constructor Summary | |
ChurchNumerals()
|
Method Summary | |
static int |
intValue(Abstraction abstraction)
Returns the integer value of a Church numeral or -1 if the argument is not a Church numeral. |
static void |
main(java.lang.String[] args)
|
static Abstraction |
newAdd(TermFactory termFactory)
Creates and returns a new instance of the "Add" Abstraction ("aaaacceeevevcceevevv"). |
static Abstraction |
newExp(TermFactory termFactory)
Creates and returns a new instance of the "Exp" Abstraction ("aacvev"). |
static Abstraction |
newInt(TermFactory termFactory,
int n)
Creates and returns a new instance of the Abstraction that represents the integer n: 0 = "aav", 1 = "aacevv", 2 = "aacevcevv", 3 = "aacevcevcevv", ... |
static Abstraction |
newMult(TermFactory termFactory)
Creates and returns a new instance of the "Mult" Abstraction ("aaaceevcevv"). |
static Abstraction |
newSucc(TermFactory termFactory)
Creates and returns a new instance of the "Succ" Abstraction ("aaacevcceevevv"). |
static Abstraction |
newZero(TermFactory termFactory)
Creates and returns a new instance of the "Zero" Abstraction ("aaacceevcKvev"). |
static boolean |
test(java.io.PrintStream out,
boolean isVerbose)
Execute some operations using Church numerals. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ChurchNumerals()
Method Detail |
public static final Abstraction newInt(TermFactory termFactory, int n)
termFactory
- a TermFactory.n
- the integer to represent.
java.lang.IllegalArgumentException
- if the integer n is negative.public static final int intValue(Abstraction abstraction)
abstraction
- the Church numeral.
java.lang.NullPointerException
- if the given Abstraction is broken.public static final Abstraction newSucc(TermFactory termFactory)
termFactory
- an TermFactory.
public static final Abstraction newZero(TermFactory termFactory)
termFactory
- an TermFactory.
public static final Abstraction newAdd(TermFactory termFactory)
termFactory
- an TermFactory.
public static final Abstraction newMult(TermFactory termFactory)
termFactory
- an TermFactory.
public static final Abstraction newExp(TermFactory termFactory)
termFactory
- an TermFactory.
public static void main(java.lang.String[] args)
public static boolean test(java.io.PrintStream out, boolean isVerbose)
out
- the PrintStream to print results. May be null.isVerbose
- if true then all tests have to be displayed.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |