tip.cfg
Interface Lattice<T>

Type Parameters:
T - the type of the lattice elements
All Superinterfaces:
Equalitor<T>
All Known Implementing Classes:
ConstantPropagationAnalysis.ConstLattice, DivisionAnalysis.Div, IntersectionSetLattice, IntervalAnalysis.Interval, MapLattice, NullPointerAnalysis.NullLattice, SignAnalysis.SignLattice, UnionSetLattice

public interface Lattice<T>
extends Equalitor<T>

Lattice defines the interface for a lattice with element type T.

Author:
Johnni Winther

Method Summary
 T getLeastUpperBound(T a, T b)
          Returns the least upper bound of the lattice elements a and b.
 T getSmallestElement()
          Returns the smallest element of the lattice.
 
Methods inherited from interface tip.util.Equalitor
equals, hashCode
 

Method Detail

getSmallestElement

T getSmallestElement()
Returns the smallest element of the lattice. Beware that if the lattice elements are mutable, getSmallestElement must return a cloned element.

Returns:
the smallest element of the lattice

getLeastUpperBound

T getLeastUpperBound(T a,
                     T b)
Returns the least upper bound of the lattice elements a and b. Beware that if the lattice elements are mutable, getLeastUpperBound must return a cloned or new element. The method must handle the case where a or b are null.

Parameters:
a - the first element
b - the second element
Returns:
the least upper bound of the first and second element