

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


May 5, 2009
The exam will cover everything we have discussed since the second exam material ended. This includes topics from Chapters 3.5.2 and 5-13 in the text, but emphasizing the material covered in class. Detailed questions will not be asked about topics covered on the first two exams but you should be aware of the central topics (e.g. the structure of a compiler, the importance of formal semantics, etc.). The exam should last approximately 2.5 hours. The style of the exam will be very flexible, possibly consisting of fill in the blank, true or false (possibly with justification), multiple choice, matching, short answer (e.g. definitions or listing), and discussion questions. You will not be asked to work detailed problems such as writing any actual code but you should have some ideas about the theory (e.g. what really does happen in procedure calls). Some smaller problems such as illustrating the difference between static scope and dynamic scope or managing a stack of activation records are likely. In general, you should know how to solve the problems given in assignments even though you may not have to actually solve such problems on the exam.
A brief outline of the topics we have covered is described below. (This list is intended to be as complete as possible but may not be all inclusive.)
Assignment {P [E/V]} V := E {P}
Composition {P}S 1 {Q}, {Q}S 2 {R} {P}S 1 ; S 2 {R}
Loop {P&B}S{P} {P}while B loop S end loop{P&¬B}
Prove the correctness of the following program segment.
{n = j × (j + 1)/2 & i ≥ 0 } while j != i loop j := j + 1; n := n + j; end loop {n = j × (j + 1)/2 & i ≥ 0 & ¬(j 6 = i)}
Show all steps used in the proof.
A : array [−10 .. 10, −5 .. 5, 1 .. 10] of T;
Assuming that T requires 10 bytes of storage and A is stored at relative location 100, what is the relative location of A [1, 1, 2]?