1. The union has space for one field and one vtable pointer. The vtable will have one entry for each of the functions. We first find out the maximum size of the fields. And allocate as many space required for that. threeInOne = allocate 4+4 // 4 bytes for the vtable ptr, 4 bytes for the field threeInOne.0 = allocate 4*4 // (four bytes each for each of the four functions) threeInOne.4 = 0 // Initialize fields to zero. In each of the functions, access to any field dereference -- use `this.4' 2. a) We will only admit straight line programs. b, c, d) -- proof by contradiction. 3. The value of any integer variable is taken from the lattice: Top Bot The value of any other variable is taken from the lattice: Top Init Initialize each variable (not just of integer type) to "Top". At any assignment statement: if it is a constant expression, evaluate the constant value of the 'def' variable. else set the value of the 'def' variable to Init or Bot At any use of any variable (not just arithmetic expressions), if the value of the variable is Top --> Uninitialized. 4. a) A conditional break at in a basic block: B break /| Region for if block with break. B1 Y | \ N B2 \ break /| / / | / Region for while loop with break. |-------| |-| while |<-| N | |-------| | | |Y | | Body ----| | | | | break |--> v b) Bwhile = (F_while/N \cap (F_break o F_while/Y)) o (F_body o F_while/Y)*