Question about exercise 2.3c

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

Question about exercise 2.3c

Beitrag von schamane » 3. Dez 2017 12:17

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
BASIC-Programmierer
Beiträge: 140
Registriert: 2. Mai 2010 17:55

Re: Question about exercise 2.3c

Beitrag von AlexanderF » 4. Dez 2017 14:00

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

Antworten

Zurück zu „Archiv“