Skip to main content

Proving Pointer Programs in Hoare Logic

  • Conference paper
Mathematics of Program Construction (MPC 2000)

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

Included in the following conference series:

Abstract

It is possible, but difficult, to reason in Hoare logic about programs which address and modify data structures defined by pointers. The challenge is to approach the simplicity of Hoare logic’s treatment of variable assignment, where substitution affects only relevant assertion formula. The axiom of assignment to object components treats each component name as a pointer-indexed array. This permits a formal treatment of inductively defined data structures in the heap but tends to produce instances of modified component mappings in arguments to inductively defined assertions. The major weapons against these troublesome mappings are assertions which describe spatial separation of data structures. Three example proofs are sketched.

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. Appel, A.W., Felty, A.P.: A Semantic Model of Types and Machine Instructions for Proof- Carrying Code. In: 27th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL 2000), January 2000, pp. 243–253 (2000)

    Google Scholar 

  2. Arnold, K., Gosling, J.: The Java programming language. Addison-Wesley, Reading (1997)

    Google Scholar 

  3. Bijlsma, A.: Calculating with Pointers. Science of Computer Programming 12, 191–205 (1989)

    Article  MATH  MathSciNet  Google Scholar 

  4. Bornat, R.: Machine-checked proofs of list reversal, list merge, Schorr-Waite, Available from http://www.dcs.qmw.ac.uk/~richard/pointers

  5. Bornat, R., Sufrin, B.A.: Animating formal proof at the surface: the Jape proof calculator. The Computer Journal 43(3), 177–192 (1999)

    Article  Google Scholar 

  6. Burstall, R.M.: Some techniques for proving correctness of programs which alter data structures. In: Michie, D. (ed.) Machine Intelligence 7, pp. 23–50. American Elsevier, New York (1972)

    Google Scholar 

  7. Cousot, P.: Methods and Logics for Proving Programs. In: van Leeuwen, J. (ed.) Formal Models and Semantics. Handbook of Theoretical Computer Science, vol. B, pp. 843–993. Elsevier, Amsterdam (1990)

    Google Scholar 

  8. Floyd, R.W.: Assigning meaning to programs. In: Proc. Symp. in App. Math., American Mathematical Society, vol. 19, pp. 19–32 (1967)

    Google Scholar 

  9. Gries, D.: The Schorr-Waite graph marking algorithm. Acta Informatica 11, 223–232 (1979)

    Article  MATH  Google Scholar 

  10. Gries, D., Levin, G.M.: Assignment and procedure call proof rules. ACM Transactions on Programming Languages and Systems 2, 564–579 (1980)

    Article  MATH  Google Scholar 

  11. Hoare, C.A.R.: An axiomatic basis for computer programming. Comm. ACM 12(10), 576–580 and 583 (1969)

    Google Scholar 

  12. Hoare, C.A.R., Jifeng, H.: A Trace Model for Pointers and Objects. In: Guerraoui, R. (ed.) ECOOP 1999. LNCS, vol. 1628, pp. 1–17. Springer, Heidelberg (1999)

    Chapter  Google Scholar 

  13. Hoare, C.A.R., Wirth, N.: An Axiomatic Definition of the Programming Language Pascal. Acta Informatica 2, 335–355 (1973)

    Article  Google Scholar 

  14. Jensen, K., Wirth, N.: Pascal user manual and report. Springer, Heidelberg (1975)

    MATH  Google Scholar 

  15. Kernighan, B.W., Ritchie, D.M.: The C programming language. Prentice-Hall, Englewood Cliffs (1978)

    Google Scholar 

  16. Kowaltowski, T.: Data Structures and Correctness of Programs. Journal of the ACM 2, 283–301 (1979)

    Article  MathSciNet  Google Scholar 

  17. Kowaltowski, T.: Examples of Informal but Rigorous Correctness Proofs for Tree Traversing Algorithms. Technical report TR-DCC-92-10, University of Campinas, Brazil

    Google Scholar 

  18. Leino, R.: Toward Reliable Modular Programs. PhD Thesis, California Institute of Technology (1995)

    Google Scholar 

  19. Luckham, D.C., Suzuki, N.: Verification of Array, Record, and Pointer Operations in Pascal. ACM Transactions on Programming Languages and Systems, Examples of Informal but Rigorous Correctness Proofs for Tree Traversing Algorithms 1, 226–244 (1979)

    MATH  Google Scholar 

  20. McCarthy, J., Painter, J.A.: Correctness of a Compiler for Arithmetic Expressions. In: Proceedings Symposium in Applied Mathematics, Mathematical Aspects of Computer Science, vol. 19, pp. 33–41 (1967)

    Google Scholar 

  21. Morris, J.M.: A general axiom of assignment. Assignment and linked data structure. A proof of the Schorr-Waite algorithm. In: Broy, M., Schmidt, G. (eds.) Theoretical Foundations of Programming Methodology (Proceedings of the 1981 Marktoberdorf Summer School), pp. 25–51. Reidel (1982)

    Google Scholar 

  22. Necula, G., Lee, P.: Safe, Untrusted Agents using Proof-Carrying Code. In: Vigna, G. (ed.) Mobile Agents and Security. LNCS, vol. 1419, pp. 61–91. Springer, Heidelberg (1998)

    Chapter  Google Scholar 

  23. Reynolds, J.C.: The Craft of Programming. Prentice-Hall International, Englewood Cliffs (1981)

    MATH  Google Scholar 

  24. Reynolds, J.C.: Reasoning about Shared Mutable Data Structure, given at the symposium in celebration of the work of C.A.R. Hoare, Oxford (September 1999)

    Google Scholar 

  25. Schorr, H., Waite, W.M.: An efficient machine-independent procedure for garbage collection in various list structures. Comm. ACM 10, 501–506 (1967)

    Article  MATH  Google Scholar 

  26. Strachey, C.: Towards a Formal Semantics. In: Steel Jr., T.B. (ed.) Formal Language Description Languages for Computer Programming. North-Holland, Amsterdam (1964)

    Google Scholar 

  27. Suzuki, N.: Automatic verification of programs with complex data structure. PhD Thesis, Stanford U (1976)

    Google Scholar 

  28. Topor, R.W.: The correctness of the Schorr-Waite list marking algorithm. Acta Informatica 11, 211–221 (1979)

    Article  MATH  MathSciNet  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2000 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Bornat, R. (2000). Proving Pointer Programs in Hoare Logic. In: Backhouse, R., Oliveira, J.N. (eds) Mathematics of Program Construction. MPC 2000. Lecture Notes in Computer Science, vol 1837. Springer, Berlin, Heidelberg. https://doi.org/10.1007/10722010_8

Download citation

  • DOI: https://doi.org/10.1007/10722010_8

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-67727-7

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

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics