Sometimes I ask you to give an illustrative, but small example. The idea is that your example should be as varied and broad as possible, but on the other hand should be as concise as possible. For instance, in the case of Strongly Live Variables (see below), I expect an example where a variable is strongly live, one which is not, one which is live but not strongly live, and maybe you can think of other cases. The bottom line is that your example is an alternative for a soundness proof, so the more convincing your example, the more convinced people will be (actually, a proof also only does the job when it is convincing).
The general rule is: Motivate your answers
Do Exercise 2.4 for Strongly Live Variable Analysis on page 136 of NNH, formulate your answer similar to Table 2.4 on page 50.
Design a While program of at least five blocks which well illustrates the Strongly Live Variable Analysis (it should contain at least one while loop). Apply Chaotic Iteration to the set of equations that you obtain as a result of applying Part 1 to your program, showing also intermediate values for the iterations (similar to what I do in the slides for Available Expressions). Indicate how SLV is different for this example from the standard LV (and make sure that your example allows you to illustrate this fact).
Add the following three programming constructs to the While language. Describe, in general, what has to change to accommodate each of the constructs. To avoid too much work: you don't have to give the semantics of the new language constructs, but it is wise to describe it for me. (Hint: sometimes it is sufficient to add new transfer functions, sometimes a change has to be made to a different parameter of the monotone framework. Deciding this is, of course, up to you.)
print a statement where a is an arithmetic
expression. Show how to adapt the Strongly Live Analysis to accommodate
programs which contain print statements. Devise a small
program which shows that your extension works as expected. (You do not
need to perform Chaotic Iteration. What you should do is give the
equations for your program, propose a good (preferably the best)
solution, indicate why you think this is a reasonable solution
and verify that it fulfills the equations).
v1, ..., vn := a1, ..., an, which assigns the value of
a1 to v1, a2
to v2 and so on. The semantics of such a statement is that first
the sequence of expressions a1 to an
is evaluated, and when this is done, the resulting values are stored
in the corresponding variables in left to right order.
Add simultaneous assignments to the While language and show how
to adapt the Strongly Live Variable Analysis to accomodate it.
Illustrate that your solution works by giving an example.