Skip to main content

A Refinement Algebra for Object-Oriented Programming

  • Conference paper

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

Abstract

In this article we introduce a comprehensive set of algebraic laws for ROOL, a language similar to sequential Java but with a copy semantics. We present a few laws of commands, but focus on the object-oriented features of the language. We show that this set of laws is complete in the sense that it is sufficient to reduce an arbitrary ROOL program to a normal form expressed in a restricted subset of the ROOL operators. We also propose a law for data refinement that generalises the technique from traditional modules to class hierarchies. Together, these laws are expressive enough to derive more elaborate rules that can be useful, for example, to formalize object-oriented design practices; this is illustrated through the systematic derivation of a refactoring from the proposed laws.

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

Buying options

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 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

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Hoare, C.A.R., et al.: Laws of programming. Communications of the ACM 30, 672–686 (1987)

    Article  MATH  MathSciNet  Google Scholar 

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

    MATH  Google Scholar 

  3. Sampaio, A.: An Algebraic Approach to Compiler Design. Algebraic Methodology and Software Technology, vol. 4. World Scientific, Singapore (1997)

    Book  MATH  Google Scholar 

  4. Roscoe, A., Hoare, C.A.R.: The laws of occam programming. Theoretical Computer Science 60, 177–229 (1988)

    Article  MATH  MathSciNet  Google Scholar 

  5. Bird, R., de Moor, O.: Algebra of Programming. Prentice-Hall, Englewood Cliffs (1997)

    MATH  Google Scholar 

  6. Seres, S., Spivey, M., Hoare, T.: Algebra of logic programming. In: ICPL 1999, New Mexico, USA (1999)

    Google Scholar 

  7. Hoare, C., Jifeng, H.: Unifying Theories of Programming. Prentice-Hall, Englewood Cliffs (1998)

    Google Scholar 

  8. Fowler, M.: Refactoring—Improving the design of existing code. Addison-Wesley, Reading (1999)

    Google Scholar 

  9. Lea, D.: Concurrent Programming in Java. Addison-Wesley, Reading (1997)

    MATH  Google Scholar 

  10. Opdyke, W.: Refactoring Object-Oriented Frameworks. PhD thesis, University of Illinois at Urbana-Champaign (1992)

    Google Scholar 

  11. Roberts, D.: Practical Analysis for Refactoring. PhD thesis, University of Illinois at Urbana Champaign (1999)

    Google Scholar 

  12. Mikhajlova, A., Sekerinsk, E.: Class refinement and interface refinement in object-oriented programs. In: Fitzgerald, J.S., Jones, C.B., Lucas, P. (eds.) FME 1997. LNCS, vol. 1313, pp. 82–101. Springer, Heidelberg (1997)

    Google Scholar 

  13. Leino, K.R.M.: Recursive Object Types in a Logic of Object-oriented Programming. In: Hankin, C. (ed.) ESOP 1998. LNCS, vol. 1381, p. 170. Springer, Heidelberg (1998)

    Google Scholar 

  14. Evans, A.: Reasoning with UML class diagrams. In: Workshop on Industrial Strength Formal Methods, WIFT 1998, Florida, USA. IEEE Press, Los Alamitos (1998)

    Google Scholar 

  15. Evans, A., France, R., Lano, K., Rumpe, B.: The UML as a formal modeling notation. In: Bézivin, J., Muller, P.-A. (eds.) UML 1998. LNCS, vol. 1618, pp. 336–348. Springer, Heidelberg (1999)

    Chapter  Google Scholar 

  16. Lano, K., Bicarregui, J.: Semantics and transformations for UML models. In: Bézivin, J., Muller, P.-A. (eds.) UML 1998. LNCS, vol. 1618, pp. 107–119. Springer, Heidelberg (1999)

    Chapter  Google Scholar 

  17. Gogolla, M., Richters, M.: Transformation rules for UML class diagrams. In: Bézivin, J., Muller, P.-A. (eds.) UML 1998. LNCS, vol. 1618, pp. 92–106. Springer, Heidelberg (1999)

    Chapter  Google Scholar 

  18. Booch, G., Jacobson, I., Rumbaugh, J.: The Unified Modelling Language User Guide. Addison-Wesley, Reading (1999)

    Google Scholar 

  19. Cavalcanti, A., Naumann, D.: A weakest precondition semantics for an objectoriented language of refinement. In: Woodcock, J.C.P., Davies, J., Wing, J.M. (eds.) FM 1999. LNCS, vol. 1709, pp. 1439–1459. Springer, Heidelberg (1999)

    Google Scholar 

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

    Article  Google Scholar 

  21. Arnold, K., Gosling, J.: The Java Programming Language. Addison Wesley, Reading (1996)

    MATH  Google Scholar 

  22. Gosling, J., Joy, B., Steele, G.: The Java Language Specification. Addison-Wesley, Reading (1996)

    MATH  Google Scholar 

  23. Cornélio, M. L.: Applying Object-oriented Refactoring and Patterns as Formal Refinements. PhD thesis, Informatics Center, Federal University of Pernambuco, Brazil (to appear in 2003)

    Google Scholar 

  24. Lira, B.O.: Automação de Regras para Programação Orientada a Objetos. Master’s thesis, Centro de Informática, Universidade Federal de Pernambuco, Brazil (2002)

    Google Scholar 

  25. Meseguer, J.: A logical theory of concurrent objects and its realization in the Maude language. In: Agha, G., Wegner, P., Yonezawa, A. (eds.) Object-Oriented Programming, pp. 314–390. MIT Press, Cambridge (1993)

    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

Borba, P., Sampaio, A., Cornélio, M. (2003). A Refinement Algebra for Object-Oriented Programming. In: Cardelli, L. (eds) ECOOP 2003 – Object-Oriented Programming. ECOOP 2003. Lecture Notes in Computer Science, vol 2743. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-45070-2_20

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-45070-2_20

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-40531-3

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

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics