Describing the Semantics of Java and Proving Type Soundness
Java combines the experience from the development of several object oriented languages, such as C++, Smalltalk and Clos. The philosophy of the language designers was to include only features with already known semantics, and to provide a small and simple language.
Nevertheless, we feel that the introduction of some new features in Java, as well as the specific combination of features, justifies a study of the Java formal semantics. The use of interfaces, reminiscent of [10,6] is a simplification of the signatures extension for C++  and is — to the best of our knowledge — novel. The mechanism for dynamic method binding is that of C++, but we know of no formal definition. Java adopts the Smalltalk  approach whereby all object variables are implicitly pointers.
Furthermore, although there are a large number of studies of the semantics of isolated programming language features or of minimal programming languages , , , there have not been many studies of the formal semantics of actual programming languages. In addition, the interplay of features which are very well understood in isolation, might introduce unexpected effects.
Experience confirms the importance of formal studies of type systems early on during language development. Eiffel, a language first introduced in 1985, was discovered to have a loophole in its type system in 1990 [9,22]. Given the growing usage of Java, it seems important that if there are loopholes in the type system they be discovered early on.
KeywordsType System Operational Semantic Method Call Type Rule Argument Type
Unable to display preview. Download preview PDF.
- 1.M. Abadi and L. Cardelli. A Semantics of Object Types. In LICS’94 Proceedings, 1994.Google Scholar
- 2.Ole Ageson, Stephen Freunds, and John C. Mitchell. Adding paraleterized types to Java. In OOPSLA’97 Proceedings, 1997.Google Scholar
- 3.Joseph A. Bank, Barbara Liskov, and Andrew C. Myers. Parameterized Types and Java. In POPL’97 Proceedings, January 1997.Google Scholar
- 4.Gerald Baumgartner and Vincent F. Russo. Signatures: A language extension for improving type abstraction and subtype polymorphism in C++. Software-Practice & Experience, 25(8):863–889, August 1995.Google Scholar
- 5.John Boyland and Giuseppe Castagna. Type-Safe Compilation of Covariant Specialization: A Practical Case. In ECOOP’96 Proceedings, July 1996.Google Scholar
- 6.P. Canning, William Cook, and William Olthoff. Interfaces for object-oriented programming. In OOPLSA’89, pages 457–467, 1989.Google Scholar
- 7.Giuseppe Castagna. Parasitic Methods: Implementation of Multimethods for Java. Technical report, C.N.R.S, November 1996.Google Scholar
- 8.Giuseppe Castagna, Giorgio Ghelli, and Giuseppe Longo. A calculus for over-loaded functions with subtyping. Information and Computation, 117(1):115–135, 15 February 1995.Google Scholar
- 9.William Cook. A Proposal for making Eiffel Type-safe. In S. Cook, editor, ECOOP’87 Proceedings, pages 57–70. Cambridge University Press, July 1989.Google Scholar
- 10.William Cook, Walter Hill, and Peter Canning. Inheritance is not Subtyping. In POPL’90 Proceedings, January 1990.Google Scholar
- 11.Luis Damas and Robin Milner. Principal Type Schemes for Functional Languages. In POPL’82 Proceedings, 1982.Google Scholar
- 12.Sophia Drossopoulou and Susan Eisenbach. Is the Java type system sound? In Fourth International Workshop on Foundations of Object-Oriented Languages, January 1997.Google Scholar
- 13.Sophia Drossopoulou and Susan Eisenbach. Java is type safe — probably. In Proceedings of the European Conference on Object-Oriented Programming, June 1997.Google Scholar
- 14.Sophia Drossopoulou, Susan Eisenbach, and Sarfraz Khurshid. Is Java Sound? Theory and Practice of Object Systems, 1998. to appear, available athttp://www-dse.doc.ic.ac.uk/projects/slurp/.
- 15.A. Goldberg and D. Robson. SmallTalk-80: The Language and Its Implementation. Addison-Wesley, 1983.Google Scholar
- 16.M. Gordon and T.F. Melhams, editors. Introduction to HOL: A Theorem Proving Environment for Higher Order Logic. Cambridge University Press, 1993.Google Scholar
- 17.James Gosling, Bill Joy, and Guy Steele. The Java Language Specification. Addison-Wesley, August 1996.Google Scholar
- 18.R. Harper. A simplified account of polymorphic references. Technical Report CMU-CS-93-169, Carnegie Mellon University, 1993.Google Scholar
- 19.Daniel Ingalls. The Smalltalk-76 programming system design and implementation. In POPL’78 Proceedings, pages 9–15, January 1978.Google Scholar
- 20.The Java Language Specification, May 1996.Google Scholar
- 21.Sarfraz Khurshid. Some Aspects of Type Soundness for Java, 1997. BSc thesis.Google Scholar
- 22.Bertrand Meyer. Static typing and other mysteries of life, http://www.eiffel.com 1995.
- 23.Tobias Nipkow and David von Oheimb. Javalight is type-safe — definitely. In POPL Proceedings, 1998.Google Scholar
- 24.Martin Odersky and Philip Wadler. Pizza into Java: Translating theory into practice. In POPL’97 Proceedings, January 1997.Google Scholar
- 25.Peter Sellinger. private communication, October 1996.Google Scholar
- 26.Donald Syme. DECLARE: A Prototype Declarative Proof System for Higher Order Logic. Technical Report 416, Cambridge University, March 1997.Google Scholar
- 27.Donald Syme. Private Communication, 1997.Google Scholar
- 28.Donald Syme. Proving Java Type Sound. Technical Report 427, Cambridge University, June 1997.Google Scholar
- 29.Donald Syme. Proving Java Type Sound. In Jim Alves-Foss, editor, Formal Syntax and Semantics of Java, Lecture Notes in Computer Science. Springer-Verlag, 1998. Chapter 4 of this volume.Google Scholar
- 30.Mads Tofte. Type Inference for Polymorphic References. In Information and Computation’80 Conference Proceedings, pages 1–34, November 1980.Google Scholar
- 31.Myra VanInwegen. Towards Type Preservation in Core SML. Technical report, Cambridge University, 1997.Google Scholar
- 32.David von Oheimb and Tobias Nipkow. Machine-checking the Java Specification: Proving Type-Safety. In Jim Alves-Foss, editor, Formal Syntax and Semantics of Java, Lecture Notes in Computer Science. Springer-Verlag, 1998. Chapter 5 of this volume.Google Scholar
- 33.David Wragg, Sophia Drossopoulou, and Susan Eisenbach. Java Binary Compatibility is Almost Correct. Technical report, Imperial College, 1998. http://www-dse/projects/SLURP/bc.
- 34.Andrew Wright and Matthias Felleisen. A Syntactic Approach to Type Soundness. Information and Computation, 115(1), 1994.Google Scholar