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| Modifier and Type | Method and Description |
|---|---|
com.ibm.wala.util.collections.Pair<DemandRefinementPointsTo.PointsToResult,java.util.Collection<PointerKey>> |
getFlowsTo(InstanceKey ik)
get all the pointer keys that some instance key can flow to
|
com.ibm.wala.util.collections.Pair<DemandRefinementPointsTo.PointsToResult,java.util.Collection<PointerKey>> |
getFlowsTo(InstanceKeyAndState ikAndState)
get all the pointer keys that some instance key with state can flow to
|
java.util.Collection<InstanceKey> |
getPointsTo(PointerKey pk) |
com.ibm.wala.util.collections.Pair<DemandRefinementPointsTo.PointsToResult,java.util.Collection<InstanceKey>> |
getPointsTo(PointerKey pk,
java.util.function.Predicate<InstanceKey> ikeyPred)
compute a points-to set for a pointer key, aiming to satisfy some predicate
|
java.util.Collection<InstanceKeyAndState> |
getPointsToWithStates(PointerKey pk) |
RefinementPolicy |
getRefinementPolicy() |
RefinementPolicyFactory |
getRefinementPolicyFactory() |
StateMachineFactory<IFlowLabel> |
getStateMachineFactory() |
static DemandRefinementPointsTo |
makeWithDefaultFlowGraph(CallGraph cg,
HeapModel model,
MemoryAccessMap mam,
IClassHierarchy cha,
AnalysisOptions options,
StateMachineFactory<IFlowLabel> stateMachineFactory)
create a demand points-to analysis runner
|
DemandRefinementPointsTo.PointsToResult |
pointsToPassesPred(PointerKey pk,
java.util.function.Predicate<InstanceKey> ikeyPred,
PointerAnalysis<InstanceKey> pa)
check if the points-to set of a variable passes some predicate, without necessarily computing
the whole points-to set
|
void |
setRefinementPolicyFactory(RefinementPolicyFactory refinementPolicyFactory) |
void |
setStateMachineFactory(StateMachineFactory<IFlowLabel> stateMachineFactory) |
protected void |
startNewQuery()
re-initialize state for a new query
|
getBaseCallGraph, getClassHierarchy, getHeapModel, getNumNodesTraversed, getTraversalBudget, incrementNumNodesTraversed, setNumNodesTraversed, setTraversalBudgetprotected final IFlowGraph g
protected RefinementPolicy refinementPolicy
public long lastQueryMemoryUse
public RefinementPolicy getRefinementPolicy()
protected void startNewQuery()
public com.ibm.wala.util.collections.Pair<DemandRefinementPointsTo.PointsToResult,java.util.Collection<InstanceKey>> getPointsTo(PointerKey pk, java.util.function.Predicate<InstanceKey> ikeyPred) throws java.lang.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)java.lang.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 fieldstateMachineFactory - factory for state machines to track additional properties like
calling contextpublic DemandRefinementPointsTo.PointsToResult pointsToPassesPred(PointerKey pk, java.util.function.Predicate<InstanceKey> ikeyPred, PointerAnalysis<InstanceKey> pa) throws java.lang.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 computedjava.lang.IllegalArgumentException - if pk is not a LocalPointerKey; to eventually
be fixedpublic java.util.Collection<InstanceKey> getPointsTo(PointerKey pk)
pk, or null if the points-to set can't be computed
in the allocated budgetpublic java.util.Collection<InstanceKeyAndState> getPointsToWithStates(PointerKey pk)
pk, including the StateMachine.States attached to the InstanceKeys, or null if the points-to set can't be computed in the allocated
budgetpublic com.ibm.wala.util.collections.Pair<DemandRefinementPointsTo.PointsToResult,java.util.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 com.ibm.wala.util.collections.Pair<DemandRefinementPointsTo.PointsToResult,java.util.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)