Skip to main content

A Logic of Object-Oriented Programs

  • Chapter
Verification: Theory and Practice

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

Abstract

We develop a logic for reasoning about object-oriented programs. The logic is for a language with an imperative semantics and aliasing, and accounts for self-reference in objects. It is much like a type system for objects with subtyping, but our specifications go further than types in detailing pre- and postconditions. We intend the logic as an analogue of Hoare logic for object-oriented programs. Our main technical result is a soundness theorem that relates the logic to a standard operational 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 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

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Similar content being viewed by others

References

  1. M. Abadi and L. Cardelli. A Theory of Objects. Springer-Verlag, 1996.

    Google Scholar 

  2. M. Abadi and K. R. M. Leino. A logic of object-oriented programs. In TAPSOFT’ 97: Theory and Practice of Software Development, volume 1214 of Lecture Notes in Computer Science, pages 682-696. Springer-Verlag, April 1997.

    Google Scholar 

  3. K. R. Apt. Ten years of Hoare’s logic: A survey—Part I. ACM Transactions on Programming Languages and Systems, 3(4):431–483, October 1981.

    Article  MATH  Google Scholar 

  4. J. Barwise. An introduction to first-order logic. In J. Barwise, editor, The Handbook of Mathematical Logic, Studies in Logic and Foundations of Mathematics, pages 5-46. North Holland, 1977.

    Google Scholar 

  5. E. M. Clarke. Programming language constructs for which it is impossible to obtain good Hoare axiom systems. Journal of the ACM, 26(1):129–147, January 1979.

    Article  MATH  Google Scholar 

  6. F. S. de Boer. A proof system for the parallel object-oriented laguage POOL. In M. S. Paterson, editor, Proceedings of the Seventeenth International Colloquium on Automata, Languages and Programming, volume 443 of Lecture Notes in Computer Science, pages 572-585. Springer-Verlag, 1990.

    Google Scholar 

  7. Special issue: formal techniques for Java programs. Concurrency and Computation: Practice and Experience, 13(13), November 2001. Edited by S. Eisenbach and G. T. Leavens.

    Google Scholar 

  8. C. Flanagan, K. R. M. Leino, M. Lillibridge, G. Nelson, J. B. Saxe, and R. Stata. Extended static checking for Java. ACM SIGPLAN Notices, 37(5):234-245, June 2002. Proceedings of the ACM SIGPLAN 2002 Conference on Programming Language Design and Implementation.

    Google Scholar 

  9. R. W. Floyd. Assigning meanings to programs. In Proceedings of the Sym posium on Applied Math., Vol. 19, pages 19-32. American Mathematical Society, 1967.

    Google Scholar 

  10. R. Harper. A simplified account of polymorphic references. Information Processing Letters, 51:201–206, 1994.

    Article  MATH  MathSciNet  Google Scholar 

  11. C. A. R. Hoare. An axiomatic basis for computer programming. Communications of the ACM, 12(10):576–583, October 1969.

    Article  MATH  Google Scholar 

  12. M. Hofmann and F. Tang. Implementing a program logic of objects in a higherorder logic theorem prover. In Theorem Proving in Higher Order Logics, 13th International Conference, TPHOLs 2000, volume 1869 of Lecture Notes in Computer Science, pages 268-282. Springer-Verlag, 2000.

    Google Scholar 

  13. B. Jacobs and E. Poll. Coalgebras and monads in the semantics of Java. Theoretical Computer Science, 291(3):329–349, 2003.

    Article  MATH  MathSciNet  Google Scholar 

  14. C. B. Jones. An object-based design method for concurrent programs. Technical Report UMCS-92-12-1, University of Manchester, 1992.

    Google Scholar 

  15. K. Lano and H. Haughton. Reasoning and refinement in object-oriented specification languages. In O. L. Madsen, editor, Proceedings of the 6th Euro pean Conference on Object-Oriented Programming (ECOOP), volume 615 of Lecture Notes in Computer Science, pages 78-97. Springer-Verlag, June 1992.

    Google Scholar 

  16. K. Lano and H. Haughton. Object-Oriented Specification Case Studies. Prentice Hall, New York, 1994.

    MATH  Google Scholar 

  17. G. T. Leavens. Verifying Object-Oriented Programs that Use Subtypes. PhD thesis, MIT Laboratory for Computer Science, February 1989. Available as Technical Report MIT/LCS/TR-439.

    Google Scholar 

  18. G. T. Leavens. Modular specification and verification of object-oriented programs. IEEE Software, pages 72-80, July 1991.

    Google Scholar 

  19. K. R. M. Leino. Toward Reliable Modular Programs. PhD thesis, California Institute of Technology, 1995. Available as Technical Report Caltech-CS-TR-95-03.

    Google Scholar 

  20. K. R. M. Leino. Recursive object types in a logic of object-oriented programs. Nordic Journal of Computing, 5(4):330–360, 1998.

    MATH  MathSciNet  Google Scholar 

  21. K. R. M. Leino and G. Nelson. Data abstraction and information hiding. ACM Transactions on Programming Languages and Systems, 24(5):491–553, September 2002.

    Article  Google Scholar 

  22. X. Leroy. Polymorphic typing of an algorithmic language. Technical report, Institut National de Recherche en Informatique et en Automatique, October 1992. English version of the author’s PhD thesis.

    Google Scholar 

  23. B. H. Liskov and J. M. Wing. A behavioral notion of subtyping. ACM Transactions on Programming Languages and Systems, 16(6):1811–1841, November 1994.

    Article  Google Scholar 

  24. A. R. Meyer and K. Sieber. Towards fully abstract semantics for local variables: Preliminary report. In Conference Record of the Fi f teenth Annual ACM Sym posium on Principles of Programming Languages, pages 191-203, January 1988.

    Google Scholar 

  25. P. Müller. Modular Specification and Verification of Object-Oriented Programs, volume 2262 of Lecture Notes in Computer Science. Springer-Verlag, 2002. PhD thesis, FernUniversität Hagen.

    Google Scholar 

  26. P. W. O’Hearn and R. D. Tennent. Parametricity and local variables. Journal of the ACM, 42(3):658–709, May 1995.

    Article  MATH  MathSciNet  Google Scholar 

  27. S. Owicki and D. Gries. An axiomatic proof technique for parallel programs. Acta Informatica, 6(4):319–340, 1976.

    Article  MATH  MathSciNet  Google Scholar 

  28. S. Peyton Jones, W. Partain, and A. Santos. Let-floating: moving bindings to give faster programs. In Proceedings of the 1996 ACM SIGPLAN International Conference on Functional Programming (ICFP’ 96), pages 1-12, May 1996.

    Google Scholar 

  29. A. M. Pitts and I. D. B. Stark. Observable properties of higher order functions that dynamically create local names, or: What’s new? In Mathematical Foundations of Computer Science, Proc. 18th Int. Symp., Gdańsk, 1993, volume 711 of Lecture Notes in Computer Science, pages 122-141. Springer-Verlag, 1993.

    Google Scholar 

  30. A. Poetzsch-Heffter. Specification and verification of object-oriented programs. Habilitationsschrift, Technische Universität München, 1997. Available at www.eickel.informatik.tu-muenchen.de/persons/poetzsch/habil.ps.gz.

  31. A. Poetzsch-Heffter and P. Müller. Logical foundations for typed object-oriented languages. In D. Gries and W.-P. de Roever, editors, Programming Concepts and Methods (PROCOMET’98), IFIP, pages 404-423. Chapman & Hall, June 1998.

    Google Scholar 

  32. B. Reus and T. Streicher. Semantics and logic of object calculi. In Proceedings of the Seventeenth Annual IEEE Symposium on Logic in Computer Science, pages 113-122, July 2002.

    Google Scholar 

  33. A. Sernadas, C. Sernadas, and J. F. Costa. Object specification logic. Journal of Logic and Computation, 5(5):603–630, 1995.

    Article  MATH  MathSciNet  Google Scholar 

  34. R. Stata and J. V. Guttag. Modular reasoning in the presence of subclassing. ACM SIGPLAN Notices, 30(10):200-214, October 1995. OOPSLA’ 95 conference proceedings.

    Google Scholar 

  35. F. H.-L. Tang. Towards feasible, machine-assisted verification of object-oriented programs. PhD thesis, University of Edinburgh, 2002. Available at www.dcs.ed.ac.uk/home/fhlt/docs/fhlt-thesis.pdf.

    Google Scholar 

  36. M. Tofte. Type inference for polymorphic references. Information and Computation, 89(1):1–34, November 1990.

    Article  MATH  MathSciNet  Google Scholar 

  37. M. Utting. An Object-Oriented Refinement Calculus with Modular Reasoning. PhD thesis, University of New South Wales, 1992. Available at www.cs.waikato.ac.nz/~marku/phd.html.

    Google Scholar 

  38. J. van den Berg and B. Jacobs. The LOOP compiler for Java and JML. In Tools and Algorithms for the Construction and Analysis of Systems, 7th International Conference, TACAS 2001 Held as Part of the Joint European Conferences on Theory and Practice of Software, ETAPS 2001, Proceedings, volume 2031, pages 299-313, 2001.

    Google Scholar 

  39. D. von Oheimb. Hoare logic for Java in Isabelle/HOL. Concurrency and Computation: Practice and Experience, 13(13):1173–1214, November 2001.

    Article  MATH  Google Scholar 

  40. D. von Oheimb and T. Nipkow. Hoare logic for NanoJava: Auxiliary variables, side effects and virtual methods revisited. In Formal Methods — Getting IT Right, volume 2391 of Lecture Notes in Computer Science, pages 89-105. Springer-Verlag, July 2002.

    Google Scholar 

  41. A. K. Wright and M. Felleisen. A syntactic approach to type soundness. Information and Computation, 115(1):38–94, November 1994.

    Article  MATH  MathSciNet  Google Scholar 

  42. A. Yonezawa and M. Tokoro, editors. Object-oriented Concurrent Programming. MIT Press, 1987.

    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 chapter

Cite this chapter

Abadi, M., Leino, K.R.M. (2003). A Logic of Object-Oriented Programs. In: Dershowitz, N. (eds) Verification: Theory and Practice. Lecture Notes in Computer Science, vol 2772. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-39910-0_2

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-39910-0_2

  • Publisher Name: Springer, Berlin, Heidelberg

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

  • Online ISBN: 978-3-540-39910-0

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics