Homework
Homeworks are due at the beginning of class each Friday.
- Homework #14, due 9am 12/1/06
- Homework #13, due 9am 11/27/06: Exercises 13.1, 13.3, 13.5, 13.7
- Homework #12, due 11/17/06: Exercises 12.1, 12.3, 12.4, 12.10
- Homework #11, due 11/10/06: Exercises 11.1*, 11.3, 11.4, 11.5, 11.8
- Homework #10, due 11/3/06: Exercies 10.1, 10.2, 10.3
- Homework #9, due 11/3/06: Exercies 9.1, 9.4, 9.5
- Homework #8, due 10/20/06: Exercises 8.1, 8.2, 8.4, 8.8, 8.9
- Homework #7, due 10/13/06: Exercises 7.1, 7.2, 7.8, 7.13
- Homework #6, due 10/3/06: Exercises 5.6, 6.1, 6.5, 6.6, 6.7, 6.10
- Homework #5, due 9/29/06: Exercises 5.1, 5.2, and 5.3
- Homework #4, due 9/22/06:
- Exercises 4.1, 4.2
- Pretend that you are porting a C++ compiler to target the
PowerPC (PPC) architecture, and that you have:
- the C source code for a C++ to PPC compiler,
- the C source code for a C to PPC compiler,
- a native C to ia32 compiler, and
- a machine implementing the ia32 architecture
(a) Please describe how you would produce a native C++ to
PowerPC compiler.
(b) Use T-Diagrams to graphically represent
this process.
(A native compiler is ones whose target and implementation
languages are the same.)
- Extra Credit: Write a Scheme
S-expression that evaluates to the list representing itself.
(Hint: Think about how (λx.xx) (λx.xx) reduces
infinitely.)
- Homework #3, due 9/15/06: Exercises 3.1, 3.4, 3.5, and 3.6
- Homework #2, due 9/8/06: Exercises 4.3, 4.4, 4.5, 4.6, and 4.9
- Homework #1, due 9/1/06: Exercises 2.1, 2.2, and 2.3
* There are a couple issues involving Exercise 11.1:
- The name of the variables being declared should be r
and cp instead of p and cp.
- The variables in activation record (0) should be
r and cp instead of x and
y. The contents of these variables should be
pointers to activation records (each represented by a number in
parentheses).
- To be consistant with the implementation of distance on p. 306,
activation record (4) in part (a) and the code for distance in (b)
should use the variable name p instead of q.
- The main text doesn't adequately explain inheritance in Simula 67
in order to understand the relationships between activation records (2)
and (3). As expained in 11.1(c), you are to assume that each colored
point consists of a point part that looks just like a regular point
and a colored point part that contains the extra parts related to
the color. In Simula 67, dynamic dispatch is not completely automatic,
so both the Point and ColorPt versions of equal are distinct entries
in the two activation records.