Rationale
This chapter extends the notion of subtyping
to include behavioral properties.
It discusses the interpretation of types
as behavior and introduces an assertion logic
for verifying behavioral properties.
A brief introduction is given to the
operational semantics underlying the
verification logic.
We then look at the interpretation
of objects as behavioral types,
and present guidelines for designing
subtypes satisfying behavioral constraints.
Finally, we discuss what formal means we have
available to specify the behavioral
properties of a collection of related
objects.
Hints
The verification logic presented in this
chapter is based on the notion of
observable state changes.
The axioms presented abstract from the actual state changes
resulting from the execution of a program.
The actual behavior of a collection of
objects may be modeled by means of a
transition system, specifying the execution
steps, state changes and observable
behavior corresponding to object creation,
message passing and instance variable assignments.
Such a transition system may be regarded
as the operational semantics
underlying our assertion logic for
objects.
Further reading
As further reading with respect to the verification of programs, I recommend
[AptO] and [Dahl92].
An assertion logic for a parallel object-oriented language
is presented in [AmBo93].
Project assignments
There is still a need to incorporate the theoretical
insights with respect to the semantics and proof theory
of object-oriented languages in practical development
methods.
As assignments that hint towards the integration of theory
one may think of
- providing a proof theory for a subset of C++
- developing an operational semantics for a subset of C++
- formulating guidelines for safe inheritance in Smalltalk,
Eiffel or C++
Naturally, for student assignments an exploratory
study is probably the most one can ask for.
As a research project one may think
of
- the development of an object-oriented model-based
specification formalism
that allows for an easy transition from a specification
to an implementation in some object-oriented language.
Comments
In the final section of this chapter
an overview is given of
a number of formal approaches to modeling
the behavioral properties of collections
of objects.
This overview is far from complete.
For example, not included are the process
algebras as described in [Milner83],
which provide a powerful formalism to specify
concurrency and communication aspects.