Type Inference for Variant Object Types


Autoria(s): Bugliesi, Michele; Pericas-Geertsen, Santiago M.
Data(s)

20/10/2011

20/10/2011

16/10/2000

Resumo

Existing type systems for object calculi are based on invariant subtyping. Subtyping invariance is required for soundness of static typing in the presence of method overrides, but it is often in the way of the expressive power of the type system. Flexibility of static typing can be recovered in different ways: in first-order systems, by the adoption of object types with variance annotations, in second-order systems by resorting to Self types. Type inference is known to be P-complete for first-order systems of finite and recursive object types, and NP-complete for a restricted version of Self types. The complexity of type inference for systems with variance annotations is yet unknown. This paper presents a new object type system based on the notion of Split types, a form of object types where every method is assigned two types, namely, an update type and a select type. The subtyping relation that arises for Split types is variant and, as a result, subtyping can be performed both in width and in depth. The new type system generalizes all the existing first-order type systems for objects, including systems based on variance annotations. Interestingly, the additional expressive power does not affect the complexity of the type inference problem, as we show by presenting an O(n^3) inference algorithm.

Italian M.U.R.S.T. Project Constructive Methods in Topology, Algebra and Program Analysis.

Identificador

Bugliesi, Michele; Pericas-Geertsen, Santiago M.. "Type Inference for Variant Object Types", Technical Report BUCS-2000-020, Computer Science Department, Boston University, October 16, 2000. [Available from: http://hdl.handle.net/2144/1813]

http://hdl.handle.net/2144/1813

Idioma(s)

en_US

Publicador

Boston University Computer Science Department

Relação

BUCS Technical Reports;BUCS-TR-2000-020

Tipo

Technical Report