1 Department of Computer Science, Faculty of Science, Aarhus University, Aarhus University2 Department of Computer Science, Science and Technology, Aarhus University3 Department of Computer Science, Science and Technology, Aarhus University
To support roles and similar notions involving multiple views on an object, languages like Object Teams and CaesarJ include mechanisms known as lifting and lowering. These mechanisms connect pairs of objects of otherwise unrelated types, and enable programmers to consider such a pair almost as a single object which has both types. In the terminology of Object Teams this is called translation polymorphism. In both Object Teams and CaesarJ the type system of the Java programming language has been extended to support this through the use of advanced language features. The type soundness of translation polymorphism has so far only been proven in a simple special case. This paper presents a simple model that extends Featherweight Java with a general semantics that captures the core operations of translation polymorphism, providing an entire language design space for languages with translation polymorphism. Type soundness is proven for every language in this language design space, and mechanization of the proof in Coq shows that the proof is accurate and complete.
Journal of Object Technology, 2012, Vol 11, Issue 1, p. 1-23