Effective Slicing - PowerPoint PPT Presentation

About This Presentation
Title:

Effective Slicing

Description:

y = 2; x = 1; read(n); Two Correct Dynamic Slices. typical ... How big are unions of relevant slices? How good an approximation can effective slicing give? ... – PowerPoint PPT presentation

Number of Views:21
Avg rating:3.0/5.0
Slides: 15
Provided by: themu2
Category:
Tags: big | effective | slicing

less

Transcript and Presenter's Notes

Title: Effective Slicing


1
  • Effective Slicing

Anne Mulhern Computer Sciences Department Universi
ty of Wisconsin-Madison Madison, WI
USA mulhern_at_cs.wisc.edu www.cs.wisc.edu/mulhern
2
Two Correct Dynamic Slices
full slice n ? 1
read(n)


if (n 1)
x 3



?x
full slice n ? 2


y 2



if (y 2)
x 2
?x
program
read(n)
x 1
y 2
if (n 1)
x 3
y 1
if (y 2)
x 2
?x
?
?
3
Union of Slices is Incorrect
full slice n ? 1,2
read(n)

y 2
if (n 1)
x 3

if (y 2)
x 2
?x
program
read(n)
x 1
y 2
if (n 1)
x 3
y 1
if (y 2)
x 2
?x
n p/s x p/s y p/s
? 1 ? ? ?
? 1 1/ ? ?
? 1 1/ ? 2 ?
? ?
? 1 3 2 ?
? 1 3 1/2
?
1 3/2 1/2 ?
3/2
4
Why is This a Problem?
  • Given a set of inputs that cause program failure
  • Want the correct slice for all failures
  • Given a flag that takes multiple values
  • Want the correct slice for whenever the flag is
    set, regardless of its value

5
Two Correct Relevant Slices
relevant slice n ? 2
read(n)

y 2
if (n 1)


if (y 2)
x 2
?x
relevant slice n ? 1
read(n)


if (n 1)
x 3
y 1
if (y 2)

?x
program
read(n)
x 1
y 2
if (n 1)
x 3
y 1
if (y 2)
x 2
?x
?
?
6
Union of Relevant Slices is Correct
relevant slice n ? 1,2
read(n)

y 2
if (n 1)
x 3
y 1
if (y 2)
x 2
?x
program
read(n)
x 1
y 2
if (n 1)
x 3
y 1
if (y 2)
x 2
?x
7
We Can Slice Twice
  • If we take the union of slices as our program and
    slice again on the same inputs
  • we may get a smaller program
  • Example the union of relevant slices for inputs
    2 and 3

8
Fixpoint Computation
relevant slice n ? 3


y 2



if (y 2)
x 2
?x
relevant slice n ? 2


y 2



if (y 2)
x 2
?x
relevant slice n ? 2,3
read(n)

y 2
if (n 1)


if (y 2)
x 2
?x
?
?
So long as n in 2,3 choice of n is unimportant
9
Effective Slicing
  • Dynamic slicing algorithms - two arguments
  • P - the program
  • s - the initial state
  • Effective slicing algorithm - an additional
    argument
  • ?? - the nodes to consider when calculating
    potential dependence
  • effective(P, s, Ø ) full(P, s)
  • effective(P, s, P) relevant(P, s)

10
Effective Slicing for Approximation
  • Potential dependence need only be taken into
    account when the potential statement is in the
    union of slices
  • Choose ?? to be all nodes in the union of
    execution slices

11
Two Correct Effective Slices
effective slice n ? 3


y 2



if (y 2)
x 2
?x
effective slice n ? 2


y 2



if (y 2)
x 2
?x
program
read(n)
x 1
y 2
if (n 1)
x 3
y 1
if (y 2)
x 2
?x
?
?
12
Summary
  • Unions of relevant slices are correct
  • Take into account potential dependences
  • Relevant slicing can be used in a fixpoint
    computation
  • Semantic information can be extracted from the
    result
  • Effective slicing generalizes full and relevant
    slicing
  • Possibly potential statements are an explicit
    parameter
  • Effective slicing can be used to find an
    approximation of the fixpoint

13
Future Work
  • Theoretical
  • How many steps to reach fixpoint?
  • Practical
  • How big are unions of relevant slices?
  • How good an approximation can effective slicing
    give?
  • How many dynamic semantic facts can be extracted?
  • eg., what choices of initial state are irrelevant
    for this subset?

14
  • Effective Slicing

Anne Mulhern Computer Sciences Department Universi
ty of Wisconsin-Madison Madison, WI
USA mulhern_at_cs.wisc.edu www.cs.wisc.edu/mulhern
Write a Comment
User Comments (0)
About PowerShow.com