public class Slicer
extends java.lang.Object
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.
| Modifier and Type | Class and Description |
|---|---|
static class |
Slicer.ControlDependenceOptions
options to control control dependence edges in the sdg
|
static class |
Slicer.DataDependenceOptions
options to control data dependence edges in the SDG
|
static class |
Slicer.SliceProblem
Tabulation problem representing slicing
|
| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEBUG |
static boolean |
VERBOSE |
| Constructor and Description |
|---|
Slicer() |
| Modifier and Type | Method and Description |
|---|---|
static java.util.Collection<Statement> |
computeBackwardSlice(SDG<?> sdg,
java.util.Collection<Statement> ss)
Use the passed-in SDG
|
static java.util.Collection<Statement> |
computeBackwardSlice(SDG<?> sdg,
Statement s)
Use the passed-in SDG
|
static java.util.Collection<Statement> |
computeBackwardSlice(Statement s,
CallGraph cg,
PointerAnalysis<InstanceKey> pointerAnalysis) |
static <U extends InstanceKey> |
computeBackwardSlice(Statement s,
CallGraph cg,
PointerAnalysis<U> pa,
Slicer.DataDependenceOptions dOptions,
Slicer.ControlDependenceOptions cOptions) |
static java.util.Collection<Statement> |
computeForwardSlice(SDG<?> sdg,
Statement s)
Use the passed-in SDG
|
static <U extends InstanceKey> |
computeForwardSlice(Statement s,
CallGraph cg,
PointerAnalysis<U> pa,
Slicer.DataDependenceOptions dOptions,
Slicer.ControlDependenceOptions cOptions) |
protected static java.util.Collection<Statement> |
computeSlice(SDG<?> sdg,
java.util.Collection<Statement> ss,
boolean backward) |
protected Slicer.SliceProblem |
makeSliceProblem(java.util.Collection<Statement> roots,
ISDG sdgView,
boolean backward)
Return an object which encapsulates the tabulation logic for the slice problem.
|
java.util.Collection<Statement> |
slice(SDG<?> sdg,
java.util.Collection<Statement> roots,
boolean backward)
Main driver logic.
|
java.util.Collection<Statement> |
slice(SDG<?> sdg,
java.util.Collection<Statement> roots,
boolean backward,
com.ibm.wala.util.MonitorUtil.IProgressMonitor monitor)
Main driver logic.
|
public static final boolean DEBUG
public static final boolean VERBOSE
public static <U extends InstanceKey> java.util.Collection<Statement> computeBackwardSlice(Statement s, CallGraph cg, PointerAnalysis<U> pa, Slicer.DataDependenceOptions dOptions, Slicer.ControlDependenceOptions cOptions) throws java.lang.IllegalArgumentException, com.ibm.wala.util.CancelException
s - a statement of interestjava.lang.IllegalArgumentExceptioncom.ibm.wala.util.CancelExceptionpublic static <U extends InstanceKey> java.util.Collection<Statement> computeForwardSlice(Statement s, CallGraph cg, PointerAnalysis<U> pa, Slicer.DataDependenceOptions dOptions, Slicer.ControlDependenceOptions cOptions) throws java.lang.IllegalArgumentException, com.ibm.wala.util.CancelException
s - a statement of interestjava.lang.IllegalArgumentExceptioncom.ibm.wala.util.CancelExceptionpublic static java.util.Collection<Statement> computeBackwardSlice(SDG<?> sdg, Statement s) throws java.lang.IllegalArgumentException, com.ibm.wala.util.CancelException
java.lang.IllegalArgumentExceptioncom.ibm.wala.util.CancelExceptionpublic static java.util.Collection<Statement> computeForwardSlice(SDG<?> sdg, Statement s) throws java.lang.IllegalArgumentException, com.ibm.wala.util.CancelException
java.lang.IllegalArgumentExceptioncom.ibm.wala.util.CancelExceptionpublic static java.util.Collection<Statement> computeBackwardSlice(SDG<?> sdg, java.util.Collection<Statement> ss) throws java.lang.IllegalArgumentException, com.ibm.wala.util.CancelException
java.lang.IllegalArgumentExceptioncom.ibm.wala.util.CancelExceptionprotected static java.util.Collection<Statement> computeSlice(SDG<?> sdg, java.util.Collection<Statement> ss, boolean backward) throws com.ibm.wala.util.CancelException
ss - a collection of statements of interestcom.ibm.wala.util.CancelExceptionpublic java.util.Collection<Statement> slice(SDG<?> sdg, java.util.Collection<Statement> roots, boolean backward) throws com.ibm.wala.util.CancelException
sdg - governing system dependence graphroots - set of roots to slice frombackward - do a backwards slice?Statements found by the slicercom.ibm.wala.util.CancelExceptionpublic java.util.Collection<Statement> slice(SDG<?> sdg, java.util.Collection<Statement> roots, boolean backward, com.ibm.wala.util.MonitorUtil.IProgressMonitor monitor) throws com.ibm.wala.util.CancelException
sdg - governing system dependence graphroots - set of roots to slice frombackward - do a backwards slice?monitor - to cancel analysis if neededStatements found by the slicercom.ibm.wala.util.CancelExceptionprotected Slicer.SliceProblem makeSliceProblem(java.util.Collection<Statement> roots, ISDG sdgView, boolean backward)
public static java.util.Collection<Statement> computeBackwardSlice(Statement s, CallGraph cg, PointerAnalysis<InstanceKey> pointerAnalysis) throws java.lang.IllegalArgumentException, com.ibm.wala.util.CancelException
s - a statement of interestjava.lang.IllegalArgumentExceptioncom.ibm.wala.util.CancelException