1 research outputs found
Semantic Types for Class-based Objects
We investigate semantics-based type assignment for class-based object-oriented programming. Our motivation
is developing a theoretical basis for practical, expressive, type-based analysis of the functional
behaviour of object-oriented programs. We focus our research using Featherweight Java, studying two
notions of type assignment:- one using intersection types, the other a ‘logical’ restriction of recursive
types.
We extend to the object-oriented setting some existing results for intersection type systems. In doing
so, we contribute to the study of denotational semantics for object-oriented languages. We define a
model for Featherweight Java based on approximation, which we relate to our intersection type system
via an Approximation Result, proved using a notion of reduction on typing derivations that we show
to be strongly normalising. We consider restrictions of our system for which type assignment is decidable,
observing that the implicit recursion present in the class mechanism is a limiting factor in making
practical use of the expressive power of intersection types.
To overcome this, we consider type assignment based on recursive types. Such types traditionally
suffer from the inability to characterise convergence, a key element of our approach. To obtain a semantic
system of recursive types for Featherweight Java we study Nakano’s systems, whose key feature
is an approximation modality which leads to a ‘logical’ system expressing both functional behaviour
and convergence. For Nakano’s system, we consider the open problem of type inference. We introduce
insertion variables (similar to the expansion variables of Kfoury and Wells), which allow to infer when
the approximation modality is required. We define a type inference procedure, and conjecture its soundness
based on a technique of Cardone and Coppo. Finally, we consider how Nakano’s approach may be
applied to Featherweight Java and discuss how intersection and logical recursive types may be brought
together into a single system