Class ModularWorstCaseAnalysis<A extends AbstractState<A,H,V>,H extends HeapDomain<H>,V extends ValueDomain<V>>
- java.lang.Object
-
- it.unive.lisa.interprocedural.impl.ModularWorstCaseAnalysis<A,H,V>
-
- Type Parameters:
A- the abstract state of the analysisH- the heap domainV- the value domain
- All Implemented Interfaces:
InterproceduralAnalysis<A,H,V>
public class ModularWorstCaseAnalysis<A extends AbstractState<A,H,V>,H extends HeapDomain<H>,V extends ValueDomain<V>> extends java.lang.Object implements InterproceduralAnalysis<A,H,V>
A worst case modular analysis were all method calls return top.
-
-
Constructor Summary
Constructors Constructor Description ModularWorstCaseAnalysis()Builds the call graph.
-
Method Summary
All Methods Instance Methods Concrete 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
-
fixpoint
public final void fixpoint(AnalysisState<A,H,V> entryState, java.lang.Class<? extends WorkingSet<Statement>> fixpointWorkingSet, int wideningThreshold) throws FixpointException
Description copied from interface:InterproceduralAnalysisComputes 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 throughInterproceduralAnalysis.getAnalysisResultsOf(CFG).- Specified by:
fixpointin interfaceInterproceduralAnalysis<A extends AbstractState<A,H,V>,H extends HeapDomain<H>,V extends ValueDomain<V>>- 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
public final java.util.Collection<CFGWithAnalysisResults<A,H,V>> getAnalysisResultsOf(CFG cfg)
Description copied from interface:InterproceduralAnalysisYields the results of the given analysis, identified by its class, on the givenCFG. Results are provided asCFGWithAnalysisResults.- Specified by:
getAnalysisResultsOfin interfaceInterproceduralAnalysis<A extends AbstractState<A,H,V>,H extends HeapDomain<H>,V extends ValueDomain<V>>- Parameters:
cfg- the cfg whose fixpoint results needs to be retrieved- Returns:
- the result of the fixpoint computation of
valueDomainovercfg
-
getAbstractResultOf
public final AnalysisState<A,H,V> getAbstractResultOf(CFGCall call, AnalysisState<A,H,V> entryState, ExpressionSet<SymbolicExpression>[] parameters) throws SemanticException
Description copied from interface:InterproceduralAnalysisResolves 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.- Specified by:
getAbstractResultOfin interfaceInterproceduralAnalysis<A extends AbstractState<A,H,V>,H extends HeapDomain<H>,V extends ValueDomain<V>>- 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
-
init
public void init(Program program, CallGraph callgraph) throws InterproceduralAnalysisException
Description copied from interface:InterproceduralAnalysisInitializes the interprocedural analysis of the given program.- Specified by:
initin interfaceInterproceduralAnalysis<A extends AbstractState<A,H,V>,H extends HeapDomain<H>,V extends ValueDomain<V>>- Parameters:
program- the programcallgraph- the callgraph used to resolve method calls- Throws:
InterproceduralAnalysisException- if an exception happens while performing the interprocedural analysis
-
resolve
public Call resolve(UnresolvedCall unresolvedCall) throws CallResolutionException
Description copied from interface:InterproceduralAnalysisYields 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.
- Specified by:
resolvein interfaceInterproceduralAnalysis<A extends AbstractState<A,H,V>,H extends HeapDomain<H>,V extends ValueDomain<V>>- 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
-
-