Soundness of Object-Oriented Languages with Coinductive Big-Step Semantics

It is well known that big-step operational semantics are not suitable for proving soundness of type systems, because of their inability to distinguish stuck from non-terminating computations. We show how this problem can be solved by interpreting coinductively the rules for the standard big-step operational semantics of a Java-like language, thus making the claim of soundness more intuitive: whenever a program is well-typed, its coinductive operational semantics returns a value. Indeed, coinduction allows non-terminating computations to return values; this is proved by showing that the set of proof trees defining the semantic judgment forms a complete metric space when equipped with a proper distance function. In this way, we are able to prove soundness of a nominal type system w.r.t. the coinductive semantics. Since the coinductive semantics is sound w.r.t. the usual small-step operational semantics, the standard claim of soundness can be easily deduced.

[1]  W. Cook,et al.  A Virtual Class Calculus , 2005 .

[2]  Robin Milner,et al.  Co-Induction in Relational Semantics , 1991, Theor. Comput. Sci..

[3]  Davide Ancona,et al.  Idealized coinductive type systems for imperative object-oriented programs , 2011, RAIRO Theor. Informatics Appl..

[4]  Alley Stoughton An Operational Semantics Framework Supporting the Incremental Construction of Derivation Trees , 1997, Electron. Notes Theor. Comput. Sci..

[5]  Tarmo Uustalu,et al.  Trace-Based Coinductive Operational Semantics for While , 2009, TPHOLs.

[6]  Viviana Bono,et al.  Big-step Operational Semantics Revisited , 2010, Fundam. Informaticae.

[7]  Tarmo Uustalu,et al.  A Hoare Logic for the Coinductive Trace-Based Big-Step Semantics of While , 2010, ESOP.

[8]  Bernhard Beckert,et al.  Formal Verification of Object-Oriented Software - International Conference, FoVeOOS 2010, Paris, France, June 28-30, 2010, Revised Selected Papers , 2011, FoVeOOS.

[9]  Davide Ancona,et al.  Coinductive subtyping for abstract compilation of object-oriented languages into Horn formulas , 2010, GANDALF.

[10]  Davide Ancona,et al.  Complete coinductive subtyping for abstract compilation of object-oriented languages , 2010, FTfJP@ECOOP.

[11]  Hervé Grall,et al.  Coinductive big-step operational semantics , 2009, Inf. Comput..

[12]  Bruno Courcelle,et al.  Fundamental Properties of Infinite Trees , 1983, Theor. Comput. Sci..

[13]  Brian Campbell,et al.  Amortised Memory Analysis Using the Depth of Data Structures , 2009, ESOP.

[14]  Mads Sig Ager From Natural Semantics to Abstract Machines , 2004 .

[15]  Davide Ancona Coinductive big-step operational semantics for type soundness of Java-like languages , 2011, FTfJP@ECOOP.

[16]  Krzysztof R. Apt,et al.  Logic Programming , 1990, Handbook of Theoretical Computer Science, Volume B: Formal Models and Sematics.

[17]  Manuel V. Hermenegildo,et al.  Energy Consumption Analysis of Programs Based on XMOS ISA-Level Models , 2013, LOPSTR.

[18]  Sophia Drossopoulou ECOOP 2009 - Object-Oriented Programming, 23rd European Conference, Genoa, Italy, July 6-10, 2009. Proceedings , 2009, ECOOP.

[19]  Davide Ancona,et al.  Coinductive Type Systems for Object-Oriented Languages , 2009, ECOOP.

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

[21]  Davide Ancona,et al.  Abstract Compilation of Object-Oriented Languages into Coinductive CLP(X): Can Type Inference Meet Verification? , 2010, FoVeOOS.

[22]  Maurice Nivat,et al.  The metric space of infinite trees. Algebraic and topological properties , 1980, Fundam. Informaticae.

[23]  Luca Cardelli,et al.  Subtyping recursive types , 1991, POPL '91.

[24]  David Aspinall,et al.  Formalising Java's Data Race Free Guarantee , 2007, TPHOLs.