org.xmloperator.lambda.net.util
Class NetUtils

java.lang.Object
  |
  +--org.xmloperator.lambda.net.util.NetUtils

public abstract class NetUtils
extends java.lang.Object

Utilities about traversing a lambda-net.


Constructor Summary
NetUtils()
           
 
Method Summary
static void incrementMark(Eraser rootEraser, boolean isMarkIncremented)
          Increment (or decrement) the mark of any Operator connected to an Eraser, recursively.
static java.util.List operatorList(Eraser rootEraser)
          Returns a List of Operators belonging to a lambda-net.
static void print(java.io.PrintStream out, Eraser rootEraser)
          Print a presentation of a lambda-net.
static void print(java.io.PrintStream out, java.util.List operatorList)
          Print a presentation of a lambda-net.
static void verifyClosure(Eraser rootEraser)
          Verify the closure and the mark-homogeneity of a lambda-net.
static void verifyXFree(Eraser rootEraser)
          Verify that there is no reducable interaction other than beta and the root Eraser.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NetUtils

public NetUtils()
Method Detail

incrementMark

public static final void incrementMark(Eraser rootEraser,
                                       boolean isMarkIncremented)
Increment (or decrement) the mark of any Operator connected to an Eraser, recursively.

Pre-condition: all the Operators have the same mark.

Post-condition: the Operator marks are incremented.

Parameters:
rootEraser - a root Eraser.
Throws:
FreePortException - if a Port is found free.
MarkedDifferentlyException - if an Operator has not the same mark than the others.

verifyClosure

public static final void verifyClosure(Eraser rootEraser)
Verify the closure and the mark-homogeneity of a lambda-net.

Pre-condition: all the Operators have the same mark.

Post-condition: the Operator marks are unmodified.

Parameters:
rootEraser - a root Eraser.
Throws:
FreePortException - if a Port is found free.
MarkedDifferentlyException - if an Operator has not the same mark than the others.

verifyXFree

public static final void verifyXFree(Eraser rootEraser)
Verify that there is no reducable interaction other than beta and the root Eraser.

Pre-condition: all the Operators have the same mark.

Post-condition: the Operator marks are unmodified.

Parameters:
rootEraser - a root Eraser.
Throws:
org.xmloperator.lambda.net.exception.UnreducedXInteractionException - if there is a reducable interaction other than beta and the root Eraser.
FreePortException - if a Port is found free.
MarkedDifferentlyException - if an Operator has not the same mark than the others.

operatorList

public static final java.util.List operatorList(Eraser rootEraser)
Returns a List of Operators belonging to a lambda-net.

Parameters:
rootEraser - a root Eraser.
Returns:
a List of the Operators of the given interaction net.
Throws:
FreePortException - if a Port is found free.
MarkedDifferentlyException - if an Operator has not the same mark than the others.

print

public static final void print(java.io.PrintStream out,
                               Eraser rootEraser)
Print a presentation of a lambda-net.

Parameters:
out - a PrintStream.
rootEraser - a root Eraser.

print

public static final void print(java.io.PrintStream out,
                               java.util.List operatorList)
Print a presentation of a lambda-net.

Parameters:
out - a PrintStream.
operatorList - a List of Operators.