Answers to Self-Study Questions
Self-Study #1
Here are the dataflow equations for live analysis.
Note that the meet operator (⌈⌉) is set
union.
enter.after = 1.before
1.before = 1.after - {x}
1.after = 2.before
2.before = 2.after - {y} union {x}
2.after = 3.before
3.before = 3.after
3.after = exit.before ⌈⌉ 4.before
4.before = 4.after union {y}
4.after = 3.before
exit.before = empty-set
Variable |
Least Solution |
Greatest Solution |
1.before |
{ } |
{ } |
1.after |
{ x } |
{ x } |
2.before |
{ x } |
{ x } |
2.after |
{ y } |
{ x, y} |
3.before |
{ y } |
{ x, y} |
3.after |
{ y } |
{ x, y } |
4.before |
{ y } |
{ x, y} |
4.after |
{ y } |
{ x, y } |
The solution we want is the least solution.