Class Slicer
java.lang.Object
com.ibm.wala.ipa.slicer.Slicer
A demand-driven context-sensitive slicer.
This computes a context-sensitive slice, building an SDG and finding realizable paths to a statement using tabulation.
This implementation uses a preliminary pointer analysis to compute data dependence between heap locations in the SDG.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumoptions to control control dependence edges in the sdgstatic enumoptions to control data dependence edges in the SDGstatic classTabulation problem representing slicing -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Collection<Statement> computeBackwardSlice(SDG<?> sdg, Statement s) Use the passed-in SDGstatic Collection<Statement> computeBackwardSlice(SDG<?> sdg, Collection<Statement> ss) Use the passed-in SDGstatic Collection<Statement> computeBackwardSlice(Statement s, CallGraph cg, PointerAnalysis<InstanceKey> pointerAnalysis) static <U extends InstanceKey>
Collection<Statement> computeBackwardSlice(Statement s, CallGraph cg, PointerAnalysis<U> pa, Slicer.DataDependenceOptions dOptions, Slicer.ControlDependenceOptions cOptions) static Collection<Statement> computeForwardSlice(SDG<?> sdg, Statement s) Use the passed-in SDGstatic <U extends InstanceKey>
Collection<Statement> computeForwardSlice(Statement s, CallGraph cg, PointerAnalysis<U> pa, Slicer.DataDependenceOptions dOptions, Slicer.ControlDependenceOptions cOptions) protected static Collection<Statement> computeSlice(SDG<?> sdg, Collection<Statement> ss, boolean backward) protected Slicer.SliceProblemmakeSliceProblem(Collection<Statement> roots, ISDG sdgView, boolean backward) Return an object which encapsulates the tabulation logic for the slice problem.slice(SDG<?> sdg, Collection<Statement> roots, boolean backward) Main driver logic.slice(SDG<?> sdg, Collection<Statement> roots, boolean backward, MonitorUtil.IProgressMonitor monitor) Main driver logic.
-
Field Details
-
DEBUG
public static final boolean DEBUG- See Also:
-
VERBOSE
public static final boolean VERBOSE- See Also:
-
-
Constructor Details
-
Slicer
public Slicer()
-
-
Method Details
-
computeBackwardSlice
public static <U extends InstanceKey> Collection<Statement> computeBackwardSlice(Statement s, CallGraph cg, PointerAnalysis<U> pa, Slicer.DataDependenceOptions dOptions, Slicer.ControlDependenceOptions cOptions) throws IllegalArgumentException, CancelException - Parameters:
s- a statement of interest- Returns:
- the backward slice of s.
- Throws:
IllegalArgumentExceptionCancelException
-
computeForwardSlice
public static <U extends InstanceKey> Collection<Statement> computeForwardSlice(Statement s, CallGraph cg, PointerAnalysis<U> pa, Slicer.DataDependenceOptions dOptions, Slicer.ControlDependenceOptions cOptions) throws IllegalArgumentException, CancelException - Parameters:
s- a statement of interest- Returns:
- the forward slice of s.
- Throws:
IllegalArgumentExceptionCancelException
-
computeBackwardSlice
public static Collection<Statement> computeBackwardSlice(SDG<?> sdg, Statement s) throws IllegalArgumentException, CancelException Use the passed-in SDG -
computeForwardSlice
public static Collection<Statement> computeForwardSlice(SDG<?> sdg, Statement s) throws IllegalArgumentException, CancelException Use the passed-in SDG -
computeBackwardSlice
public static Collection<Statement> computeBackwardSlice(SDG<?> sdg, Collection<Statement> ss) throws IllegalArgumentException, CancelException Use the passed-in SDG -
computeSlice
protected static Collection<Statement> computeSlice(SDG<?> sdg, Collection<Statement> ss, boolean backward) throws CancelException - Parameters:
ss- a collection of statements of interest- Throws:
CancelException
-
slice
public Collection<Statement> slice(SDG<?> sdg, Collection<Statement> roots, boolean backward) throws CancelException Main driver logic.- Parameters:
sdg- governing system dependence graphroots- set of roots to slice frombackward- do a backwards slice?- Returns:
- the
Statements found by the slicer - Throws:
CancelException
-
slice
public Collection<Statement> slice(SDG<?> sdg, Collection<Statement> roots, boolean backward, MonitorUtil.IProgressMonitor monitor) throws CancelException Main driver logic.- Parameters:
sdg- governing system dependence graphroots- set of roots to slice frombackward- do a backwards slice?monitor- to cancel analysis if needed- Returns:
- the
Statements found by the slicer - Throws:
CancelException
-
makeSliceProblem
protected Slicer.SliceProblem makeSliceProblem(Collection<Statement> roots, ISDG sdgView, boolean backward) Return an object which encapsulates the tabulation logic for the slice problem. Subclasses can override this method to implement special semantics. -
computeBackwardSlice
public static Collection<Statement> computeBackwardSlice(Statement s, CallGraph cg, PointerAnalysis<InstanceKey> pointerAnalysis) throws IllegalArgumentException, CancelException - Parameters:
s- a statement of interest- Returns:
- the backward slice of s.
- Throws:
IllegalArgumentExceptionCancelException
-