edu.cmu.cs.crystal.analysis.live
Class LiveVariableLatticeOps

java.lang.Object
  extended by edu.cmu.cs.crystal.simple.SimpleLatticeOperations<LiveVariableLE>
      extended by edu.cmu.cs.crystal.analysis.live.LiveVariableLatticeOps
All Implemented Interfaces:
IAbstractLatticeOperations<LiveVariableLE,ASTNode>, ILatticeOperations<LiveVariableLE>

public class LiveVariableLatticeOps
extends SimpleLatticeOperations<LiveVariableLE>


Constructor Summary
LiveVariableLatticeOps()
           
 
Method Summary
 boolean atLeastAsPrecise(LiveVariableLE left, LiveVariableLE right)
          Checks to see if the left side of the operand is more precise (or as precise) as the right side.
 LiveVariableLE bottom()
          Responsible for returning a lattice that represents no knowledge.
 LiveVariableLE copy(LiveVariableLE original)
          Creates a new deep copy of the given analysis information.
 LiveVariableLE join(LiveVariableLE left, LiveVariableLE right)
          Joins the two lattice elements into an element that is as precise as possible while still being less precise than both.
 
Methods inherited from class edu.cmu.cs.crystal.simple.SimpleLatticeOperations
atLeastAsPrecise, join
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LiveVariableLatticeOps

public LiveVariableLatticeOps()
Method Detail

atLeastAsPrecise

public boolean atLeastAsPrecise(LiveVariableLE left,
                                LiveVariableLE right)
Description copied from class: SimpleLatticeOperations
Checks to see if the left side of the operand is more precise (or as precise) as the right side. Notice that in a lattice, the bottom lattice element will be more precise than everything, and top element will be less precise than everything. That is, atLeastAsPrecise(bottom, x) == true and atLeastAsPrecise(x, top) == true.

Specified by:
atLeastAsPrecise in class SimpleLatticeOperations<LiveVariableLE>
Returns:
True if left is more precise (or the same as) right, false if right is more precise or the two have no precision relationship.

bottom

public LiveVariableLE bottom()
Description copied from interface: IAbstractLatticeOperations
Responsible for returning a lattice that represents no knowledge.

Specified by:
bottom in interface IAbstractLatticeOperations<LiveVariableLE,ASTNode>
Specified by:
bottom in interface ILatticeOperations<LiveVariableLE>
Specified by:
bottom in class SimpleLatticeOperations<LiveVariableLE>
Returns:
The lattice element which is the bottom of the lattice.

copy

public LiveVariableLE copy(LiveVariableLE original)
Description copied from class: SimpleLatticeOperations
Creates a new deep copy of the given analysis information. "Deep copy" means that all mutable (changeable) objects referenced by the original must not be referenced by the copy. Notice that if your lattice is immutable (an enum, for example), then you can just return this

Specified by:
copy in interface IAbstractLatticeOperations<LiveVariableLE,ASTNode>
Specified by:
copy in interface ILatticeOperations<LiveVariableLE>
Specified by:
copy in class SimpleLatticeOperations<LiveVariableLE>
Parameters:
original - analysis information to be copied.
Returns:
a copy of the argument that contains no references to mutable objects found in the original.

join

public LiveVariableLE join(LiveVariableLE left,
                           LiveVariableLE right)
Description copied from class: SimpleLatticeOperations
Joins the two lattice elements into an element that is as precise as possible while still being less precise than both. This is a symmetric relationship. This method is called by the framework to join different flows together. For example: The lattice that follows an If statement must represent the knowledge from the true and the false paths. The join is what combines the analysis of each path together. You may modify "this" and return it, or simply create a new LE and return it. Notice that:

Specified by:
join in class SimpleLatticeOperations<LiveVariableLE>
right - DO NOT MODIFY
Returns:
A lattice element which is the join of the parameters.