Package com.ibm.wala.ipa.slicer
Class Slicer
- java.lang.Object
-
- com.ibm.wala.ipa.slicer.Slicer
-
public class Slicer extends Object
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 Classes Modifier and Type Class Description static class
Slicer.ControlDependenceOptions
options to control control dependence edges in the sdgstatic class
Slicer.DataDependenceOptions
options to control data dependence edges in the SDGstatic class
Slicer.SliceProblem
Tabulation problem representing slicing
-
Constructor Summary
Constructors Constructor Description Slicer()
-
Method Summary
-
-
-
Field Detail
-
DEBUG
public static final boolean DEBUG
- See Also:
- Constant Field Values
-
VERBOSE
public static final boolean VERBOSE
- See Also:
- Constant Field Values
-
-
Method Detail
-
computeBackwardSlice
public static Collection<Statement> computeBackwardSlice(Statement s, CallGraph cg, PointerAnalysis<InstanceKey> pa, Slicer.DataDependenceOptions dOptions, Slicer.ControlDependenceOptions cOptions) throws IllegalArgumentException, CancelException
- Parameters:
s
- a statement of interest- Returns:
- the backward slice of s.
- Throws:
CancelException
IllegalArgumentException
-
computeForwardSlice
public static Collection<Statement> computeForwardSlice(Statement s, CallGraph cg, PointerAnalysis<InstanceKey> pa, Slicer.DataDependenceOptions dOptions, Slicer.ControlDependenceOptions cOptions) throws IllegalArgumentException, CancelException
- Parameters:
s
- a statement of interest- Returns:
- the forward slice of s.
- Throws:
CancelException
IllegalArgumentException
-
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
Statement
s 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:
CancelException
IllegalArgumentException
-
-