program 2: 1. read(n) 2. i := 1; 3. s := 0; 4. while (i <= n) do 5. if (i mod 2) = 0 then 6. x := 17 else 7. x := 18 8. s := s + x 9. i := i + 1 endWhile 10. write(s); i. d: U --------------------- 1. n: 2. i: 3. s: 4. p4: i,n 5. p5: i,p4, t 6. x: p5, t 7. x: p5, f 8. s: s,x,p4, t 9. i: i, p4, t 10. o10 s execution history: <1,2,3,4,5,7,8,9,4,5,6,8,9,4,10> program 1: 1. read (a) 2. x = 1 3. b = x + a 4. a = a + 1 5. if (b > 0) then 6. if (a > 1) then 7. x = 2 8. write (x) Action d U DynSlice(d) LD(d) --------|-------|-----------|-----------------------------------------------| 1.1 | | | | | --------|-------|-----------|-----------------------------------------------| 2.2 | | | | | --------|-------|-----------|-----------------------------------------------| 3.3 | | | | | --------|-------|-----------|-----------------------------------------------| 4.4 | | | | | --------|-------|-----------|-----------------------------------------------| 5.5 | | | | | --------|-------|-----------|-----------------------------------------------| 7.6 | | | | | --------|-------|-----------|-----------------------------------------------| 8.7 | | | | | --------|-------|-----------|-----------------------------------------------| 9.8 | | | | | --------|-------|-----------|-----------------------------------------------| 4.9 | | | | | --------|-------|-----------|-----------------------------------------------| 5.10 | | | | | --------|-------|-----------|-----------------------------------------------| 6.11 | | | | | --------|-------|-----------|-----------------------------------------------| 8.12 | | | | | --------|-------|-----------|-----------------------------------------------| 9.13 | | | | | --------|-------|-----------|-----------------------------------------------| 4.14 | | | | | --------|-------|-----------|-----------------------------------------------| 10.15 | | | | | --------|-------|-----------|-----------------------------------------------|