edu.cmu.cs.crystal.flow
Interface IAbstractLatticeOperations<LE,N>

Type Parameters:
LE - Analysis information being tracked.
N - Nodes our lattice information is computed over
All Known Subinterfaces:
ILatticeOperations<LE>
All Known Implementing Classes:
BooleanConstantLatticeOps, LatticeElementOps, LiveVariableLatticeOps, SimpleLatticeOperations, SingleObjectAliasOps, TupleLatticeOperations

public interface IAbstractLatticeOperations<LE,N>

Analysis writers do not implement this interface directly; instead, they implement an extending interface that instantiates the node type parameter, N of this interface. This interface allows implementing a worklist algorithm independently from the type of node being transferred over. Implementers of flow analyses over concrete node types should create a sub-interface that instantiates the node type parameter. ILatticeOperations is such a sub-interface for flow analyses over Eclise AST nodes. WorklistTemplate can be used as the basis for flow analyses over other kinds of nodes.

Since:
Crystal 3.4.0
Author:
Kevin Bierhoff
See Also:
WorklistTemplate, ILatticeOperations

Method Summary
 boolean atLeastAsPrecise(LE info, LE reference, N 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, N node)
          Carries out a join on this lattice and another lattice.
 

Method Detail

bottom

LE bottom()
Responsible for returning a lattice that represents no knowledge.

Returns:
the lattice that represents "bottom"

join

LE join(LE someInfo,
        LE otherInfo,
        N 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:
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.
Returns:
the resulting LE that has the combined knowledge

atLeastAsPrecise

boolean atLeastAsPrecise(LE info,
                         LE reference,
                         N node)
Compares analysis information for precision; more precisely, determines whether the first argument is at least as precise as the second. This method is used by the framework to compare analysis information.

Parameters:
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.
Returns:
true if the first argument is at least as precise as the second; false otherwise, including if the two arguments are incomparable.

copy

LE copy(LE original)
Creates a new deep copy of the given analysis information. "Deep copy" means that all mutable (changeable) objects referenced by the given LE must not be referenced by the returned LE.

Parameters:
original - analysis information to be copied.
Returns:
a copy of the argument that contains no references to mutable objects found in the original.