Incremental reasoning with lazy behavioral subtyping for multiple inheritance

Object-orientation supports code reuse and incremental programming. Multiple inheritance increases the possibilities for code reuse, but complicates the binding of method calls and thereby program analysis. Behavioral subtyping allows program analysis under an open world assumption; i.e., under the assumption that class hierarchies are extensible. However, method redefinition is severely restricted by behavioral subtyping, and multiple inheritance may lead to conflicting restrictions from independently designed superclasses. This paper presents a more liberal approach to incremental reasoning for multiple inheritance under an open world assumption. The approach, based on lazy behavioral subtyping, is well-suited for multiple inheritance, as it incrementally imposes context-dependent behavioral constraints on new subclasses. We first present the approach for a simple language and show how incremental reasoning can be combined with flexible code reuse. Then this language is extended with a hierarchy of interface types which is independent of the class hierarchy. In this setting, flexible code reuse can be combined with modular reasoning about external calls in the sense that each class is analyzed only once. We formalize the approach as a calculus and show soundness for both languages.

[1]  Michael D. Ernst,et al.  An overview of JML tools and applications , 2003, Electron. Notes Theor. Comput. Sci..

[2]  Stein Krogdahl Multiple inheritance in Simula-like languages , 1985, BIT Comput. Sci. Sect..

[3]  Andrew C. Myers,et al.  Scalable extensibility via nested inheritance , 2004, OOPSLA.

[4]  Johan Dovland,et al.  Observable Behavior of Dynamic Systems: Component Reasoning for Concurrent Objects , 2008, FInCo@ETAPS.

[5]  Randall B. Smith,et al.  Self: The power of simplicity , 1987, OOPSLA 1987.

[6]  Johan Dovland,et al.  Lazy Behavioral Subtyping , 2008, FM.

[7]  Xavier Leroy The objective caml system release 3 , 2001 .

[8]  Tobias Nipkow,et al.  An operational semantics and type safety prooffor multiple inheritance in C++ , 2006, OOPSLA '06.

[9]  Neelam Soundarajan,et al.  Inheritance: from code reuse to reasoning reuse , 1998, Proceedings. Fifth International Conference on Software Reuse (Cat. No.98TB100203).

[10]  Shengchao Qin,et al.  Separation Logic for Multiple Inheritance , 2008, Electron. Notes Theor. Comput. Sci..

[11]  Mitchell Wand,et al.  Modeling Subobject-based Inheritance , 1996, ECOOP.

[12]  Susan Owicki,et al.  An axiomatic proof technique for parallel programs I , 1976, Acta Informatica.

[13]  Luca Cardelli,et al.  A Semantics of Multiple Inheritance , 1984, Information and Computation.

[14]  Martin Odersky,et al.  Programming in Scala: A Comprehensive Step-by-Step Guide, 2nd Edition , 2010 .

[15]  C. A. R. HOARE,et al.  An axiomatic basis for computer programming , 1969, CACM.

[16]  Martin Odersky,et al.  Programming in Scala , 2008 .

[17]  Jeannette M. Wing,et al.  A behavioral notion of subtyping , 1994, TOPL.

[18]  Arnd Poetzsch-Heffter,et al.  A Programming Logic for Sequential Java , 1999, ESOP.

[19]  Frank S. de Boer,et al.  A proof outline logic for object-oriented programming , 2005, Theor. Comput. Sci..

[20]  Hernán Astudillo How conceptual system architecture leads to business process , 2000, OOPSLA '00.

[21]  Johan Dovland,et al.  Incremental Reasoning for Multiple Inheritance , 2009, IFM.

[22]  C. A. R. Hoare,et al.  Procedures and parameters: An axiomatic approach , 1971, Symposium on Semantics of Algorithmic Languages.

[23]  Pierre America,et al.  A parallel object-oriented language with inheritance and subtyping , 1990, OOPSLA/ECOOP '90.

[24]  Kim B. Bruce,et al.  Guest Editorial: Foundations of Object-Oriented Languages , 2002, Inf. Comput..

[25]  Philip Wadler,et al.  Featherweight Java: a minimal core calculus for Java and GJ , 1999, OOPSLA '99.

[26]  Krzysztof R. Apt,et al.  Ten Years of Hoare's Logic: A Survey—Part I , 1981, TOPL.

[27]  Einar Broch Johnsen,et al.  A Dynamic Binding Strategy for Multiple Inheritance and Asynchronously Communicating Objects , 2004, FMCO.

[28]  Frank S. de Boer,et al.  Verification of Sequential and Concurrent Programs , 1997, Texts and Monographs in Computer Science.

[29]  Denis Caromel,et al.  A natural semantics for Eiffel dynamic binding , 1996, TOPL.

[30]  Linda G. DeMichiel,et al.  The Common Lisp Object System: An Overview , 1987, ECOOP.

[31]  Shengchao Qin,et al.  Enhancing modular OO verification with separation logic , 2008, POPL '08.

[32]  Ohad Kammar,et al.  Algebraic foundations for effect-dependent optimisations , 2012, POPL '12.

[33]  Craig Chambers,et al.  Parents are shared parts of objects: Inheritance and encapsulation in SELF , 1991, LISP Symb. Comput..

[34]  강문설 [서평]「The Unified Modeling Language User Guide」 , 1999 .

[35]  簡聰富,et al.  物件導向軟體之架構(Object-Oriented Software Construction)探討 , 1989 .

[36]  C. A. R. Hoare,et al.  An axiomatic basis for computer programming , 1969, CACM.

[37]  William R. Cook,et al.  Mixin-based inheritance , 1990, OOPSLA/ECOOP '90.

[38]  Frank S. de Boer,et al.  A WP-calculus for OO , 1999, FoSSaCS.

[39]  Einar Broch Johnsen,et al.  Creol: A type-safe object-oriented model for distributed concurrent systems , 2006, Theor. Comput. Sci..

[40]  Bjarne Stroustrup,et al.  Multiple Inheritance for C++ , 1989, Comput. Syst..

[41]  Pierre America,et al.  Designing an Object-Oriented Programming Language with Behavioural Subtyping , 1990, REX Workshop.

[42]  Gavin M. Bierman,et al.  Separation logic, abstraction and inheritance , 2008, POPL '08.

[43]  Cosimo Laneve,et al.  Inheritance in the join calculus , 2003, J. Log. Algebraic Methods Program..