Skip to main content

Hoare Logic for Mutual Recursion and Local Variables

  • Conference paper
  • First Online:
Book cover Foundations of Software Technology and Theoretical Computer Science (FSTTCS 1999)

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

Abstract

We present a (the first?)sou nd and relatively complete Hoare logic for a simple imperative programming language including mutually recursive procedures with call-by-value parameters as well as global and local variables. For such a language we formalize an operational and an axiomatic semantics of partial correctness and prove their equivalence. Global and local variables, including parameters, are handled in a rather straightforward way allowing for both dynamic and simple static scoping. For the completeness proof we employ the powerful MGF (Most General Formula)a pproach, introducing and comparing three variants for dealing with complications arising from mutual recursion.

All this work is done using the theorem prover Isabelle/HOL, which ensures a rigorous treatment of the subject and thus reliable results. The paper gives some new insights in the nature of Hoare logic, in particular motivates a stronger rule of consequence and a new flexible Call rule.

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. K. R. Apt. Ten years of Hoare logic: A survey-part I. ACM Trans. on Prog. Languages and Systems, 3:431–483, 1981. 168, 173, 173

    Article  MATH  Google Scholar 

  2. Stephen A. Cook. Soundness and completeness of an axiom system for program verification. SIAM Journal on Computing, 7(1):70–90, 1978. 171

    Article  MATH  MathSciNet  Google Scholar 

  3. Martin Hofmann. Semantik und Verifikation. Lecture notes, in German. http://www.dcs.ed.ac.uk/home/mxh/teaching/marburg.ps.gz, 1997. 176, 176, 177

  4. Peter V. Homeier and David F. Martin. Mechanical verification of mutually recursive procedures. In M. A. McRobbie and J. K. Slaney, editors, Proceedings of CADE-13, volume 1104 of LNAI, pages 201–215. Springer-Verlag, 1996. 168, 174

    Google Scholar 

  5. Thomas Kleymann. Hoare logic and VDM: Machine-checked soundness and completeness proofs. (Phd Thesis), ECS-LFCS-98-392, LFCS, 1998. 168, 169, 171, 173, 174, 176, 177

    Google Scholar 

  6. Tobias Nipkow. Winskel is (almost)righ t: Towards a mechanized semantics textbook. In V. Chandru and V. Vinay, editors, FST&TCS, volume 1180 of LNCS, pages 180–192. Springer-Verlag, 1996. 169

    Google Scholar 

  7. David von Oheimb and Tobias Nipkow. Machine-checking the Java specification: Proving type-safety. In Jim Alves-Foss, editor, Formal Syntax and Semantics of Java, volume 1523 of LNCS. Springer-Verlag, 1999. 169

    Google Scholar 

  8. Lawrence C. Paulson. Isabelle: A Generic Theorem Prover, volume 828 of LNCS. Springer-Verlag, 1994. Up-to-date description: http://isabelle.in.tum.de/. 169

    MATH  Google Scholar 

  9. A. Poetzsch-Heffter and P. Müller. A programming logic for sequential Java. In S. D. Swierstra, editor, Programming Languages and Systems (ESOP’ 99), volume 1576 of LNCS, pages 162–176. Springer-Verlag, 1999. 174, 176

    Chapter  Google Scholar 

  10. Thomas Schreiber. Auxiliary variables and recursive procedures. In TAPSOFT’97, volume 1214 of LNCS, pages 697–711. Springer-Verlag, 1997. 169, 173

    Google Scholar 

  11. Glynn Winskel. Formal Semantics of Programming Languages. MIT Press, 1993. 170

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 1999 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

von Oheimb, D. (1999). Hoare Logic for Mutual Recursion and Local Variables. In: Rangan, C.P., Raman, V., Ramanujam, R. (eds) Foundations of Software Technology and Theoretical Computer Science. FSTTCS 1999. Lecture Notes in Computer Science, vol 1738. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-46691-6_13

Download citation

  • DOI: https://doi.org/10.1007/3-540-46691-6_13

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

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

  • Online ISBN: 978-3-540-46691-8

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics