Do problem 2.10 and the first part of problem 2.13.
The ``similar result'' in the second half is true for WHILE, but neither is true for fluid Java flow graphs. Use Yang Zhao's tool to find a simple counter-example (for the forward or backward direction).
Look at the proof that
for distributive
transfer functions and determine an additional restriction on the
transfer functions that ensures that
is
still maintained
even if Exercise 2.13 is false.
Explain this restriction intuitively.
In Fluid, the control-flow graph has one node for each atomic action, such as reading a variable, assigning a variable, or ignoring a value. Thus the CFG for the code
x = (y = z) + a;consists of the straight-line sequence of nodes that
Now: we need to be careful about side-effects.
Assignments to local faint variables can be safely ignored, but
anything returned from the method, passed in a method call, or
stored in a field is
strongly live. Furthermore, anything that influences whether an
exception is thrown is strongly live as well. For simplicity, we also
assume that anything that affects control flow is strongly live, for
example, the condition of a if statement.
First define the lattice to be used for SVLA in fluid.
Then for each of the following points in the control-flow graph, give the transfer function to be used. We identify the control points by a syntactic fragment and a brief explanation of the dynamic (forward!) semantics.
As with all homeworks, please turn in your homework on paper at the beginning of lecture.