PLT11 course -- assignment 4

(C) Ralf Lämmel, Andrei Varanovich, University of Koblenz Landau

Logistics

Assignment

The following positions can be approached independently.

Presentations by student teams would also just show ONE position.

(You may want to solve several positions to increase chances of presenting.)

If some of the positions are not sufficiently discussed in the next lab, they can also be carried over to the next week. Indeed, some positions of the previous assignment are still to be covered.


1. Understanding Featherweight Java

Sketch a FJ class for natural numbers.

Also, sketch a FJ class for lists of natural numbers.

This simple exercise is meant to verify that you understand the constraints of the FJ language.


2. Featherweight Java with multiple inheritance

Discuss the changes to the static and dynamic semantics of FJ if you wanted to enable multiple inheritance. You do not need to provide the complete and correct specification. It is already of some use to discuss the existing rules and their inability to deal with multiple inheritance. If you are an overachiever, then please try to sketch the changed or additional typing or evaluation rules.


3. Featherweight Java with visibility modifiers

In a similar manner, discuss the changes to both semantics if you wanted to enable private and public (and possibly protected) modifiers.


4. Featherweight Java with static methods

Likewise.