Package it.unive.lisa.analysis
Interface Lattice<L extends Lattice<L>>
-
- Type Parameters:
L
- the concreteLattice
instance
- All Superinterfaces:
StructuredObject
- All Known Subinterfaces:
AbstractState<A>
,BaseHeapDomain<H>
,BaseInferredValue<T>
,BaseLattice<L>
,BaseNonRelationalTypeDomain<T>
,BaseNonRelationalValueDomain<T>
,HeapDomain<D>
,InferredValue<T>
,NonRelationalDomain<T,E,F>
,NonRelationalElement<T,E,F>
,NonRelationalHeapDomain<T>
,NonRelationalTypeDomain<T>
,NonRelationalValueDomain<T>
,TypeDomain<T>
,ValueDomain<D>
- All Known Implementing Classes:
Aliases
,AnalysisState
,AnalyzedCFG
,BackwardAnalyzedCFG
,BackwardOptimizedAnalyzedCFG
,CFGFixpoint.CompoundState
,CFGResults
,DataflowDomain
,DefiniteDataflowDomain
,Environment
,ExpressionInverseSet
,ExpressionSet
,FixpointInfo
,FixpointResults
,FunctionalLattice
,GenericInverseSetLattice
,GenericMapLattice
,GenericSetLattice
,HeapEnvironment
,InferenceSystem
,InferredValue.InferredPair
,InverseSetLattice
,OptimizedAnalyzedCFG
,PossibleDataflowDomain
,Satisfiability
,SetLattice
,StatementStore
,SymbolAliasing
,TypeEnvironment
,ValueEnvironment
,VariableLift
public interface Lattice<L extends Lattice<L>> extends StructuredObject
An interface for elements that follow a lattice structure. Implementers of this interface should inherit fromBaseLattice
, unless explicitly needed.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
BOTTOM_STRING
A string constant that can be used to represent bottom values.static java.lang.String
TOP_STRING
A string constant that can be used to represent top values.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description L
bottom()
Yields the bottom element of this lattice.static StructuredRepresentation
bottomRepresentation()
Yields a freshStructuredRepresentation
that can be used to represent bottom values throughStructuredObject.representation()
.default L
glb(L other)
Performs the greatest lower upper bound operation between this lattice element and the given one.default boolean
isBottom()
Yieldstrue
if and only if this object represents the bottom of the lattice.default boolean
isTop()
Yieldstrue
if and only if this object represents the top of the lattice.boolean
lessOrEqual(L other)
Yieldstrue
if and only if this lattice element is in relation with (usually represented through ≤) the given one.L
lub(L other)
Performs the least upper bound operation between this lattice element and the given one.default L
narrowing(L other)
Performs the narrowing operation between this lattice element and the given one.L
top()
Yields the top element of this lattice.static StructuredRepresentation
topRepresentation()
Yields a freshStructuredRepresentation
that can be used to represent top values throughStructuredObject.representation()
.default L
widening(L other)
Performs the widening operation between this lattice element and the given one.-
Methods inherited from interface it.unive.lisa.util.representation.StructuredObject
representation
-
-
-
-
Field Detail
-
TOP_STRING
static final java.lang.String TOP_STRING
A string constant that can be used to represent top values.- See Also:
- Constant Field Values
-
BOTTOM_STRING
static final java.lang.String BOTTOM_STRING
A string constant that can be used to represent bottom values.- See Also:
- Constant Field Values
-
-
Method Detail
-
topRepresentation
static StructuredRepresentation topRepresentation()
Yields a freshStructuredRepresentation
that can be used to represent top values throughStructuredObject.representation()
.- Returns:
- the representation
-
bottomRepresentation
static StructuredRepresentation bottomRepresentation()
Yields a freshStructuredRepresentation
that can be used to represent bottom values throughStructuredObject.representation()
.- Returns:
- the representation
-
lessOrEqual
boolean lessOrEqual(L other) throws SemanticException
Yieldstrue
if and only if this lattice element is in relation with (usually represented through ≤) the given one. This operation is not commutative.- Parameters:
other
- the other lattice element- Returns:
true
if and only if that condition holds- Throws:
SemanticException
- if an error occurs during the computation
-
lub
L lub(L other) throws SemanticException
Performs the least upper bound operation between this lattice element and the given one. This operation is commutative.- Parameters:
other
- the other lattice element- Returns:
- the least upper bound
- Throws:
SemanticException
- if an error occurs during the computation
-
glb
default L glb(L other) throws SemanticException
Performs the greatest lower upper bound operation between this lattice element and the given one. This operation is commutative.- Parameters:
other
- the other lattice element- Returns:
- the greatest lower bound
- Throws:
SemanticException
- if an error occurs during the computation
-
top
L top()
Yields the top element of this lattice. The returned element should be unique across different calls to this method, sinceisTop()
uses reference equality by default. If the value returned by this method is not a singleton, overrideisTop()
accordingly to provide a coherent test.- Returns:
- the top element
-
bottom
L bottom()
Yields the bottom element of this lattice. The returned element should be unique across different calls to this method, sinceisBottom()
uses reference equality by default. If the value returned by this method is not a singleton, overrideisBottom()
accordingly to provide a coherent test.- Returns:
- the bottom element
-
isTop
default boolean isTop()
Yieldstrue
if and only if this object represents the top of the lattice. The default implementation of this method uses reference equality betweenthis
and the value returned bytop()
, thus assuming that the top element is a singleton. If this is not the case, override this method accordingly to provide a coherent test.- Returns:
true
if this is the top of the lattice
-
isBottom
default boolean isBottom()
Yieldstrue
if and only if this object represents the bottom of the lattice. The default implementation of this method uses reference equality betweenthis
and the value returned bybottom()
, thus assuming that the bottom element is a singleton. If this is not the case, override this method accordingly to provide a coherent test.- Returns:
true
if this is the bottom of the lattice
-
widening
default L widening(L other) throws SemanticException
Performs the widening operation between this lattice element and the given one. This operation is not commutative. The default implementation of this method delegates tolub(Lattice)
, and is thus safe for finite lattices and ACC ones.- Parameters:
other
- the other lattice element- Returns:
- the widening between this and other
- Throws:
SemanticException
- if an error occurs during the computation
-
narrowing
default L narrowing(L other) throws SemanticException
Performs the narrowing operation between this lattice element and the given one. This operation is not commutative. The default implementation of this method delegates toglb(Lattice)
, and is thus safe for finite lattices and DCC ones.- Parameters:
other
- the other lattice element- Returns:
- the narrowing between this and other
- Throws:
SemanticException
- if an error occurs during the computation
-
-