|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.evelopers.unimod.analysis.TermSimplifier
TermSimplifier represents a term. Different types of literals may be put using method
put()
. TermSimplifier controls:
isIdenticalFalse
. To iterate
boolean and interval variables use booleanVariablesIterator()
and
intervalVariablesIterator()
. To find out if boolean variable enters with negation
use isNegated()
. To get range of interval variable use getIntervals()
.
Nested Class Summary | |
protected class |
TermSimplifier.BooleanLiteral
|
protected class |
TermSimplifier.IntervalLiteral
|
Constructor Summary | |
TermSimplifier()
Default constructor |
|
TermSimplifier(TermSimplifier that)
Copy constuctor |
Method Summary | |
java.util.Iterator |
booleanVariablesIterator()
|
protected void |
checkIdenticalFalse(boolean identicalFalse)
|
boolean |
dependsOn(Action action)
|
Range |
getRange(Action var)
Gets the array of intervals for variable action . |
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.
|
boolean |
put(int booleanConst)
Tests if booleanConst is true or false. |
boolean |
put(int value,
int relation,
Action var)
Reverse version of put(Action, boolean) |
boolean |
put(int leftConst,
int relation,
int rightConst)
Tests relation between two consts. |
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 |
Constructor Detail |
public TermSimplifier()
public TermSimplifier(TermSimplifier that)
that
- instance to copyMethod Detail |
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
put(Action, boolean)
InterpreterException
public 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
InterpreterException
public java.util.Iterator booleanVariablesIterator()
isNegated(com.evelopers.unimod.core.stateworks.Action)
public java.util.Iterator intervalVariablesIterator()
getRange(com.evelopers.unimod.core.stateworks.Action action)
public java.util.Iterator variablesIterator()
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 variablebooleanVariablesIterator()
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 variableintervalVariablesIterator()
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 |