0
$\begingroup$

I'm a little bit confused about the difference between forward/backward slicing and the use/def-def/use as part of the reaching definitions technique. Isn't the use-def chain supposed to be equivalent to the backward slicing?

Let's assume we have a line that uses some variables. Like: x = y + z.

If we try to find all the code locations that influenced the given code line (backward slicing), shouldn't it be the same as all the entries of the use-def chain of the variable x?

$\endgroup$
2
  • $\begingroup$ en.wikipedia.org/wiki/Program_slicing $\endgroup$
    – D.W.
    Commented May 13, 2020 at 18:10
  • $\begingroup$ (If you edit your question, e.g. to add your line of thought why both might (always?) be the same, please correct the typo in the title.) $\endgroup$
    – greybeard
    Commented May 15, 2020 at 10:09

1 Answer 1

1
$\begingroup$

Backward slicing includes both data and control dependencies while ud-chains consider only data depedencies.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.