|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.cmu.cs.crystal.simple.SimpleLatticeOperations<LE>
public abstract class SimpleLatticeOperations<LE>
This is the interface for the operations you must provide on your lattice in order
for the dataflow analysis to work.
To make your own lattice operations, simply derive off of this class and templatize it by
the type of lattice you are going to use. So, to make operations for a null pointer lattice,
we could declare a class like this:
public class NPELatticeOps extends SimpleLatticeOperations<NullPointerLattice>
Constructor Summary | |
---|---|
SimpleLatticeOperations()
|
Method Summary | |
---|---|
abstract boolean |
atLeastAsPrecise(LE left,
LE right)
Checks to see if the left side of the operand is more precise (or as precise) as the right side. |
boolean |
atLeastAsPrecise(LE info,
LE reference,
ASTNode node)
More complex version of atLeastAsPrecise. |
abstract LE |
bottom()
Responsible for returning a lattice that represents no knowledge. |
abstract LE |
copy(LE original)
Creates a new deep copy of the given analysis information. |
abstract LE |
join(LE left,
LE right)
Joins the two lattice elements into an element that is as precise as possible while still being less precise than both. |
LE |
join(LE someInfo,
LE otherInfo,
ASTNode node)
More complex version of join. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimpleLatticeOperations()
Method Detail |
---|
public abstract boolean atLeastAsPrecise(LE left, LE right)
atLeastAsPrecise(bottom, x) == true
and atLeastAsPrecise(x, top) == true
.
left
- right
-
public abstract LE join(LE left, LE right)
join(bottom, X) == X
)
join(top, X) == top
)
join(X, X) == X
)
join(A, B) == C
,
then atLeastAsPrecise(A, C) == true
and atLeastAsPrecise(B, C) == true
left
- right
- DO NOT MODIFY
public abstract LE bottom()
IAbstractLatticeOperations
bottom
in interface IAbstractLatticeOperations<LE,ASTNode>
bottom
in interface ILatticeOperations<LE>
public abstract LE copy(LE original)
enum
, for example), then you
can just return this
copy
in interface IAbstractLatticeOperations<LE,ASTNode>
copy
in interface ILatticeOperations<LE>
original
- analysis information to be copied.
public boolean atLeastAsPrecise(LE info, LE reference, ASTNode node)
ILatticeOperations
instead.
atLeastAsPrecise
in interface IAbstractLatticeOperations<LE,ASTNode>
atLeastAsPrecise
in interface ILatticeOperations<LE>
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.ILatticeOperations.atLeastAsPrecise(Object, Object, ASTNode)
public LE join(LE someInfo, LE otherInfo, ASTNode node)
ILatticeOperations
instead.
join
in interface IAbstractLatticeOperations<LE,ASTNode>
join
in interface ILatticeOperations<LE>
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.
ILatticeOperations.join(Object, Object, ASTNode)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |