org.xmloperator.lambda.net.util
Interface WalkingContext

All Known Subinterfaces:
WalkingContextTranslater

public interface WalkingContext

Context for walking in a lambda-net exactly like traversing the read-back tree. The lambda-net is supposed to be invariant (no interaction) during walking.


Method Summary
 void executeStep()
          Depending on the Port connected to the currently leaved Port, executes the following transition : Abstractor.Input -> Body (forward) Abstractor.Body -> Input (backward) Abstractor.Bind -> Bind (forward -> backward) Applicator.Input -> Body (forward) Applicator.Body -> Argument (backward -> forward) Applicator.Argument -> Input (backward) Delimitor.Principal -> Auxiliary (forward or backward) Delimitor.Auxiliary -> Principal (forward or backward) Duplicator.Input -> Output (forward or backward) Duplicator.Output -> Input directored by context (forward or backward) Eraser.Port -> Port (backward -> forward)
 Port getCurrentPort()
          Returns the currently leaved Port.
 int getEndOfScopeCount()
          Returns the count of EndOfScope on a current bind Port.
 Eraser getRootEraser()
          Returns the interaction net rootEraser.
 boolean isReturnedToRoot()
          Returns (currentPort.getOperator() == rootEraser).
 boolean isWalkingForward()
          Returns true if going forward, i.e. to bind.
 void printTour(java.io.PrintStream out)
          Executes a complete cycle and print each step in a readable fation.
 void returnToRoot()
          Returns to the root Eraser.
 

Method Detail

getRootEraser

public Eraser getRootEraser()
Returns the interaction net rootEraser.

Returns:
the interaction net rootEraser.

getCurrentPort

public Port getCurrentPort()
Returns the currently leaved Port.

Returns:
the currently leaved Port.

getEndOfScopeCount

public int getEndOfScopeCount()
Returns the count of EndOfScope on a current bind Port.

Returns:
the count of EndOfScope on a current bind Port.
Throws:
java.lang.IllegalStateException - if the current Port is not a bind Port.

isWalkingForward

public boolean isWalkingForward()
Returns true if going forward, i.e. to bind.

Returns:
true if going forward, i.e. to bind.

executeStep

public void executeStep()
Depending on the Port connected to the currently leaved Port, executes the following transition :

Throws:
org.xmloperator.lambda.tree.exception.IncorrectTermException - in case of WalkingContextTranslater, if the given root Term doesn't map to the lambda-net.

isReturnedToRoot

public boolean isReturnedToRoot()
Returns (currentPort.getOperator() == rootEraser).

Returns:
(currentPort.getOperator() == rootEraser).

returnToRoot

public void returnToRoot()
Returns to the root Eraser.

Post-condition: (currentPort == rootEraser.port).


printTour

public void printTour(java.io.PrintStream out)
Executes a complete cycle and print each step in a readable fation.

Parameters:
out - a PrintStream.