Statically typed friendly functions via partially abstract types

A well-known shortcoming of the object model of Simula and Smalltalk is the inability to deal cleanly with methods that require access to the internal state of more than one object at a time. Recent language designs have therefore extended the basic object model with notions such as friends' methods and protected features, which allow external access to the internal state of objects but limit the scope in which such access can be used. We show that a variant of this idea can be added to any type-theoretic model of the basic object-oriented mechanisms (encapsulation, message passing and inheritance), using a construction based on Cardelli and Wegner's partially abstract types, a refinement of Mitchell and Plotkin's type-theoretic treatment of absract types, a refinement of Mitchell and Plotkin's type-theoretic treatment of abstract types.

[1]  de Ng Dick Bruijn,et al.  Lambda calculus notation with nameless dummies, a tool for automatic formula manipulation, with application to the Church-Rosser theorem , 1972 .

[2]  Benjamin C. Pierce,et al.  Simple type-theoretic foundations for object-oriented programming , 1994, Journal of Functional Programming.

[3]  John C. Mitchell,et al.  A lambda calculus of objects and method specialization , 1993, [1993] Proceedings Eighth Annual IEEE Symposium on Logic in Computer Science.

[4]  John C. Mitchell,et al.  Abstract types have existential type , 1988, TOPL.

[5]  Kim B. Bruce Safe type checking in a statically-typed object-oriented programming language , 1993, POPL '93.

[6]  Luca Cardelli,et al.  Extensible records in a pure calculus of subtyping , 1994 .

[7]  Luca Cardelli,et al.  A Semantics of Multiple Inheritance , 1984, Inf. Comput..

[8]  Luca Cardelli,et al.  On understanding types, data abstraction, and polymorphism , 1985, CSUR.

[9]  Bjarne Stroustrup,et al.  C++ Programming Language , 1986, IEEE Softw..

[10]  Giuseppe Castagna,et al.  A calculus for overloaded functions with subtyping , 1992, LFP '92.

[11]  John C. Mitchell,et al.  Theoretical aspects of object-oriented programming: types, semantics, and language design , 1994, Choice Reviews Online.

[12]  Craig Chambers,et al.  Object-Oriented Multi-Methods in Cecil , 1992, ECOOP.

[13]  John C. Mitchell,et al.  PER models of subtyping, recursive types and higher-order polymorphism , 1992, POPL '92.

[14]  John C. Mitchell Toward a typed foundation for method specialization and inheritance , 1989, POPL '90.

[15]  Luca Cardelli. Amber Combinators and Functional Programming Languages , 1985, Lecture Notes in Computer Science.

[16]  Luca Cardelli,et al.  Structural subtyping and the notion of power type , 1988, POPL '88.

[17]  David Robson,et al.  Smalltalk-80: The Language and Its Implementation , 1983 .

[18]  John C. Reynolds,et al.  Three Approaches to Type Structure , 1985, TAPSOFT, Vol.1.

[19]  François Rouaix,et al.  Safe run-time overloading , 1989, POPL '90.

[20]  Francois M. Rouaix Alcool-90. Typage de la surcharge dans un langage fonctionnel , 1990 .

[21]  Giorgio Ghelli,et al.  A static type system for message passing , 1991, OOPSLA '91.

[22]  Timothy A. Budd,et al.  An introduction to object-oriented programming , 1991 .