Class CFGFixpoint.CompoundState<A extends AbstractState<A>>
- java.lang.Object
-
- it.unive.lisa.program.cfg.fixpoints.CFGFixpoint.CompoundState<A>
-
- Type Parameters:
A
- the type ofAbstractState
contained into the analysis state
- All Implemented Interfaces:
Lattice<CFGFixpoint.CompoundState<A>>
,StructuredObject
- Enclosing class:
- CFGFixpoint<A extends AbstractState<A>>
public static final class CFGFixpoint.CompoundState<A extends AbstractState<A>> extends java.lang.Object implements Lattice<CFGFixpoint.CompoundState<A>>
A compound state for aStatement
, holding the post-state of the whole statement as well as the ones of the inner expressions.
-
-
Field Summary
Fields Modifier and Type Field Description StatementStore<A>
intermediateStates
The post-state of intermediate expressions.AnalysisState<A>
postState
The overall post-state of a statement.-
Fields inherited from interface it.unive.lisa.analysis.Lattice
BOTTOM_STRING, TOP_STRING
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CFGFixpoint.CompoundState<A>
bottom()
Yields the bottom element of this lattice.boolean
equals(java.lang.Object obj)
CFGFixpoint.CompoundState<A>
glb(CFGFixpoint.CompoundState<A> other)
Performs the greatest lower upper bound operation between this lattice element and the given one.int
hashCode()
boolean
isBottom()
Yieldstrue
if and only if this object represents the bottom of the lattice.boolean
isTop()
Yieldstrue
if and only if this object represents the top of the lattice.boolean
lessOrEqual(CFGFixpoint.CompoundState<A> other)
Yieldstrue
if and only if this lattice element is in relation with (usually represented through ≤) the given one.CFGFixpoint.CompoundState<A>
lub(CFGFixpoint.CompoundState<A> other)
Performs the least upper bound operation between this lattice element and the given one.CFGFixpoint.CompoundState<A>
narrowing(CFGFixpoint.CompoundState<A> other)
Performs the narrowing operation between this lattice element and the given one.static <A extends AbstractState<A>>
CFGFixpoint.CompoundState<A>of(AnalysisState<A> postState, StatementStore<A> intermediateStates)
Builds a compound state from the given post-states.StructuredRepresentation
representation()
Yields aStructuredRepresentation
of the information contained in this object's instance.CFGFixpoint.CompoundState<A>
top()
Yields the top element of this lattice.java.lang.String
toString()
CFGFixpoint.CompoundState<A>
widening(CFGFixpoint.CompoundState<A> other)
Performs the widening operation between this lattice element and the given one.
-
-
-
Field Detail
-
postState
public final AnalysisState<A extends AbstractState<A>> postState
The overall post-state of a statement.
-
intermediateStates
public final StatementStore<A extends AbstractState<A>> intermediateStates
The post-state of intermediate expressions.
-
-
Method Detail
-
of
public static <A extends AbstractState<A>> CFGFixpoint.CompoundState<A> of(AnalysisState<A> postState, StatementStore<A> intermediateStates)
Builds a compound state from the given post-states.- Type Parameters:
A
- the type ofAbstractState
contained into the analysis state- Parameters:
postState
- the overall post-state of a statementintermediateStates
- the post-state of intermediate expressions- Returns:
- the generated compound state
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
lessOrEqual
public boolean lessOrEqual(CFGFixpoint.CompoundState<A> other) throws SemanticException
Description copied from interface:Lattice
Yieldstrue
if and only if this lattice element is in relation with (usually represented through ≤) the given one. This operation is not commutative.- Specified by:
lessOrEqual
in interfaceLattice<A extends AbstractState<A>>
- 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
public CFGFixpoint.CompoundState<A> lub(CFGFixpoint.CompoundState<A> other) throws SemanticException
Description copied from interface:Lattice
Performs the least upper bound operation between this lattice element and the given one. This operation is commutative.- Specified by:
lub
in interfaceLattice<A extends AbstractState<A>>
- Parameters:
other
- the other lattice element- Returns:
- the least upper bound
- Throws:
SemanticException
- if an error occurs during the computation
-
top
public CFGFixpoint.CompoundState<A> top()
Description copied from interface:Lattice
Yields the top element of this lattice. The returned element should be unique across different calls to this method, sinceLattice.isTop()
uses reference equality by default. If the value returned by this method is not a singleton, overrideLattice.isTop()
accordingly to provide a coherent test.- Specified by:
top
in interfaceLattice<A extends AbstractState<A>>
- Returns:
- the top element
-
isTop
public boolean isTop()
Description copied from interface:Lattice
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 byLattice.top()
, thus assuming that the top element is a singleton. If this is not the case, override this method accordingly to provide a coherent test.- Specified by:
isTop
in interfaceLattice<A extends AbstractState<A>>
- Returns:
true
if this is the top of the lattice
-
bottom
public CFGFixpoint.CompoundState<A> bottom()
Description copied from interface:Lattice
Yields the bottom element of this lattice. The returned element should be unique across different calls to this method, sinceLattice.isBottom()
uses reference equality by default. If the value returned by this method is not a singleton, overrideLattice.isBottom()
accordingly to provide a coherent test.- Specified by:
bottom
in interfaceLattice<A extends AbstractState<A>>
- Returns:
- the bottom element
-
isBottom
public boolean isBottom()
Description copied from interface:Lattice
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 byLattice.bottom()
, thus assuming that the bottom element is a singleton. If this is not the case, override this method accordingly to provide a coherent test.- Specified by:
isBottom
in interfaceLattice<A extends AbstractState<A>>
- Returns:
true
if this is the bottom of the lattice
-
glb
public CFGFixpoint.CompoundState<A> glb(CFGFixpoint.CompoundState<A> other) throws SemanticException
Description copied from interface:Lattice
Performs the greatest lower upper bound operation between this lattice element and the given one. This operation is commutative.- Specified by:
glb
in interfaceLattice<A extends AbstractState<A>>
- Parameters:
other
- the other lattice element- Returns:
- the greatest lower bound
- Throws:
SemanticException
- if an error occurs during the computation
-
narrowing
public CFGFixpoint.CompoundState<A> narrowing(CFGFixpoint.CompoundState<A> other) throws SemanticException
Description copied from interface:Lattice
Performs the narrowing operation between this lattice element and the given one. This operation is not commutative. The default implementation of this method delegates toLattice.glb(Lattice)
, and is thus safe for finite lattices and DCC ones.- Specified by:
narrowing
in interfaceLattice<A extends AbstractState<A>>
- Parameters:
other
- the other lattice element- Returns:
- the narrowing between this and other
- Throws:
SemanticException
- if an error occurs during the computation
-
widening
public CFGFixpoint.CompoundState<A> widening(CFGFixpoint.CompoundState<A> other) throws SemanticException
Description copied from interface:Lattice
Performs the widening operation between this lattice element and the given one. This operation is not commutative. The default implementation of this method delegates toLattice.lub(Lattice)
, and is thus safe for finite lattices and ACC ones.- Specified by:
widening
in interfaceLattice<A extends AbstractState<A>>
- Parameters:
other
- the other lattice element- Returns:
- the widening between this and other
- Throws:
SemanticException
- if an error occurs during the computation
-
representation
public StructuredRepresentation representation()
Description copied from interface:StructuredObject
Yields aStructuredRepresentation
of the information contained in this object's instance.- Specified by:
representation
in interfaceStructuredObject
- Returns:
- the representation
-
-