|
I will administer an in-class comprehensive final exam on Friday, 7 December, 10:30 AM to 12:30 PM in Ryerson Annex 276. You may use the textbook and any written or printed materials that you like during the exam. You may listen to music on headphones, and eat/drink snacks as long as you don't annoy other students.
Rather than just sampling what you remember from the course, the exam is intended to exercise your thinking in a bit more depth. It is very similar in character to the midterm exam. I encourage you to focus your studying and practice on the particular topics of the five questions:
- Recall how notational details, such as operator precedence, often lead to "gimmicks" in context-free grammars, and some discrepancy between parse trees and abstract syntax trees. I provide a grammar and example AST for a variant command used in some procedural programming languages. You must critique the slightly greater discrepancy between AST and parse tree in my example.
- I describe a well known data structure representation. You must discuss some of its properties in terms of the set-theoretic description of the types involved. I recommend that you study the assignment on parallel arrays and sparse arrays to prepare for this question. Problem 1 of the autumn 2000 final exam is similar in character, but substantially different in detail. I think that the 2000 question is slightly harder than the 2001 question.
- I propose a naive and incorrect application of Hoare's rule for reasoning about assignments to an assignment command involving an array reference on the left-hand side. You must explain, both by an example execution and conceptually, why the proposed reasoning is wrong. I couldn't resist mentioning a harder example at the end. You may work on it for extra credit, or just think about it in your later life. But I strongly recommend that you do all of the regular problems first.
- You must define a higher-order function simulating a particular control structure that I describe. You may use either LISP or ML notation. I recommend that you study the example control structures that I showed in class, and problem 3 in the autumn 1999 final exam. Pay particular attention to the way that the higher-order simulations of control structures don't actually deal with the internal structure of computation states, but only with other functions that operate on those states and that are provided as parameters to the control structure. You may also study problem 3 in the autumn 2000 exam. I think that the 2001 problem is about as hard, or perhaps slightly harder than, the 1999 problem, but substantially easier than the 2000 problem.
- I define another "mother of all ..." recursive reduction operation in ML. You must use my reducer to define the identity function, and one other slightly more interesting function. In this case, the "slightly more interesting function" is chosen to be exactly what the given reducer is good for, so that definition is very straightforward. The identity function is slightly less natural. Defining the identity is one of the best exercises to test understanding of a reducer.
Mike O'D.
|