Rationale
This chapter treats polymorphism
from a foundational perspective.
It characterizes abstract inheritance
as employed in knowledge representation
and proceeds with a formal definition
of the subtype relation, culminating in
a family of calculi for a type theoretical
analysis of the constructs employed in
object-oriented programming.
The features studied include generic types,
overloading, data hiding and self-references.
Hints
The sections introducing the various
type calculi cover advanced topics
and require some background in logic
and deductive systems.
Further reading
As further reading I recommend
[CW85] and [Pierce93].
Additional papers on the lambda
calculus approach may be found at
{\tt ftp.dcs.ed.ac.uk:pub/bcp}. See appendix [internet].
This collection includes a paper
containing exercises and solutions,
employing a tool fomega.
As another source of material
and exercises consult [Palsberg94].
Project assignments
Due to the formal background needed, the
project assignments listed below have
the flavor of research projects and must be
considered for advanced students only.
Possible assignments are
- designing a language incorporating
both knowledge representation features
and objects,
- the development of a type calculus for a concrete
programming language, such as Smalltalk, Eiffel or C++,
- the development of a type checker for a variety
of polymorphic constructs.
Since some of this work has already be done (see below),
one may simply advise students to study
these efforts.
Comments
To gain practical experience
with the typing of objects and functions,
students may use the fomega tool
or the BOPL type checker described in [Palsberg94].