edu.cmu.cs.crystal.bridge
Interface LatticeElement<LE extends LatticeElement<LE>>

Type Parameters:
LE - the LatticeElement implementation that represents the analysis knowledge
All Superinterfaces:
Copyable<LE>

public interface LatticeElement<LE extends LatticeElement<LE>>
extends Copyable<LE>

This class is not to be used in new Crystal analyses and is kept for older projects only. A LatticeElement embodies the analysis knowledge at a particular point in the program. LatticeElementOps allows using classes implementing this interface in a Crystal flow analysis. For simple lattices, this interface may be sufficient. This interface is in particular useful for lattices which have a fixed number of elements in them. More sophisticated lattices are probably easier to implement using ILatticeOperations directly. Furthermore, lattices based on existing datatypes such as Set are more easily implemented with ILatticeOperations.

Author:
David Dickey, Jonathan Aldrich

Method Summary
 boolean atLeastAsPrecise(LE other, ASTNode node)
          Compares LatticeElements for precision.
 LE join(LE other, ASTNode node)
          Carries out a join on this lattice and another lattice.
 
Methods inherited from interface edu.cmu.cs.crystal.util.Copyable
copy
 

Method Detail

join

LE join(LE other,
        ASTNode node)
Carries out a join on this lattice and another lattice. 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.

Parameters:
other - 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.
Returns:
the resulting LE that has the combined knowledge

atLeastAsPrecise

boolean atLeastAsPrecise(LE other,
                         ASTNode node)
Compares LatticeElements for precision. This method is used by the framework to compare two LatticeElements.

Parameters:
other - the other LE to compare
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.
Returns:
true if this is at least as precise. false if other is more precise