Class ContextBasedAnalysis<A extends AbstractState<A,H,V>,H extends HeapDomain<H>,V extends ValueDomain<V>>
- java.lang.Object
-
- it.unive.lisa.interprocedural.impl.CallGraphBasedAnalysis<A,H,V>
-
- it.unive.lisa.interprocedural.impl.ContextBasedAnalysis<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 ContextBasedAnalysis<A extends AbstractState<A,H,V>,H extends HeapDomain<H>,V extends ValueDomain<V>> extends CallGraphBasedAnalysis<A,H,V>
A context sensitive interprocedural analysis. The context sensitivity is tuned by the kind ofContextSensitivityTokenused.
-
-
Field Summary
-
Fields inherited from class it.unive.lisa.interprocedural.impl.CallGraphBasedAnalysis
callgraph, program
-
-
Constructor Summary
Constructors Constructor Description ContextBasedAnalysis()Builds the analysis, usingSingleScopeTokens.ContextBasedAnalysis(ContextSensitivityToken token)Builds the analysis.
-
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.-
Methods inherited from class it.unive.lisa.interprocedural.impl.CallGraphBasedAnalysis
init, prepareEntryStateOfEntryPoint, resolve
-
-
-
-
Constructor Detail
-
ContextBasedAnalysis
public ContextBasedAnalysis()
Builds the analysis, usingSingleScopeTokens.
-
ContextBasedAnalysis
public ContextBasedAnalysis(ContextSensitivityToken token)
Builds the analysis.- Parameters:
token- an instance of the tokens to be used to partition w.r.t. context sensitivity
-
-
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).- 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.- 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.- 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
-
-