Class FixpointResults<A extends AbstractState<A,H,V>,H extends HeapDomain<H>,V extends ValueDomain<V>>
- java.lang.Object
-
- it.unive.lisa.analysis.BaseLattice<F>
-
- it.unive.lisa.analysis.lattices.FunctionalLattice<FixpointResults<A,H,V>,CFG,CFGResults<A,H,V>>
-
- it.unive.lisa.interprocedural.impl.FixpointResults<A,H,V>
-
- Type Parameters:
A- the type ofAbstractStatecontained into the analysis stateH- the type ofHeapDomaincontained into the computed abstract stateV- the type ofValueDomaincontained into the computed abstract state
- All Implemented Interfaces:
Lattice<FixpointResults<A,H,V>>,java.lang.Iterable<java.util.Map.Entry<CFG,CFGResults<A,H,V>>>
public class FixpointResults<A extends AbstractState<A,H,V>,H extends HeapDomain<H>,V extends ValueDomain<V>> extends FunctionalLattice<FixpointResults<A,H,V>,CFG,CFGResults<A,H,V>>
AFunctionalLatticefromCFGs toCFGResultss. This class is meant to store all fixpoint results on all token generated during the interprocedural analysis for each cfg under analysis.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class it.unive.lisa.analysis.lattices.FunctionalLattice
FunctionalLattice.FunctionalLift<V extends Lattice<V>>, FunctionalLattice.KeyFunctionalLift<K>
-
-
Field Summary
-
Fields inherited from class it.unive.lisa.analysis.lattices.FunctionalLattice
function, lattice
-
Fields inherited from interface it.unive.lisa.analysis.Lattice
BOTTOM_REPR, BOTTOM_STRING, TOP_REPR, TOP_STRING
-
-
Constructor Summary
Constructors Constructor Description FixpointResults(CFGResults<A,H,V> lattice)Builds a new result.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FixpointResults<A,H,V>bottom()Yields the bottom element of this lattice.booleancontains(CFG cfg)Yieldstrueif a result exists for the givencfg.voidforget(CFG cfg)Forgets all results about the givenCFG.booleanisBottom()Yieldstrueif and only if this object represents the bottom of the lattice.booleanisTop()Yieldstrueif and only if this object represents the top of the lattice.protected FixpointResults<A,H,V>mk(CFGResults<A,H,V> lattice, java.util.Map<CFG,CFGResults<A,H,V>> function)Builds a instance of this class from the given lattice instance and the given mapping.org.apache.commons.lang3.tuple.Pair<java.lang.Boolean,CFGWithAnalysisResults<A,H,V>>putResult(CFG cfg, ContextSensitivityToken token, CFGWithAnalysisResults<A,H,V> result)Stores the result of a fixpoint computation on a cfg.FixpointResults<A,H,V>top()Yields the top element of this lattice.-
Methods inherited from class it.unive.lisa.analysis.lattices.FunctionalLattice
equals, functionalLift, getKeys, getMap, getState, getValues, glbKeys, hashCode, iterator, lessOrEqualAux, lubAux, lubKeys, mkNewFunction, putState, toString, wideningAux
-
Methods inherited from class it.unive.lisa.analysis.BaseLattice
lessOrEqual, lub, widening
-
-
-
-
Constructor Detail
-
FixpointResults
public FixpointResults(CFGResults<A,H,V> lattice)
Builds a new result.- Parameters:
lattice- a singleton instance used for retrieving top and bottom values
-
-
Method Detail
-
putResult
public org.apache.commons.lang3.tuple.Pair<java.lang.Boolean,CFGWithAnalysisResults<A,H,V>> putResult(CFG cfg, ContextSensitivityToken token, CFGWithAnalysisResults<A,H,V> result) throws SemanticException
Stores the result of a fixpoint computation on a cfg. This method returns the result of callingCFGResults.putResult(ContextSensitivityToken, CFGWithAnalysisResults)with the giventokenandresulton theCFGResultsinstance corresponding tocfg.- Parameters:
cfg- theCFGon which the result has been computedtoken- theContextSensitivityTokenthat identifying the resultresult- theCFGWithAnalysisResultsto store- Returns:
- the result of the update operation on the individual cfg result
- Throws:
SemanticException- if something goes wrong during the update
-
contains
public boolean contains(CFG cfg)
Yieldstrueif a result exists for the givencfg.- Parameters:
cfg- theCFGwhose result is to be checked- Returns:
trueif that condition holds
-
top
public FixpointResults<A,H,V> top()
Description copied from interface:LatticeYields 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.- Returns:
- the top element
-
isTop
public boolean isTop()
Description copied from interface:LatticeYieldstrueif and only if this object represents the top of the lattice. The default implementation of this method uses reference equality betweenthisand 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.- Returns:
trueif this is the top of the lattice
-
bottom
public FixpointResults<A,H,V> bottom()
Description copied from interface:LatticeYields 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.- Returns:
- the bottom element
-
isBottom
public boolean isBottom()
Description copied from interface:LatticeYieldstrueif and only if this object represents the bottom of the lattice. The default implementation of this method uses reference equality betweenthisand 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.- Returns:
trueif this is the bottom of the lattice
-
forget
public void forget(CFG cfg)
Forgets all results about the givenCFG.- Parameters:
cfg- the cfg to forget
-
mk
protected FixpointResults<A,H,V> mk(CFGResults<A,H,V> lattice, java.util.Map<CFG,CFGResults<A,H,V>> function)
Description copied from class:FunctionalLatticeBuilds a instance of this class from the given lattice instance and the given mapping.- Specified by:
mkin classFunctionalLattice<FixpointResults<A extends AbstractState<A,H,V>,H extends HeapDomain<H>,V extends ValueDomain<V>>,CFG,CFGResults<A extends AbstractState<A,H,V>,H extends HeapDomain<H>,V extends ValueDomain<V>>>- Parameters:
lattice- an instance of lattice to be used during semantic operations to retrieve top and bottom valuesfunction- the function representing the mapping contained in the new environment; can benull- Returns:
- a new instance of this class
-
-