|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A LambdaNet is an interaction-net that represents a lambda term which is linear relativety to each of its free variables.
The net representation of the lambda term is the one of "Compiling the lambda-calculus into Interaction Combinators" by Ian Mackie and Jorge Sousa Pinto.
The interaction net body is accessible through (supported by) a free Port.
Method Summary | |
boolean |
booleanValue(int[] interactionStat)
Returns the boolean value of the Term (K or F) represented by this LambdaNet. |
void |
buildAbstraction()
Transforms this LambdaNet in such a way that its represented lambda term "t" is replaced by the abstraction "\x.t", where "x" doesn't occur within t. |
void |
buildAbstraction(Port freeVariableSupport)
Transforms this LambdaNet in such a way that its represented lambda term "t" is replaced by the abstraction "\x.t", where "x" is bound to the given variable of "t". |
void |
buildAbstraction(Port[] freeVariableSupports)
Transforms this LambdaNet in such a way that its represented lambda term "t" is replaced by the abstraction "\x.t", where "x" is bound to the given variables of "t". |
void |
buildApplication(LambdaNet argument)
Transforms this LambdaNet in such a way that its represented lambda term "t" is replaced by the application "tu" where "u" is the lambda term represented by the given LambdaNet. |
void |
buildApplication(LambdaNet argument,
int functionExponent)
Transforms this LambdaNet in such a way that its represented lambda term "t" is replaced by the application "(t^n)u" where "u" is the lambda term represented by the given LambdaNet and "n" an exponent. |
Port |
getBodySupport()
Returns the free Port that supports the interaction-net body. |
int |
getFreeVariableCount()
Returns the count of free variables. |
long |
numeralValue(int[] interactionStat)
Returns the value modulo 2^63 of the Church numeral Term represented by this LambdaNet. |
Term |
readBack(boolean inNormalForm,
int maxStepCount,
int[] interactionStat)
Read back the Term represented by this LambdaNet. |
int |
reduceUntilInterfaceNormalForm(int maxStepCount,
int[] interactionStat)
Reduces this LambdaNet until the interface has a normal form. |
Method Detail |
public Port getBodySupport()
public int getFreeVariableCount()
public void buildAbstraction()
public void buildAbstraction(Port freeVariableSupport)
freeVariableSupport
- a support of free variable.public void buildAbstraction(Port[] freeVariableSupports)
freeVariableSupports
- a set of 0 or more support of free variable.public void buildApplication(LambdaNet argument)
Transforms this LambdaNet in such a way that its represented lambda term "t" is replaced by the application "tu" where "u" is the lambda term represented by the given LambdaNet.
The argument LambdaNet is consumed by the operation and is no more usable.
argument
- an argument LambdaNet.
java.lang.IllegalArgumentException
- if the argument LambdaNet is this LambdaNet.public void buildApplication(LambdaNet argument, int functionExponent)
Transforms this LambdaNet in such a way that its represented lambda term "t" is replaced by the application "(t^n)u" where "u" is the lambda term represented by the given LambdaNet and "n" an exponent.
The argument LambdaNet is consumed by the operation and is no more usable.
argument
- an argument LambdaNet.functionExponent
- a function exponent
java.lang.IllegalArgumentException
- if the argument LambdaNet is this LambdaNet or if the
function exponent is lesser than one.public int reduceUntilInterfaceNormalForm(int maxStepCount, int[] interactionStat) throws TooMuchReductionStepException
Post-condition: the body port is a principal Port or a free Port.
maxStepCount
- a maximun step count. A negative value means no limit.interactionStat
- an array of interaction type count. May be null.
TooMuchReductionStepException
- if the given maximum count of step is not sufficient to
obtain an interface normal form.public Term readBack(boolean inNormalForm, int maxStepCount, int[] interactionStat) throws TooMuchReductionStepException
Pre-condition: this LambdaNet must have no free variable.
inNormalForm
- if true then returns a Term in normal form.maxStepCount
- a maximum step count. A negative value means no limit.interactionStat
- an array of interaction type count. May be null.
java.lang.IllegalStateException
- if this LambdaNet has free variable(s).
TooMuchReductionStepException
- if the given maximum count of step is not sufficient to
obtain a normal form or an interface normal form.public boolean booleanValue(int[] interactionStat)
interactionStat
- an array of interaction type count. May be null.
java.lang.IllegalStateException
- if this LambdaNet doesn't represent a boolean value or if it
has free variable(s).public long numeralValue(int[] interactionStat)
interactionStat
- an array of interaction type count. May be null.
java.lang.IllegalStateException
- if this LambdaNet doesn't represent a numeral value or if it
has free variable(s).
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |