Skip to main content

Laws of Programming for References

  • Conference paper
Programming Languages and Systems (APLAS 2013)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 8301))

Included in the following conference series:

Abstract

We propose a set of algebraic laws for reasoning with sequential imperative programs that use object references like in Java. The theory is based on previous work by adding laws to cope with object references. The incrementality of the algebraic method is fundamental; with a few exceptions, existing laws for copy semantics are entirely reused, as they are not affected by the proposed laws for reference semantics. As an evidence of relative completeness, we show that any program can be transformed, through the use of our laws, to a normal form which simulates it using an explicit heap with copy semantics.

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 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.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

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Back, R.J.R., van Wright, J.: Refinement calculus: a systematic introduction. Springer (1998)

    Google Scholar 

  2. Banerjee, A., Naumann, D.: Ownership confinement ensures representation independence for object-oriented programs. J. ACM 52, 894–960 (2005)

    Article  MathSciNet  Google Scholar 

  3. Banerjee, A., Naumann, D.A., Rosenberg, S.: Local reasoning for global invariants, part I: Region logic. Journal of the ACM 60, 18:1–18:56 (2013)

    Google Scholar 

  4. Benton, N.: Simple relational correctness proofs for static analyses and program transformations. In: POPL, pp. 14–25 (2004)

    Google Scholar 

  5. Berger, M., Honda, K., Yoshida, N.: A logical analysis of aliasing in imperative higher-order functions. SIGPLAN Not. 40(9), 280–293 (2005)

    Article  Google Scholar 

  6. Borba, P., Sampaio, A., Cavalcanti, A., Cornélio, M.: Algebraic reasoning for object-oriented programming. Science of Computer Programming (2004)

    Google Scholar 

  7. Bornat, R.: Proving pointer programs in Hoare logic. In: Backhouse, R., Oliveira, J.N. (eds.) MPC 2000. LNCS, vol. 1837, pp. 102–126. Springer, Heidelberg (2000)

    Chapter  Google Scholar 

  8. Cornélio, M., Cavalcanti, A., Sampaio, A.: Sound refactorings. Science of Computer Programming (2010)

    Google Scholar 

  9. Hoare, C.A.R., et al.: Laws of programming. Communications of the ACM 30(8) (1987)

    Google Scholar 

  10. Hoare, C.A.R., Staden, S.: In praise of algebra. Formal Aspects of Computing, 423–431 (2012)

    Google Scholar 

  11. Hoare, T., Möller, B., Struth, G., Wehrman, I.: Concurrent Kleene algebra and its foundations. J. Log. Algebr. Program. 80(6), 266–296 (2011)

    Article  MathSciNet  MATH  Google Scholar 

  12. Jifeng, H., Li, X., Liu, Z.: rCOS: A refinement calculus of object systems. Theoretical Computer Science 365(1-2), 109–142 (2006)

    Article  MathSciNet  MATH  Google Scholar 

  13. Kassios, I.T.: The dynamic frames theory. Formal Aspects of Computing 23, 267–288 (2011)

    Article  MathSciNet  MATH  Google Scholar 

  14. Kozen, D.: On Hoare logic and Kleene algebra with tests. In: ACM Trans. Comput. Logic. (July 2000)

    Google Scholar 

  15. Lucero, G., Naumann, D., Sampaio, A.: Laws of programming for references, long version (2013), http://www.cs.stevens.edu/~naumann/pub/LuceroNSfull.pdf

  16. Morgan, C.: Programming from specifications. Prentice-Hall, Inc. (1990)

    Google Scholar 

  17. Morris, J.: A general axiom of assignment. In: Broy, M., Schmidt, G. (eds.) Theoretical Foundations of Programming Methodology (1982)

    Google Scholar 

  18. Naumann, D.A., Sampaio, A., Silva, L.: Refactoring and representation independence for class hierarchies. Theoretical Computer Science 433, 60–97 (2012)

    Article  MathSciNet  MATH  Google Scholar 

  19. O’Hearn, P., Reynolds, J., Yang, H.: Local reasoning about programs that alter data structures. In: Computer Science Logic (2001)

    Google Scholar 

  20. Silva, L., A., Sampaio, Z.L.: Laws of object-orientation with reference semantics. In: IEEE Software Engineering and Formal Methods (2008)

    Google Scholar 

  21. Staton, S.: Completeness for algebraic theories of local state. In: Ong, L. (ed.) FOSSACS 2010. LNCS, vol. 6014, pp. 48–63. Springer, Heidelberg (2010)

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2013 Springer International Publishing Switzerland

About this paper

Cite this paper

Lucero, G., Naumann, D., Sampaio, A. (2013). Laws of Programming for References. In: Shan, Cc. (eds) Programming Languages and Systems. APLAS 2013. Lecture Notes in Computer Science, vol 8301. Springer, Cham. https://doi.org/10.1007/978-3-319-03542-0_9

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-03542-0_9

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-03541-3

  • Online ISBN: 978-3-319-03542-0

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics