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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
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
Stephen A. Cook. Soundness and completeness of an axiom system for program verification. SIAM Journal on Computing, 7(1):70–90, 1978. 171
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
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
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
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
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
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
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
Thomas Schreiber. Auxiliary variables and recursive procedures. In TAPSOFT’97, volume 1214 of LNCS, pages 697–711. Springer-Verlag, 1997. 169, 173
Glynn Winskel. Formal Semantics of Programming Languages. MIT Press, 1993. 170
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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