|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.xmloperator.lambda2.term.util.Base2Numerals
Numerals writeln in base 2.
| Field Summary | |
static Abstraction |
HALF
Term that represents the function that returns half the value of the argument. |
static Application |
SUCCESSOR
Term that represents the function that returns the successor of the value of the argument. |
static Application |
THREE_N_PLUS_R
Term that represents the function g(n, r) = 3 * n + r, with r = 0, 1 or 2. |
static Abstraction |
TWICE0
Term that represents the function that returns twice the value of the argument. |
static Abstraction |
TWICE1
Term that represents the function that returns twice the value of the argument plus one. |
static Abstraction |
ZERO
Term that represents the function that returns "K" if the argument is "0", "F" elsewhere. |
| Constructor Summary | |
Base2Numerals()
|
|
| Method Summary | |
static long |
longValue(TermReducer termReducer,
Term term)
Returns the long value modulo 2^63 of the given base 2 numeral term. |
static void |
main(java.lang.String[] args)
|
static Abstraction |
newInt(int n)
Creates and returns a Term that represents an integer. |
static Abstraction |
newTwice(boolean plusOne)
Creates and returns a Term that represents the function that returns twice the value of the argument. |
static boolean |
test(java.io.PrintStream out,
boolean isVerbose)
Execute some operations using base 2 numerals. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final Abstraction ZERO
public static final Abstraction HALF
public static final Abstraction TWICE0
public static final Abstraction TWICE1
public static final Application SUCCESSOR
public static final Application THREE_N_PLUS_R
| Constructor Detail |
public Base2Numerals()
| Method Detail |
public static final Abstraction newInt(int n)
n - the integer to represent.
java.lang.IllegalArgumentException - if the integer n is negative.
public static final long longValue(TermReducer termReducer,
Term term)
term - a base 2 numeral Term.
java.lang.IllegalStateException - if the given Term doesn't represent a base 2 numeral Term.public static final Abstraction newTwice(boolean plusOne)
Formula is : "\t.Z t 0(\r.r p F t)" with p = F if plusOne, K elsewhere.
plusOne - if true then adds one to the function result. The function
result becomes 2n+1 in place of 2n.
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 | ||||||||||