Package proguard.analysis.cpa.bam
Class BamCpa<CfaNodeT extends CfaNode<CfaEdgeT,SignatureT>,CfaEdgeT extends CfaEdge<CfaNodeT>,SignatureT extends Signature>
- java.lang.Object
-
- proguard.analysis.cpa.bam.BamCpa<CfaNodeT,CfaEdgeT,SignatureT>
-
- All Implemented Interfaces:
ConfigurableProgramAnalysis
public class BamCpa<CfaNodeT extends CfaNode<CfaEdgeT,SignatureT>,CfaEdgeT extends CfaEdge<CfaNodeT>,SignatureT extends Signature> extends java.lang.Object implements ConfigurableProgramAnalysis
AConfigurableProgramAnalysis
for 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-dependentCpaWithBamOperators
that 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
BamTransferRelation
for details) that is able to extend the analysis of the wrapped CPA to the inter-procedural level.
-
-
Constructor Summary
Constructors Constructor Description BamCpa(BamTransferRelation<CfaNodeT,CfaEdgeT,SignatureT> transferRelation)
Create a BamCpa with a specific transfer relation.BamCpa(CpaWithBamOperators<CfaNodeT,CfaEdgeT,SignatureT> wrappedCpa, Cfa<CfaNodeT,CfaEdgeT,SignatureT> cfa, SignatureT mainFunction, BamCache<SignatureT> cache)
Create a BamCpa with default transfer relation.BamCpa(CpaWithBamOperators<CfaNodeT,CfaEdgeT,SignatureT> wrappedCpa, Cfa<CfaNodeT,CfaEdgeT,SignatureT> cfa, SignatureT mainFunction, BamCache<SignatureT> cache, int maxCallStackDepth, AbortOperator abortOperator)
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 AbstractDomain
getAbstractDomain()
Returns the abstract domain of the wrapped CPA.BamCache<SignatureT>
getCache()
Returns the BAM cache used by the CPA.Cfa<CfaNodeT,CfaEdgeT,SignatureT>
getCfa()
Returns the CFA used by the CPA.ExpandOperator<CfaNodeT,CfaEdgeT,SignatureT>
getExpandOperator()
Returns the expand operator of the wrapped CPA.MergeOperator
getMergeOperator()
Returns the merge operator of the wrapped CPA.PrecisionAdjustment
getPrecisionAdjustment()
Returns the precision adjustment of the wrapped CPA.RebuildOperator
getRebuildOperator()
Returns the rebuild operator of the wrapped CPA.ReduceOperator<CfaNodeT,CfaEdgeT,SignatureT>
getReduceOperator()
Returns the reduce operator of the wrapped CPA.StopOperator
getStopOperator()
Returns the stop operator of the wrapped CPA.BamTransferRelation<CfaNodeT,CfaEdgeT,SignatureT>
getTransferRelation()
Returns the BAM transfer relation, more details inBamTransferRelation
.
-
-
-
Constructor Detail
-
BamCpa
public BamCpa(CpaWithBamOperators<CfaNodeT,CfaEdgeT,SignatureT> wrappedCpa, Cfa<CfaNodeT,CfaEdgeT,SignatureT> cfa, SignatureT mainFunction, BamCache<SignatureT> 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<CfaNodeT,CfaEdgeT,SignatureT> wrappedCpa, Cfa<CfaNodeT,CfaEdgeT,SignatureT> cfa, SignatureT mainFunction, BamCache<SignatureT> cache, int maxCallStackDepth, AbortOperator abortOperator)
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.abortOperator
- an abort operator used for computing block abstractions
-
BamCpa
public BamCpa(BamTransferRelation<CfaNodeT,CfaEdgeT,SignatureT> transferRelation)
Create a BamCpa with a specific transfer relation. Use this constructor if a custom transfer relation is needed (e.g. with different internal waitlist/reached set implementations).- Parameters:
transferRelation
- The transfer relation of the BamCpa
-
-
Method Detail
-
getAbstractDomain
public AbstractDomain getAbstractDomain()
Returns the abstract domain of the wrapped CPA.- Specified by:
getAbstractDomain
in interfaceConfigurableProgramAnalysis
-
getTransferRelation
public BamTransferRelation<CfaNodeT,CfaEdgeT,SignatureT> getTransferRelation()
Returns the BAM transfer relation, more details inBamTransferRelation
.- Specified by:
getTransferRelation
in interfaceConfigurableProgramAnalysis
-
getMergeOperator
public MergeOperator getMergeOperator()
Returns the merge operator of the wrapped CPA.- Specified by:
getMergeOperator
in interfaceConfigurableProgramAnalysis
-
getStopOperator
public StopOperator getStopOperator()
Returns the stop operator of the wrapped CPA.- Specified by:
getStopOperator
in interfaceConfigurableProgramAnalysis
-
getPrecisionAdjustment
public PrecisionAdjustment getPrecisionAdjustment()
Returns the precision adjustment of the wrapped CPA.- Specified by:
getPrecisionAdjustment
in interfaceConfigurableProgramAnalysis
-
getReduceOperator
public ReduceOperator<CfaNodeT,CfaEdgeT,SignatureT> getReduceOperator()
Returns the reduce operator of the wrapped CPA.
-
getExpandOperator
public ExpandOperator<CfaNodeT,CfaEdgeT,SignatureT> getExpandOperator()
Returns the expand operator of the wrapped CPA.
-
getRebuildOperator
public RebuildOperator getRebuildOperator()
Returns the rebuild operator of the wrapped CPA.
-
getCache
public BamCache<SignatureT> getCache()
Returns the BAM cache used by the CPA.
-
getCfa
public Cfa<CfaNodeT,CfaEdgeT,SignatureT> getCfa()
Returns the CFA used by the CPA.
-
-