org.xmloperator.lambda2.term.util
Class ChurchNumerals

java.lang.Object
  extended byorg.xmloperator.lambda2.term.util.ChurchNumerals

public abstract class ChurchNumerals
extends java.lang.Object

Church numerals.


Field Summary
static Abstraction ADD
          Term \x1x2x3x4.x1x3(x2x3x4)
static Abstraction EXP
          Term \x1x2.x2x1
static Abstraction MULT
          Term \x1x2x3.x1(x2x3)
static Abstraction SUCC
          Term \x1x2x3.x2(x1x2x3)
static Abstraction ZERO
          Term \x1x2x3.x1(\x4.x3)x2
 
Constructor Summary
ChurchNumerals()
           
 
Method Summary
static void main(java.lang.String[] args)
           
static Abstraction newInt(int n)
          Creates and returns a Term that represents an integer.
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
 

Field Detail

SUCC

public static final Abstraction SUCC
Term \x1x2x3.x2(x1x2x3)


ZERO

public static final Abstraction ZERO
Term \x1x2x3.x1(\x4.x3)x2


ADD

public static final Abstraction ADD
Term \x1x2x3x4.x1x3(x2x3x4)


MULT

public static final Abstraction MULT
Term \x1x2x3.x1(x2x3)


EXP

public static final Abstraction EXP
Term \x1x2.x2x1

Constructor Detail

ChurchNumerals

public ChurchNumerals()
Method Detail

newInt

public static final Abstraction newInt(int n)
Creates and returns a Term that represents an integer.

Parameters:
n - the integer to represent.
Returns:
the Church numeral Term for the given integer.
Throws:
java.lang.IllegalArgumentException - if the integer n is negative.

main

public static void main(java.lang.String[] args)

test

public static boolean test(java.io.PrintStream out,
                           boolean isVerbose)
Execute some operations using Church numerals.

Parameters:
out - the PrintStream to print results. May be null.
isVerbose - if true then all tests have to be displayed.
Returns:
true if all is Ok.