Michael and Hyunsoo asked an important question regarding the safety condition during and after today's class. So let me summarize that again here.
Q: How to compute D#pre that satisfies the condition?
In general, spurious defs are indistinguishable from real defs before the main analysis.
But in practice, we can compute safe yet precise def set and use set as follows:
If there is definitely no spurious def: for example x = y + 1, x is defined and we know that this is definitely a real def. In this case, the set of spurious defs is the empty set which is obviously a subset of the approximated use set. I.e., def#pre = {x}, use#pre = {y}.
If there exist indistinguishable elements: for example *x = *y + 1. In such a case, we can simply define use#pre to subsume def#pre. I.e., use#pre includes all elements in def#pre. Then obviously the condition holds.
Michael and Hyunsoo asked an important question regarding the safety condition during and after today's class. So let me summarize that again here.
Q: How to compute D#pre that satisfies the condition?
In general, spurious defs are indistinguishable from real defs before the main analysis. But in practice, we can compute safe yet precise def set and use set as follows:
If there is definitely no spurious def: for example
x = y + 1
,x
is defined and we know that this is definitely a real def. In this case, the set of spurious defs is the empty set which is obviously a subset of the approximated use set. I.e.,def#pre = {x}
,use#pre = {y}
.If there exist indistinguishable elements: for example
*x = *y + 1
. In such a case, we can simply defineuse#pre
to subsumedef#pre
. I.e.,use#pre
includes all elements indef#pre
. Then obviously the condition holds.