Content deleted Content added
m Task 70: Update syntaxhighlight tags - remove use of deprecated <source> tags |
|||
Line 23:
When we union all of those statements, we do not have executable code, so to make the slice an executable slice we merely add the end brace for the for loop and the declaration of i. The resulting static executable slice is shown below the original code below.
<
int i;
int sum = 0;
Line 34:
write(sum);
write(product);
</syntaxhighlight>
The static executable slice for criteria (<code>write(sum)</code>, sum) is the new program shown below.
<
int i;
int sum = 0;
Line 46:
write(sum);
</syntaxhighlight>
In fact, most static slicing techniques, including Weiser's own technique, will also remove the <code>write(sum)</code> statement. Since, at the statement <code>write(sum)</code>, the value of <code>sum</code> is not dependent on the statement itself. Often a slice for a particular statement x will include more than one variable. If V is a set of variables in a statement x, then the slice for (x, V) is the union of all slices with criteria (x, v) where v is a variable in the set V.
|