schamane
Erstie
Beiträge: 13
Registriert: 23. Feb 2015 18:30

Hi,

upon redoing the exercises I noticed something that I do not understand regarding exercise 2.3c.
The task is to solve the equations for Live Variables analysis of the given program.

The statement associated with label 2 is x := x + 1.
So I started by computing
kill_LV(2) = {x}
generate_LV(2) = {x}
Thus, I thought LV_entry(2) = (LV_exit(2) \ kill_LV(2)) \union generate_LV(2) = (LV_exit(2) \ {x}) \union {x}.
However, the sample solution states LV_entry(2) = LV_exit(2) \union {x}.
This results in the same set. Though, I am not entirely sure if I have done a mistake or if the solution omitted a step.

Could somebody clarify this for me please?

Thanks and best regards.

AlexanderF
BASIC-Programmierer
Beiträge: 140
Registriert: 2. Mai 2010 17:55

### Re: Question about exercise 2.3c

No, I think, you did not make a mistake.
It results in the same set, as you say.
The solution just presents the simplified equations.
I think, that is actually the case for all sample solutions of this exercise sheet.

best regards,
Alexander