Package it.unive.lisa.interprocedural
Interface InterproceduralAnalysis<A extends AbstractState<A,H,V>,H extends HeapDomain<H>,V extends ValueDomain<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
public interface InterproceduralAnalysis<A extends AbstractState<A,H,V>,H extends HeapDomain<H>,V extends ValueDomain<V>>The definition of interprocedural analyses.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidfixpoint(AnalysisState<A,H,V> entryState, java.lang.Class<? extends WorkingSet<Statement>> fixpointWorkingSet, int wideningThreshold)Computes a fixpoint over the whole control flow graph, producing aCFGWithAnalysisResultsfor eachCFGcontained in this analysis.AnalysisState<A,H,V>getAbstractResultOf(CFGCall call, AnalysisState<A,H,V> entryState, ExpressionSet<SymbolicExpression>[] parameters)Resolves the given call to all of its possible runtime targets, and then computes an analysis state that abstracts the execution of the possible targets considering that they were givenparametersas actual parameters.java.util.Collection<CFGWithAnalysisResults<A,H,V>>getAnalysisResultsOf(CFG cfg)Yields the results of the given analysis, identified by its class, on the givenCFG.voidinit(Program program, CallGraph callgraph)Initializes the interprocedural analysis of the given program.Callresolve(UnresolvedCall unresolvedCall)Yields aCallimplementation that corresponds to the resolution of the givenUnresolvedCall.
-
-
-
Method Detail
-
init
void init(Program program, CallGraph callgraph) throws InterproceduralAnalysisException
Initializes the interprocedural analysis of the given program.- Parameters:
callgraph- the callgraph used to resolve method callsprogram- the program- Throws:
InterproceduralAnalysisException- if an exception happens while performing the interprocedural analysis
-
fixpoint
void fixpoint(AnalysisState<A,H,V> entryState, java.lang.Class<? extends WorkingSet<Statement>> fixpointWorkingSet, int wideningThreshold) throws FixpointException
Computes a fixpoint over the whole control flow graph, producing aCFGWithAnalysisResultsfor eachCFGcontained 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 theCFGs that are the entrypoints of the computationfixpointWorkingSet- the concrete class ofWorkingSetto 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>> 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
valueDomainovercfg
-
getAbstractResultOf
AnalysisState<A,H,V> getAbstractResultOf(CFGCall call, AnalysisState<A,H,V> entryState, ExpressionSet<SymbolicExpression>[] parameters) throws SemanticException
Resolves the given call to all of its possible runtime targets, and then computes an analysis state that abstracts the execution of the possible targets considering that they were givenparametersas actual parameters. The abstract value of each parameter is computed onentryState.- Parameters:
call- the call to resolve and evaluateentryState- the abstract analysis state when the call is reachedparameters- the expressions representing the actual parameters of the call- Returns:
- an abstract analysis state representing the abstract result of
the cfg call. The
AnalysisState.getComputedExpressions()will contain anIdentifierpointing to the meta variable containing the abstraction of the returned value - Throws:
SemanticException- if something goes wrong during the computation
-
resolve
Call resolve(UnresolvedCall unresolvedCall) throws CallResolutionException
Yields aCallimplementation that corresponds to the resolution of the givenUnresolvedCall. This method will return:- a
CFGCall, if at least oneCFGthat matchesUnresolvedCall.getTargetName()is found. The returnedCFGCallwill be linked to all the possible runtime targets matchingUnresolvedCall.getTargetName(); - an
OpenCall, if noCFGmatchingUnresolvedCall.getTargetName()is found.
- Parameters:
unresolvedCall- the call to resolve- Returns:
- a collection of all the possible runtime targets
- Throws:
CallResolutionException- if this analysis is unable to resolve the given call
- a
-
-