Package proguard.analysis.cpa.bam
Class BamCpa<ContentT extends AbstractState<ContentT>>
- java.lang.Object
-
- proguard.analysis.cpa.bam.BamCpa<ContentT>
-
- Type Parameters:
ContentT- > The content of the jvm states produced by the transfer relation. For example, this can be aSetAbstractStateof taints for taint analysis or aValueAbstractStatefor value analysis.
- All Implemented Interfaces:
ConfigurableProgramAnalysis<JvmAbstractState<ContentT>>
public class BamCpa<ContentT extends AbstractState<ContentT>> extends java.lang.Object implements ConfigurableProgramAnalysis<JvmAbstractState<ContentT>>
AConfigurableProgramAnalysisfor inter-procedural analysis using block abstraction memoization as described in {@see https://dl.acm.org/doi/pdf/10.1145/3368089.3409718}, which is defined by a domain-dependentCpaWithBamOperatorsthat adds three operators: reduce, expand, and rebuild. This allows an inter-procedural analysis running this CPA to be conducted by the standardCpaAlgorithm.A BAM CPA works on a domain-independent level and its abstract domain, merge operator, and stop operator are defined by the domain-dependent wrapped CPA. The main feature of a BAM CPA is its transfer relation (see
BamTransferRelationfor details) that is able to extend the analysis of the wrapped CPA to the inter-procedural level.
-
-
Constructor Summary
Constructors Constructor Description BamCpa(CpaWithBamOperators<ContentT> wrappedCpa, JvmCfa cfa, MethodSignature mainFunction, BamCache<ContentT> cache)Create a BamCpa with default transfer relation.BamCpa(CpaWithBamOperators<ContentT> wrappedCpa, JvmCfa cfa, MethodSignature mainFunction, BamCache<ContentT> cache, int maxCallStackDepth)Create a BamCpa with default transfer relation with a limited call depth.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull AbortOperatorgetAbortOperator()BamCache<ContentT>getCache()Returns the BAM cache used by the CPA.JvmCfagetCfa()Returns the CFA used by the CPA.ExpandOperator<ContentT>getExpandOperator()Returns the expand operator of the wrapped CPA.TransferRelation<JvmAbstractState<ContentT>>getIntraproceduralTransferRelation()Returns the transfer relation of the interprocedural CPA wrapped by the BamCpa.@NotNull MergeOperator<JvmAbstractState<ContentT>>getMergeOperator()Returns the merge operator of the wrapped CPA.@NotNull PrecisionAdjustmentgetPrecisionAdjustment()Returns the precision adjustment of the wrapped CPA.RebuildOperatorgetRebuildOperator()Returns the rebuild operator of the wrapped CPA.ReduceOperator<ContentT>getReduceOperator()Returns the reduce operator of the wrapped CPA.@NotNull StopOperator<JvmAbstractState<ContentT>>getStopOperator()Returns the stop operator of the wrapped CPA.@NotNull BamTransferRelation<ContentT>getTransferRelation()Returns the BAM transfer relation, more details inBamTransferRelation.
-
-
-
Constructor Detail
-
BamCpa
public BamCpa(CpaWithBamOperators<ContentT> wrappedCpa, JvmCfa cfa, MethodSignature mainFunction, BamCache<ContentT> cache)
Create a BamCpa with default transfer relation.- Parameters:
wrappedCpa- a wrapped CPA with BAM operatorscfa- a control flow automatonmainFunction- the signature of the main function of an analyzed programcache- a cache for the block abstractions
-
BamCpa
public BamCpa(CpaWithBamOperators<ContentT> wrappedCpa, JvmCfa cfa, MethodSignature mainFunction, BamCache<ContentT> cache, int maxCallStackDepth)
Create a BamCpa with default transfer relation with a limited call depth. At the maximum call depth further function calls are just analyzed intra-procedurally.- Parameters:
wrappedCpa- a wrapped cpa with BAM operatorscfa- a control flow automatonmainFunction- the signature of a main functioncache- a cache for the block abstractionsmaxCallStackDepth- maximum depth of the call stack analyzed inter-procedurally. 0 means intra-procedural analysis. < 0 means no maximum depth.
-
-
Method Detail
-
getTransferRelation
@NotNull public @NotNull BamTransferRelation<ContentT> getTransferRelation()
Returns the BAM transfer relation, more details inBamTransferRelation.- Specified by:
getTransferRelationin interfaceConfigurableProgramAnalysis<ContentT extends AbstractState<ContentT>>
-
getMergeOperator
@NotNull public @NotNull MergeOperator<JvmAbstractState<ContentT>> getMergeOperator()
Returns the merge operator of the wrapped CPA.- Specified by:
getMergeOperatorin interfaceConfigurableProgramAnalysis<ContentT extends AbstractState<ContentT>>
-
getStopOperator
@NotNull public @NotNull StopOperator<JvmAbstractState<ContentT>> getStopOperator()
Returns the stop operator of the wrapped CPA.- Specified by:
getStopOperatorin interfaceConfigurableProgramAnalysis<ContentT extends AbstractState<ContentT>>
-
getPrecisionAdjustment
@NotNull public @NotNull PrecisionAdjustment getPrecisionAdjustment()
Returns the precision adjustment of the wrapped CPA.- Specified by:
getPrecisionAdjustmentin interfaceConfigurableProgramAnalysis<ContentT extends AbstractState<ContentT>>
-
getAbortOperator
@NotNull public @NotNull AbortOperator getAbortOperator()
- Specified by:
getAbortOperatorin interfaceConfigurableProgramAnalysis<ContentT extends AbstractState<ContentT>>
-
getReduceOperator
public ReduceOperator<ContentT> getReduceOperator()
Returns the reduce operator of the wrapped CPA.
-
getExpandOperator
public ExpandOperator<ContentT> getExpandOperator()
Returns the expand operator of the wrapped CPA.
-
getRebuildOperator
public RebuildOperator getRebuildOperator()
Returns the rebuild operator of the wrapped CPA.
-
getCfa
public JvmCfa getCfa()
Returns the CFA used by the CPA.
-
getIntraproceduralTransferRelation
public TransferRelation<JvmAbstractState<ContentT>> getIntraproceduralTransferRelation()
Returns the transfer relation of the interprocedural CPA wrapped by the BamCpa.This transfer relation is used to analyze all non-call instructions and call instructions that cannot be analyzed inter-procedurally (e.g., because their code is not available or because the maximum analysis depth has been reached).
-
-