Skip to main content

A Strategy for Compiling Classes, Inheritance, and Dynamic Binding

  • Conference paper
  • First Online:
FME 2003: Formal Methods (FME 2003)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 2805))

Included in the following conference series:

Abstract.

This paper presents a refinement strategy for the compilation of a subset of Java that includes classes, inheritance, dynamic binding, visibility control, and recursion. We tackle the problem of compiler correctness by reducing the task of compilation to that of program refinement. More specifically, refinement laws are used as compilation rules to reduce the source program to a normal form that models an interpreter running the target code. The compilation process is formalized within a single and uniform semantic framework, where translations or comparisons between semantics are avoided. Each compilation rule can be proved correct with respect to the algebraic laws of the language.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 84.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

References

  1. Back, R.J.R.: Procedural abstraction in the refinement calculus. Technical Report Ser. A No. 55, Department of Computer Science, Abo - Finland (1987)

    Google Scholar 

  2. Borba, P., Sampaio, A., Cornélio, M.: A refinement algebra for object-oriented programming. In: Cardelli, L. (ed.) ECOOP 2003. LNCS, vol. 2743. Springer, Heidelberg (2003)

    Google Scholar 

  3. Börger, E., Schulte, W.: Defining the java virtual machine as platform for provably correct java compilation. In: Brim, L., Gruska, J., Zlatuška, J. (eds.) MFCS 1998. LNCS, vol. 1450, pp. 17–35. Springer, Heidelberg (1998)

    Chapter  Google Scholar 

  4. Cavalcanti, A., Naumann, D.: A weakest precondition semantics for refinement of object-oriented programs. IEEE Transactions on Software Enginnering 26(08), 713–728 (2000)

    Article  Google Scholar 

  5. Cornélio, M., Cavalcanti, A.: Augusto Sampaio. Refactoring by transformation. In: Proceedings of REFINE 2002. Electronic Notes in Theoretical Computer Science (2002)

    Google Scholar 

  6. Dijkstra, E.W.: A Discipline of Programming. Prentice-Hall, Englewood Cliffs (1976)

    MATH  Google Scholar 

  7. Duran, A., Cavalcanti, A., Sampaio, A.: Refinement algebra for formal bytecode generation. In: George, C.W., Miao, H. (eds.) ICFEM 2002. LNCS, vol. 2495, pp. 347–358. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  8. Duran, A., Cavalcanti, A., Sampaio, A.: A refinement strategy for the compilation of classes, inheritance, and dynamic binding (extended version). Technical report, Computing Laboratory, University of Kent at Canterbury (2003)

    Google Scholar 

  9. Duran, A., Sampaio, A., Cavalcanti, A.: Formal bytecode generation for rool virtual machine. In: IV WMF— Workshop on Formal Methods, PUC—Rio de Janeiro/Brazil (October 2001)

    Google Scholar 

  10. Hoare, C.A.R., He, J., Sampaio, A.: Normal form approach to compiler design. Acta Informatica 30, 701–739 (1993)

    Article  MathSciNet  Google Scholar 

  11. Lindholm, T., Yellin, F.: The java Virtual Machine Specification. Addison-Wesley, Reading (1997)

    Google Scholar 

  12. McCarthy, J., Painter, J.: Correctness of a compiler for arithmetic expressions. In: Symposium on Applied Mathematics, pp. 33–41. American Mathematical Society (1967)

    Google Scholar 

  13. Morgan, C.: Programming from Specifications, 2nd edn. Prentice Hall, Englewood Cliffs (1994)

    MATH  Google Scholar 

  14. Müller-Olm, M.: Modular Compiler Verification. LNCS, vol. 1283. Springer, Heidelberg (1997)

    Book  Google Scholar 

  15. Sampaio, A.: An Algebraic Approach to Compiler Design. AMAST Series in Computing, vol. 4. World Scientific, Singapore (1997)

    Book  Google Scholar 

  16. Stärk, R., Schmid, J., Börger, E.: Java and the Java Virtual Machine - Definition, Verification, Validation. Springer, Heidelberg (2001)

    Book  Google Scholar 

  17. Wildman, L.: A formal basis for a program compilation proof tool. In: Eriksson, L.-H., Lindsay, P.A. (eds.) FME 2002. LNCS, vol. 2391, p. 491. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2003 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Duran, A., Cavalcanti, A., Sampaio, A. (2003). A Strategy for Compiling Classes, Inheritance, and Dynamic Binding. In: Araki, K., Gnesi, S., Mandrioli, D. (eds) FME 2003: Formal Methods. FME 2003. Lecture Notes in Computer Science, vol 2805. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-45236-2_18

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-45236-2_18

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-40828-4

  • Online ISBN: 978-3-540-45236-2

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics