org.xmloperator.lambda.tree.util
Class CommonTerms

java.lang.Object
  |
  +--org.xmloperator.lambda.tree.util.CommonTerms

public abstract class CommonTerms
extends java.lang.Object

Common Terms. They are introduced in comments by their prefixed serialization form.


Constructor Summary
CommonTerms()
           
 
Method Summary
static boolean isDelta(Abstraction abstraction)
          Return true if the given Abstraction is a D Expression.
static boolean isIdentity(Abstraction abstraction)
          Returns true if the given Abstraction is an Identity.
static boolean isLoop(Application application)
          Return true if the given Application maps to "cvv".
static boolean isOmega(Application application)
          Return true if the given Application is an Omega Term.
static void main(java.lang.String[] args)
           
static Abstraction newBoolean(TermFactory termFactory, boolean value)
          Creates and returns an Abstraction that, depending on value, maps to value ?
static Abstraction newCouple(TermFactory termFactory)
          Creates and returns an Abstraction that maps to "aaaccveevev".
static Abstraction newDelta(TermFactory termFactory)
          Creates and returns an Abstraction that maps to "D" = "acvv".
static Abstraction newFalse(TermFactory termFactory)
          Creates and returns an Abstraction that maps to F = "aav".
static Abstraction newFirstInCouple(TermFactory termFactory, boolean value)
          Creates and returns an Abstraction that, depending on value, maps to value ?
static Abstraction newIdentity(TermFactory termFactory)
          Creates and returns an Abstraction that maps to "av".
static Application newLoop(TermFactory termFactory)
          Creates and returns an Application that maps to "cvv".
static Abstraction newNullAbstraction(Term body)
          Creates and returns an Abstraction that is immediatly followed by an EndOfScope on itself.
static Application newOmega(TermFactory termFactory)
          Creates and returns an Application that maps to "cDD".
static Application newTeta(TermFactory termFactory)
          Creates and returns an Application that maps to "cVV".
static Abstraction newTrue(TermFactory termFactory)
          Creates and returns an Abstraction that maps to K = "aaev".
static Abstraction newV(TermFactory termFactory)
          Creates and returns an Abstraction that maps to "V" = "aacvcecvvv".
static Abstraction newY(TermFactory termFactory)
          Creates and returns an Abstraction that maps to "acacevcvvacevcvv".
static Abstraction newYPart(TermFactory termFactory)
          Creates and returns an Abstraction that maps to "acevcvv".
static boolean test(java.io.PrintStream out, boolean isVerbose)
          Computes the size of some Expressions.
static boolean test(java.io.PrintStream out, boolean isVerbose, Term term, java.lang.String name, int size)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommonTerms

public CommonTerms()
Method Detail

newIdentity

public static final Abstraction newIdentity(TermFactory termFactory)
Creates and returns an Abstraction that maps to "av".

Parameters:
termFactory - a TermFactory for building the Term.
Returns:
the created Abstraction.
Throws:
NullPOinterException - if the given TermFactory is null.

isIdentity

public static final boolean isIdentity(Abstraction abstraction)
Returns true if the given Abstraction is an Identity.

Parameters:
abstraction - an Abstraction.
Returns:
true if the given Abstraction is an Identity.

newNullAbstraction

public static final Abstraction newNullAbstraction(Term body)
Creates and returns an Abstraction that is immediatly followed by an EndOfScope on itself.

Parameters:
body - the body of the EndOfScope.
Returns:
the created Abstraction.
Throws:
java.lang.NullPointerException - if the given body is null.

newTrue

public static final Abstraction newTrue(TermFactory termFactory)
Creates and returns an Abstraction that maps to K = "aaev".

Parameters:
termFactory - a TermFactory for building the Term.
Returns:
the created Abstraction.
Throws:
NullPOinterException - if the given TermFactory is null.

newFalse

public static final Abstraction newFalse(TermFactory termFactory)
Creates and returns an Abstraction that maps to F = "aav".

Parameters:
termFactory - a TermFactory for building the Term.
Returns:
the created Abstraction.
Throws:
NullPOinterException - if the given TermFactory is null.

newBoolean

public static final Abstraction newBoolean(TermFactory termFactory,
                                           boolean value)
Creates and returns an Abstraction that, depending on value, maps to value ? K : F.

Parameters:
termFactory - a TermFactory for building the Term.
value - a boolean value.
Returns:
the created Abstraction.
Throws:
NullPOinterException - if the given TermFactory is null.

newCouple

public static final Abstraction newCouple(TermFactory termFactory)
Creates and returns an Abstraction that maps to "aaaccveevev".

Parameters:
termFactory - a TermFactory for building the Term.
Returns:
the created Abstraction.
Throws:
NullPOinterException - if the given TermFactory is null.

newFirstInCouple

public static final Abstraction newFirstInCouple(TermFactory termFactory,
                                                 boolean value)
Creates and returns an Abstraction that, depending on value, maps to value ? "acvK" : "acvF".

Parameters:
termFactory - a TermFactory for building the Term.
Returns:
the created Abstraction.
Throws:
NullPOinterException - if the given TermFactory is null.

newLoop

public static final Application newLoop(TermFactory termFactory)
Creates and returns an Application that maps to "cvv".

Parameters:
termFactory - a TermFactory for building the Term.
Returns:
the created Application.
Throws:
NullPOinterException - if the given TermFactory is null.

isLoop

public static final boolean isLoop(Application application)
Return true if the given Application maps to "cvv".

Parameters:
application - an Application.
Returns:
true if the given Application maps to "cvv".

newDelta

public static final Abstraction newDelta(TermFactory termFactory)
Creates and returns an Abstraction that maps to "D" = "acvv".

Parameters:
termFactory - a TermFactory for building the Term.
Returns:
the created Abstraction.
Throws:
NullPOinterException - if the given TermFactory is null.

isDelta

public static final boolean isDelta(Abstraction abstraction)
Return true if the given Abstraction is a D Expression.

Parameters:
abstraction - an Abstraction.
Returns:
true if it is a D Expression.

newOmega

public static final Application newOmega(TermFactory termFactory)
Creates and returns an Application that maps to "cDD".

Parameters:
termFactory - a TermFactory for building the Term.
Returns:
the created Application.
Throws:
NullPOinterException - if the given TermFactory is null.

isOmega

public static final boolean isOmega(Application application)
Return true if the given Application is an Omega Term.

Parameters:
application - an Application.
Returns:
true if it is an Omega Term.

newYPart

public static final Abstraction newYPart(TermFactory termFactory)
Creates and returns an Abstraction that maps to "acevcvv".

Parameters:
termFactory - a TermFactory for building the Term.
Returns:
the created Abstraction.
Throws:
NullPOinterException - if the given termFactory is null.

newY

public static final Abstraction newY(TermFactory termFactory)
Creates and returns an Abstraction that maps to "acacevcvvacevcvv".

Parameters:
termFactory - a TermFactory for building the Term.
Returns:
the created Abstraction.
Throws:
NullPOinterException - if the given TermFactory is null.

newV

public static final Abstraction newV(TermFactory termFactory)
Creates and returns an Abstraction that maps to "V" = "aacvcecvvv".

Parameters:
termFactory - a TermFactory for building the Term.
Returns:
the created Abstraction.
Throws:
NullPOinterException - if the given TermFactory is null.

newTeta

public static final Application newTeta(TermFactory termFactory)
Creates and returns an Application that maps to "cVV".

Parameters:
termFactory - a TermFactory for building the Term.
Returns:
the created Application.
Throws:
NullPOinterException - if the given TermFactory is null.

main

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

test

public static boolean test(java.io.PrintStream out,
                           boolean isVerbose)
Computes the size of some Expressions.

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.

test

public static boolean test(java.io.PrintStream out,
                           boolean isVerbose,
                           Term term,
                           java.lang.String name,
                           int size)