Write these up and submit them to Canvas, the day before the lecture. =========================================================================== You do not need to write a summary/commentary for the papers: * Abstract Interpretation * Abstract Interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints =========================================================================== Monotonicity of the transfer and lub functions A transfer function is not required to be monotonic, but the lub function must be monotonic. * Why must the lub function be monotonic? * What might go wrong if lub is were somehow not monotonic? Give an example of using a non-monotonic function in place of the lub function and show how it causes the problem you specified above. Using the same lattice and a lub function that is monotonic, show that the problem does not occur. =========================================================================== Reasoning about programs Stein's algorithm (https://en.wikipedia.org/wiki/Binary_GCD_algorithm) computes the greatest common divisor (GCD) of two integers. On some CPU architectures, Stein's algorithm admits a faster implementation than the far more famous Euclidean algorithm (https://en.wikipedia.org/wiki/Euclidean_algorithm). Here is one possible implementation of Stein's algorithm: def gcd(int a, int b): int d = 0 while a is even and b is even: a = a / 2 b = b / 2 d = d + 1 while a != b: if a is even: a = a / 2 elif b is even: b = b / 2 elif a > b: a = (a - b) / 2 else: b = (b - a) / 2 return a * 2^d A program will crash if it ever divides by zero. Does this program ever crash due to division by zero? Carefully explain how you figured this out. Stein's algorithm is intended to compute a value; it should always terminate. Is it possible for this program to run forever? Carefully explain how you figured this out. =========================================================================== end.