Package com.ibm.wala.fixedpoint.impl
Class GeneralStatement<T extends IVariable<T>>
java.lang.Object
com.ibm.wala.util.graph.impl.NodeWithNumber
com.ibm.wala.fixpoint.AbstractStatement<T,AbstractOperator<T>>
com.ibm.wala.fixedpoint.impl.GeneralStatement<T>
- All Implemented Interfaces:
IFixedPointStatement<T>,INodeWithNumber
- Direct Known Subclasses:
AbstractFixedPointSolver.Statement
public abstract class GeneralStatement<T extends IVariable<T>>
extends AbstractStatement<T,AbstractOperator<T>>
Represents a single step in an iterative solver
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionGeneralStatement(T lhs, AbstractOperator<T> operator) Constructor for case of zero operands on the right-hand side.GeneralStatement(T lhs, AbstractOperator<T> operator, T[] rhs) Constructor for case of more than three operands on the right-hand side.GeneralStatement(T lhs, AbstractOperator<T> operator, T op1, T op2) Constructor for case of two operands on the right-hand side.GeneralStatement(T lhs, AbstractOperator<T> operator, T op1, T op2, T op3) Constructor for case of three operands on the right-hand side. -
Method Summary
Modifier and TypeMethodDescriptionbooleanbyteevaluate()Evaluate this equation, setting a new value for the left-hand side.getLHS()Return the left-hand side of this equation.T[]getRHS()returns the list of free variables appearing in the right-hand side of the statementinthashCode()Subclasses must implement this, to prevent non-determinism.booleanhasVariable(T cell) Does this equation contain an appearance of a given cell? Note: this uses reference equality, assuming that the variables are canonical! This is fragile.protected abstract T[]makeRHS(int size) Methods inherited from class com.ibm.wala.fixpoint.AbstractStatement
getOrderNumber, toStringMethods inherited from class com.ibm.wala.util.graph.impl.NodeWithNumber
getGraphNodeId, setGraphNodeIdMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.ibm.wala.util.graph.INodeWithNumber
getGraphNodeId, setGraphNodeId
-
Field Details
-
lhs
-
rhs
-
-
Constructor Details
-
GeneralStatement
Constructor for case of zero operands on the right-hand side.- Parameters:
lhs- the lattice cell set by this equationoperator- the equation operator
-
GeneralStatement
Constructor for case of two operands on the right-hand side.- Parameters:
lhs- the lattice cell set by this equationoperator- the equation operatorop1- the first operand on the rhsop2- the second operand on the rhs
-
GeneralStatement
Constructor for case of three operands on the right-hand side.- Parameters:
lhs- the lattice cell set by this equationoperator- the equation operatorop1- the first operand on the rhsop2- the second operand on the rhsop3- the third operand on the rhs
-
GeneralStatement
Constructor for case of more than three operands on the right-hand side.- Parameters:
lhs- the lattice cell set by this equationoperator- the equation operatorrhs- the operands of the right-hand side in order- Throws:
IllegalArgumentException- if rhs is null
-
-
Method Details
-
evaluate
public byte evaluate()Evaluate this equation, setting a new value for the left-hand side.- Returns:
- true if the lhs value changed. false otherwise
-
getLHS
Return the left-hand side of this equation.- Returns:
- the lattice cell this equation computes
-
hasVariable
Does this equation contain an appearance of a given cell? Note: this uses reference equality, assuming that the variables are canonical! This is fragile. TODO: Address it perhaps, but be careful not to sacrifice efficiency.- Parameters:
cell- the cell in question- Returns:
- true or false
-
makeRHS
-
hashCode
public int hashCode()Description copied from class:AbstractStatementSubclasses must implement this, to prevent non-determinism.- Specified by:
hashCodein classAbstractStatement<T extends IVariable<T>,AbstractOperator<T extends IVariable<T>>>
-
equals
- Specified by:
equalsin classAbstractStatement<T extends IVariable<T>,AbstractOperator<T extends IVariable<T>>>
-
getOperator
- Specified by:
getOperatorin classAbstractStatement<T extends IVariable<T>,AbstractOperator<T extends IVariable<T>>>
-
getRHS
Description copied from interface:IFixedPointStatementreturns the list of free variables appearing in the right-hand side of the statement
-