Package it.unive.lisa.interprocedural
Interface InterproceduralAnalysis<A extends AbstractState<A,H,V,T>,H extends HeapDomain<H>,V extends ValueDomain<V>,T extends TypeDomain<T>>
-
- Type Parameters:
A
- the type ofAbstractState
contained into the analysis stateH
- the type ofHeapDomain
contained into the computed abstract stateV
- the type ofValueDomain
contained into the computed abstract stateT
- the type ofTypeDomain
contained into the computed abstract state
public interface InterproceduralAnalysis<A extends AbstractState<A,H,V,T>,H extends HeapDomain<H>,V extends ValueDomain<V>,T extends TypeDomain<T>>
The definition of interprocedural analyses.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
fixpoint(AnalysisState<A,H,V,T> entryState, java.lang.Class<? extends WorkingSet<Statement>> fixpointWorkingSet, int wideningThreshold)
Computes a fixpoint over the whole control flow graph, producing aCFGWithAnalysisResults
for eachCFG
contained in this analysis.AnalysisState<A,H,V,T>
getAbstractResultOf(CFGCall call, AnalysisState<A,H,V,T> entryState, ExpressionSet<SymbolicExpression>[] parameters, StatementStore<A,H,V,T> expressions)
Computes an analysis state that abstracts the execution of the possible targets considering that they were givenparameters
as actual parameters, and the state when the call is executed isentryState
.
Note that the interprocedural analysis is also responsible for registering the call to theCallGraph
, if needed.AnalysisState<A,H,V,T>
getAbstractResultOf(OpenCall call, AnalysisState<A,H,V,T> entryState, ExpressionSet<SymbolicExpression>[] parameters, StatementStore<A,H,V,T> expressions)
Computes an analysis state that abstracts the execution of an unknown target considering that they were givenparameters
as actual parameters, and the state when the call is executed isentryState
.java.util.Collection<CFGWithAnalysisResults<A,H,V,T>>
getAnalysisResultsOf(CFG cfg)
Yields the results of the given analysis, identified by its class, on the givenCFG
.void
init(Application app, CallGraph callgraph, OpenCallPolicy policy)
Initializes the interprocedural analysis of the given program.Call
resolve(UnresolvedCall call, java.util.Set<Type>[] types, SymbolAliasing aliasing)
Yields aCall
implementation that corresponds to the resolution of the givenUnresolvedCall
.
-
-
-
Method Detail
-
init
void init(Application app, CallGraph callgraph, OpenCallPolicy policy) throws InterproceduralAnalysisException
Initializes the interprocedural analysis of the given program.- Parameters:
callgraph
- the callgraph used to resolve method callsapp
- the application to analyzepolicy
- theOpenCallPolicy
to be used for computing the result ofOpenCall
s- Throws:
InterproceduralAnalysisException
- if an exception happens while performing the interprocedural analysis
-
fixpoint
void fixpoint(AnalysisState<A,H,V,T> entryState, java.lang.Class<? extends WorkingSet<Statement>> fixpointWorkingSet, int wideningThreshold) throws FixpointException
Computes a fixpoint over the whole control flow graph, producing aCFGWithAnalysisResults
for eachCFG
contained in this analysis. Each result is computed withCFG.fixpoint(AnalysisState, InterproceduralAnalysis, WorkingSet, int)
or one of its overloads. Results of individual cfgs are then available throughgetAnalysisResultsOf(CFG)
.- Parameters:
entryState
- the entry state for theCFG
s that are the entrypoints of the computationfixpointWorkingSet
- the concrete class ofWorkingSet
to be used in fixpoints.wideningThreshold
- the number of fixpoint iteration on a given node after which calls toLattice.lub(Lattice)
gets replaced withLattice.widening(Lattice)
.- Throws:
FixpointException
- if something goes wrong while evaluating the fixpoint
-
getAnalysisResultsOf
java.util.Collection<CFGWithAnalysisResults<A,H,V,T>> getAnalysisResultsOf(CFG cfg)
Yields the results of the given analysis, identified by its class, on the givenCFG
. Results are provided asCFGWithAnalysisResults
.- Parameters:
cfg
- the cfg whose fixpoint results needs to be retrieved- Returns:
- the result of the fixpoint computation of
valueDomain
overcfg
-
getAbstractResultOf
AnalysisState<A,H,V,T> getAbstractResultOf(CFGCall call, AnalysisState<A,H,V,T> entryState, ExpressionSet<SymbolicExpression>[] parameters, StatementStore<A,H,V,T> expressions) throws SemanticException
Computes an analysis state that abstracts the execution of the possible targets considering that they were givenparameters
as actual parameters, and the state when the call is executed isentryState
.
Note that the interprocedural analysis is also responsible for registering the call to theCallGraph
, if needed.- Parameters:
call
- the call to evaluateentryState
- the abstract analysis state when the call is reachedparameters
- the expressions representing the actual parameters of the callexpressions
- the cache where analysis states of intermediate expressions must be stored- Returns:
- an abstract analysis state representing the abstract result of
the cfg call. The
AnalysisState.getComputedExpressions()
will contain anIdentifier
pointing to the meta variable containing the abstraction of the returned value, if any - Throws:
SemanticException
- if something goes wrong during the computation
-
getAbstractResultOf
AnalysisState<A,H,V,T> getAbstractResultOf(OpenCall call, AnalysisState<A,H,V,T> entryState, ExpressionSet<SymbolicExpression>[] parameters, StatementStore<A,H,V,T> expressions) throws SemanticException
Computes an analysis state that abstracts the execution of an unknown target considering that they were givenparameters
as actual parameters, and the state when the call is executed isentryState
.- Parameters:
call
- the call to evaluateentryState
- the abstract analysis state when the call is reachedparameters
- the expressions representing the actual parameters of the callexpressions
- the cache where analysis states of intermediate expressions must be stored- Returns:
- an abstract analysis state representing the abstract result of
the open call. The
AnalysisState.getComputedExpressions()
will contain anIdentifier
pointing to the meta variable containing the abstraction of the returned value, if any - Throws:
SemanticException
- if something goes wrong during the computation
-
resolve
Call resolve(UnresolvedCall call, java.util.Set<Type>[] types, SymbolAliasing aliasing) throws CallResolutionException
Yields aCall
implementation that corresponds to the resolution of the givenUnresolvedCall
. This method will forward the call toCallGraph.resolve(UnresolvedCall, Set[], SymbolAliasing)
if needed.- Parameters:
call
- the call to resolvetypes
- the runtime types of the parameters of the callaliasing
- the symbol aliasing information- Returns:
- a collection of all the possible runtime targets
- Throws:
CallResolutionException
- if this analysis is unable to resolve the given call
-
-