|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.evelopers.unimod.analysis.TermSimplifier
com.evelopers.unimod.analysis.ASTTermSimplifier
| Nested Class Summary | |
protected class |
TermSimplifier.BooleanLiteral
|
protected class |
TermSimplifier.IntervalLiteral
|
| Field Summary | |
(package private) antlr.ASTFactory |
astFactory
|
| Constructor Summary | |
ASTTermSimplifier(antlr.collections.AST inputTerm,
antlr.ASTFactory astFactory)
|
|
ASTTermSimplifier(antlr.ASTFactory astFactory)
|
|
ASTTermSimplifier(TermSimplifier that,
antlr.ASTFactory astFactory)
|
|
| Method Summary | |
protected void |
addASTIntervalChildren(Range.Interval interval,
IdentNode templateIdentNode,
antlr.collections.AST term)
|
protected void |
addASTRangeChildren(Range range,
IdentNode templateIdentNode,
antlr.collections.AST term)
|
protected void |
addBooleanChildren(antlr.collections.AST term)
|
protected void |
addIntervalChildren(antlr.collections.AST term)
|
java.util.Iterator |
booleanVariablesIterator()
|
protected void |
checkIdenticalFalse(boolean identicalFalse)
|
protected antlr.collections.AST |
createEQ_AST(IdentNode templateIdentNode,
int rightConst)
|
protected IdentNode |
createIdentNode(Action action)
|
protected antlr.collections.AST |
createLE_AST(IdentNode templateIdentNode,
int rightConst)
|
protected antlr.collections.AST |
createLE_AST(int leftConst,
IdentNode templateIdentNode)
|
protected antlr.collections.AST |
createNEQ_AST(IdentNode templateIdentNode,
int rightConst)
|
boolean |
dependsOn(Action action)
|
Range |
getRange(Action var)
Gets the array of intervals for variable action. |
antlr.collections.AST |
getSimplifiedTerm()
|
java.util.Iterator |
intervalVariablesIterator()
|
boolean |
isIdenticalFalse()
|
boolean |
isIdenticalTrue()
|
boolean |
isNegated(Action var)
Checks if variable action is in the term with negation |
boolean |
put(Action var,
boolean isNegated)
Puts variable action or it's nigation |
boolean |
put(Action var,
int relation,
int value)
Intersects interval of action with it's current interval.
|
protected void |
put(antlr.collections.AST literal)
|
boolean |
put(int booleanConst)
Tests if booleanConst is true or false. |
boolean |
put(int value,
int relation,
Action var)
Reverse version of TermSimplifier.put(Action, boolean) |
boolean |
put(int leftConst,
int relation,
int rightConst)
Tests relation between two consts. |
void |
setTerm(antlr.collections.AST inputTerm)
|
java.lang.String |
toString()
|
java.util.Iterator |
variablesIterator()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
antlr.ASTFactory astFactory
| Constructor Detail |
public ASTTermSimplifier(TermSimplifier that,
antlr.ASTFactory astFactory)
public ASTTermSimplifier(antlr.ASTFactory astFactory)
public ASTTermSimplifier(antlr.collections.AST inputTerm,
antlr.ASTFactory astFactory)
throws InterpreterException,
antlr.RecognitionException
| Method Detail |
public void setTerm(antlr.collections.AST inputTerm)
throws InterpreterException,
antlr.RecognitionException
InterpreterException
antlr.RecognitionExceptionpublic antlr.collections.AST getSimplifiedTerm()
protected void put(antlr.collections.AST literal)
throws antlr.RecognitionException,
InterpreterException
antlr.RecognitionException
InterpreterExceptionprotected void addIntervalChildren(antlr.collections.AST term)
protected void addBooleanChildren(antlr.collections.AST term)
protected IdentNode createIdentNode(Action action)
protected void addASTRangeChildren(Range range,
IdentNode templateIdentNode,
antlr.collections.AST term)
protected void addASTIntervalChildren(Range.Interval interval,
IdentNode templateIdentNode,
antlr.collections.AST term)
protected antlr.collections.AST createLE_AST(int leftConst,
IdentNode templateIdentNode)
protected antlr.collections.AST createLE_AST(IdentNode templateIdentNode,
int rightConst)
protected antlr.collections.AST createEQ_AST(IdentNode templateIdentNode,
int rightConst)
protected antlr.collections.AST createNEQ_AST(IdentNode templateIdentNode,
int rightConst)
public boolean put(Action var,
boolean isNegated)
throws InterpreterException
action or it's nigation
var - variable to putisNegated - if it is true then negation of action will be putted
InterpreterException
public boolean put(Action var,
int relation,
int value)
throws InterpreterException
action with it's current interval.
By default an interval of each variable is
[Interval.MIN, Interval.MAX].
var - name of interval variablerelation - type of relation of action with value.
Should be one of:
- ExprTokenTypes.GT
- ExprTokenTypes.LT
- ExprTokenTypes.GE
- ExprTokenTypes.LE
- ExprTokenTypes.EQUAL
- ExprTokenTypes.NEQUAL
value - limit of interval for action
InterpreterException
public boolean put(int value,
int relation,
Action var)
throws InterpreterException
TermSimplifier.put(Action, boolean)
InterpreterExceptionpublic boolean put(int booleanConst)
booleanConst is true or false. If it is true it is skipped. If
it is false then whole term should be false.
booleanConst - boolean constant to test
public boolean put(int leftConst,
int relation,
int rightConst)
throws InterpreterException
leftConst - constant on the left side of the relationrelation - relation to testrightConst - constant on the right side of the relation
InterpreterExceptionpublic java.util.Iterator booleanVariablesIterator()
TermSimplifier.isNegated(com.evelopers.unimod.core.stateworks.Action)public java.util.Iterator intervalVariablesIterator()
TermSimplifier.getRange(com.evelopers.unimod.core.stateworks.Action action)public java.util.Iterator variablesIterator()
TermSimplifier.getRange(com.evelopers.unimod.core.stateworks.Action action)public boolean dependsOn(Action action)
public boolean isIdenticalFalse()
public boolean isIdenticalTrue()
public boolean isNegated(Action var)
throws java.lang.IndexOutOfBoundsException,
InterpreterException
action is in the term with negation
action is in the term with negation
java.lang.IndexOutOfBoundsException - if action is not in the term
InterpreterException - if action is not boolean variableTermSimplifier.booleanVariablesIterator()
public Range getRange(Action var)
throws java.lang.IndexOutOfBoundsException,
InterpreterException
action. This interval represent range
for variable var.
java.lang.IndexOutOfBoundsException - if there is no variable action in this term
InterpreterException - if action is not interval variableTermSimplifier.intervalVariablesIterator()public java.lang.String toString()
protected void checkIdenticalFalse(boolean identicalFalse)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||