|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
LE
- Analysis information being tracked.public interface ILatticeOperations<LE>
Implement this interface to provide typical lattice operations.
Instances of this interface are used by Crystal flow analyses to compare
and join analysis-specific information.
This interface is parameterized by the type used to represent values in
the lattice.
Notice that there are no assumptions being made about the lattice values,
which allows using existing types such as Set
.
Crystal encourages including analysis-specific operations into classes
implementing this interfaces, but this is not required.
Lattices are defined with four methods:
bottom()
represents the most precise lattice value. (There is
no direct way of acquiring Top.)
atLeastAsPrecise(Object, Object, ASTNode)
compares two lattice values.
join(Object, Object, ASTNode)
approximates two lattice values
by one that is less precise than both given.
copy(Object)
duplicates a lattice value. This is an implementation
device that is needed because flow analyses derive lattice values for new program
points from lattice values for program points that were already analyzed.
Method Summary | |
---|---|
boolean |
atLeastAsPrecise(LE info,
LE reference,
ASTNode node)
Compares analysis information for precision; more precisely, determines whether the first argument is at least as precise as the second. |
LE |
bottom()
Responsible for returning a lattice that represents no knowledge. |
LE |
copy(LE original)
Creates a new deep copy of the given analysis information. |
LE |
join(LE someInfo,
LE otherInfo,
ASTNode node)
Carries out a join on this lattice and another lattice. |
Method Detail |
---|
LE bottom()
bottom
in interface IAbstractLatticeOperations<LE,ASTNode>
LE join(LE someInfo, LE otherInfo, ASTNode node)
join
in interface IAbstractLatticeOperations<LE,ASTNode>
someInfo
- LE to join with otherInfo
.otherInfo
- The other LE to join with, do not modify.node
- ASTNode where the two paths were originally forked apart (e.g., if,
while, try, switch, etc.) or null
if this join occurs on a "dummy" node.
boolean atLeastAsPrecise(LE info, LE reference, ASTNode node)
atLeastAsPrecise
in interface IAbstractLatticeOperations<LE,ASTNode>
info
- Analysis information to be compared against reference
reference
- the other LE to compare info
with.node
- ASTNode where the two paths were originally forked apart (e.g., if,
while, try, switch, etc.) or null
if this comparison occurs on a "dummy" node.
true
if the first argument is at least as precise as the
second; false
otherwise, including if the two arguments are incomparable.LE copy(LE original)
copy
in interface IAbstractLatticeOperations<LE,ASTNode>
original
- analysis information to be copied.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |