public class DemandRefinementPointsTo extends AbstractDemandPointsTo
Modifier and Type | Class and Description |
---|---|
protected class |
DemandRefinementPointsTo.FlowsToComputer
used to compute "flows-to sets," i.e., all the pointers that can point to some instance key
|
protected class |
DemandRefinementPointsTo.PointsToComputer
Points-to analysis algorithm code.
|
static class |
DemandRefinementPointsTo.PointsToResult
Possible results of a query.
|
Modifier and Type | Field and Description |
---|---|
protected IFlowGraph |
g |
long |
lastQueryMemoryUse
to measure memory usage
|
protected RefinementPolicy |
refinementPolicy |
cg, cha, heapModel, mam, numNodesTraversed, options
getBaseCallGraph, getClassHierarchy, getHeapModel, getNumNodesTraversed, getTraversalBudget, incrementNumNodesTraversed, setNumNodesTraversed, setTraversalBudget
protected final IFlowGraph g
protected RefinementPolicy refinementPolicy
public long lastQueryMemoryUse
public RefinementPolicy getRefinementPolicy()
protected void startNewQuery()
public Pair<DemandRefinementPointsTo.PointsToResult,Collection<InstanceKey>> getPointsTo(PointerKey pk, Predicate<InstanceKey> ikeyPred) throws IllegalArgumentException
pk
- the pointer keyikeyPred
- the desired predicate that each instance key in the points-to set should ideally satisfyDemandRefinementPointsTo.PointsToResult
indicating whether a points-to set satisfying the predicate was
computed, and (2) the last computed points-to set for the variable (possibly null
if no points-to set
could be computed in the budget)IllegalArgumentException
- if pk
is not a LocalPointerKey
; to eventually be fixedpublic static DemandRefinementPointsTo makeWithDefaultFlowGraph(CallGraph cg, HeapModel model, MemoryAccessMap mam, IClassHierarchy cha, AnalysisOptions options, StateMachineFactory<IFlowLabel> stateMachineFactory)
cg
- the underlying call graph for the analysismodel
- the heap model to be used for the analysismam
- indicates what code reads or writes each fieldcha
- options
- stateMachineFactory
- factory for state machines to track additional properties like calling contextpublic DemandRefinementPointsTo.PointsToResult pointsToPassesPred(PointerKey pk, Predicate<InstanceKey> ikeyPred, PointerAnalysis<InstanceKey> pa) throws IllegalArgumentException
pk
- the pointer keyikeyPred
- the desired predicate that each instance key in the points-to set should ideally satisfypa
- a pre-computed points-to analysisDemandRefinementPointsTo.PointsToResult
indicating whether a points-to set satisfying the predicate was computedIllegalArgumentException
- if pk
is not a LocalPointerKey
; to eventually be fixedpublic Collection<InstanceKey> getPointsTo(PointerKey pk)
pk
, or null
if the points-to set can't be computed in the allocated
budgetpublic Collection<InstanceKeyAndState> getPointsToWithStates(PointerKey pk)
pk
, including the StateMachine.State
s attached to the InstanceKey
s, or
null
if the points-to set can't be computed in the allocated budgetpublic Pair<DemandRefinementPointsTo.PointsToResult,Collection<PointerKey>> getFlowsTo(InstanceKey ik)
DemandRefinementPointsTo.PointsToResult
indicating whether a flows-to set was computed, and (2) the last
computed flows-to set for the instance key (possibly null
if no flows-to set could be computed in the
budget)public Pair<DemandRefinementPointsTo.PointsToResult,Collection<PointerKey>> getFlowsTo(InstanceKeyAndState ikAndState)
DemandRefinementPointsTo.PointsToResult
indicating whether a flows-to set was computed, and (2) the last
computed flows-to set for the instance key (possibly null
if no flows-to set could be computed in the
budget)public StateMachineFactory<IFlowLabel> getStateMachineFactory()
public void setStateMachineFactory(StateMachineFactory<IFlowLabel> stateMachineFactory)
public RefinementPolicyFactory getRefinementPolicyFactory()
public void setRefinementPolicyFactory(RefinementPolicyFactory refinementPolicyFactory)