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

  • Davide Ancona
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7313)

Abstract

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.

Keywords

Type System Complete Lattice Operational Semantic Proof Tree Method Invocation 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Ager, M.S.: From Natural Semantics to Abstract Machines. In: Etalle, S. (ed.) LOPSTR 2004. LNCS, vol. 3573, pp. 245–261. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  2. 2.
    Amadio, R., Cardelli, L.: Subtyping recursive types. ACM Transactions on Programming Languages and Systems 15(4), 575–631 (1993)CrossRefGoogle Scholar
  3. 3.
    Ancona, D.: Coinductive big-step operational semantics for type soundness of Java-like languages. In: Formal Techniques for Java-like Programs (FTfJP 2011), pp. 5:1–5:6. ACM (2011)Google Scholar
  4. 4.
    Ancona, D., Corradi, A., Lagorio, G., Damiani, F.: Abstract Compilation of Object-Oriented Languages into Coinductive CLP(X): Can Type Inference Meet Verification? In: Beckert, B., Marché, C. (eds.) FoVeOOS 2010. LNCS, vol. 6528, pp. 31–45. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  5. 5.
    Ancona, D., Lagorio, G.: Coinductive Type Systems for Object-Oriented Languages. In: Drossopoulou, S. (ed.) ECOOP 2009. LNCS, vol. 5653, pp. 2–26. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  6. 6.
    Ancona, D., Lagorio, G.: Coinductive subtyping for abstract compilation of object-oriented languages into Horn formulas. In: Montanari, A., Napoli, M., Parente, M. (eds.) Proceedings of GandALF 2010. Electronic Proceedings in Theoretical Computer Science, vol. 25, pp. 214–223 (2010)Google Scholar
  7. 7.
    Ancona, D., Lagorio, G.: Idealized coinductive type systems for imperative object-oriented programs. RAIRO - Theoretical Informatics and Applications 45(1), 3–33 (2011)MathSciNetMATHCrossRefGoogle Scholar
  8. 8.
    Arnold, A., Nivat, M.: The metric space of infinite trees. Algebraic and topological properties. Fundamenta Informaticae 3, 445–476 (1980)MathSciNetMATHGoogle Scholar
  9. 9.
    Courcelle, B.: Fundamental properties of infinite trees. Theoretical Computer Science 25, 95–169 (1983)MathSciNetMATHCrossRefGoogle Scholar
  10. 10.
    Ernst, E., Ostermann, K., Cook, W.R.: A virtual class calculus. In: POPL, pp. 270–282 (2006)Google Scholar
  11. 11.
    Igarashi, A., Pierce, B.C., Wadler, P.: Featherweight Java: a minimal core calculus for Java and GJ. ACM Transactions on Programming Languages and Systems 23(3), 396–450 (2001)CrossRefGoogle Scholar
  12. 12.
    Kusmierek, J.D.M., Bono, V.: Big-step operational semantics revisited. Fundam. Inform. 103(1-4), 137–172 (2010)MathSciNetMATHGoogle Scholar
  13. 13.
    Leroy, X., Grall, H.: Coinductive big-step operational semantics. Information and Computation 207, 284–304 (2009)MathSciNetMATHCrossRefGoogle Scholar
  14. 14.
    Tofte, M., Milner, R.: Co-induction in relational semantics. Theoretical Computer Science 87(1), 209–220 (1990)MathSciNetGoogle Scholar
  15. 15.
    Nakata, K., Uustalu, T.: Trace-Based Coinductive Operational Semantics for While. In: Berghofer, S., Nipkow, T., Urban, C., Wenzel, M. (eds.) TPHOLs 2009. LNCS, vol. 5674, pp. 375–390. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  16. 16.
    Nakata, K., Uustalu, T.: A Hoare Logic for the Coinductive Trace-Based Big-Step Semantics of While. In: Gordon, A.D. (ed.) ESOP 2010. LNCS, vol. 6012, pp. 488–506. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  17. 17.
    Simon, L., Mallya, A., Bansal, A., Gupta, G.: Coinductive Logic Programming. In: Etalle, S., Truszczyński, M. (eds.) ICLP 2006. LNCS, vol. 4079, pp. 330–345. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  18. 18.
    Stoughton, A.: An operational semantics framework supporting the incremental construction of derivation trees. Electr. Notes Theor. Comput. Sci. 10 (1997)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2012

Authors and Affiliations

  • Davide Ancona
    • 1
  1. 1.DISIUniversità di GenovaItaly

Personalised recommendations