org.xmloperator.lambda2.term.util
Class Modulo2Numerals

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

public abstract class Modulo2Numerals
extends java.lang.Object

Terms that represent couples (n / 2, n % 2).


Field Summary
static Abstraction HALF
          Term that represents a function of a Church numeral that returns half the value of the argument.
static Abstraction MOD_SUCC
          Term that represents the successor function for a numeral under the form (n / 2, n % 2).
static Abstraction PARITY
          Term that represents a function of a Church numeral that returns "K" if the numeral is even, "F" elsewhere.
 
Constructor Summary
Modulo2Numerals()
           
 
Method Summary
static void main(java.lang.String[] args)
           
static Abstraction newModInt(int n)
          Creates and returns a Term that represents a numeral under the form (n / 2, n % 2) : \t.t churchInt(n / 2) boolean(n % 2).
static boolean test(java.io.PrintStream out, boolean isVerbose)
          Execute some operations using numerals.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARITY

public static final Abstraction PARITY
Term that represents a function of a Church numeral that returns "K" if the numeral is even, "F" elsewhere.


MOD_SUCC

public static final Abstraction MOD_SUCC
Term that represents the successor function for a numeral under the form (n / 2, n % 2).


HALF

public static final Abstraction HALF
Term that represents a function of a Church numeral that returns half the value of the argument.

Constructor Detail

Modulo2Numerals

public Modulo2Numerals()
Method Detail

newModInt

public static final Abstraction newModInt(int n)
Creates and returns a Term that represents a numeral under the form (n / 2, n % 2) : \t.t churchInt(n / 2) boolean(n % 2).

Parameters:
n - the integer to represent.
Returns:
a Term for a numeral under the form (n / 2, n % 2)

main

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

test

public static boolean test(java.io.PrintStream out,
                           boolean isVerbose)
Execute some operations using 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.