Logic of Programs 1981: Logics of Programs pp 349-374 | Cite as

A critique of the foundations of Hoare-style programming logics

  • Michael J. O'Donnell
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 131)


Much recent discussion in computing journals has been devoted to arguments about the feasibility and usefulness of formal verification methods for increasing confidence in computer programs. Too little attention has been given to precise criticism of specific proposed systems for reasoning about programs. Whether such systems are to be used for formal verification, by hand or automatically, or as a rigorous foundation for informal reasoning, it is essential that they be logically sound. Several popular rules in the Hoare language are in fact not sound. These rules have been accepted because they have not been subjected to sufficiently strong standards of correctness. This paper attempts to clarify the different technical definitions of correctness of a logic, to show that only the strongest of these definitions is acceptable for Hoare logic, and to correct some of the unsound rules which have appeared in the literature. The corrected rules are given merely to show that it is possible to do so. Convenient and elegant rules for reasoning about certain programming constructs will probably require a more flexible notation than Hoare's.

Key words and phrases

verification soundness partial correctness defined functions Goto logic 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Alagić, S. and Arbib, M.A. The Design of Well-Structured and Correct Programs. Springer-Verlag, New York, (1978).Google Scholar
  2. 2.
    Apt, K.R. A sound and complete Hoare-like system for a fragment of Pascal. Report IW/78, Mathematisch Centrum, Afdeling Informatica, Amsterdam, (1978).Google Scholar
  3. 3.
    Arbib, M.A. and Alagić, S. Proof rules for gotos. Acta Informatica 11.2, (1979), 139–148.CrossRefGoogle Scholar
  4. 4.
    Ashcroft, E.A., Clint M. and Hoare, C.A.R. Remarks on program proving: jumps and functions, Acta Informatica 6:3 (1976), 317.CrossRefGoogle Scholar
  5. 5.
    Clarke, E.M. Programming language constructs for which it is impossible to obtain good Hoare-like axiom systems, JACM 26:1, (1979), 129–147.CrossRefGoogle Scholar
  6. 6.
    Clint, M. and Hoare, C.A.R. Program proving: jumps and functions Acta Informatica 1:3 (1972), 214–224.Google Scholar
  7. 7.
    Constable, R. and O'Donnell, M. A Programming Logic. Winthrop, Cambridge Massachusetts, (1978).Google Scholar
  8. 8.
    Cook, S.A. Soundness and completeness of an axiom system for program verification. SIAM Journal on Computing 7:1 (1978), 70–90.CrossRefGoogle Scholar
  9. 9.
    de Bruin, A. Goto Statements. Chapter 10 of Mathematical Theory of Program Correctness by J. de Bakker. Prentice/Hall International, Englewood Cliffs, NJ, (1980).Google Scholar
  10. 10.
    Dijkstra, E.W. Guarded commands, nondeterminacy and formal derivation of programs. CACM 18:8, (1975), 453–457.Google Scholar
  11. 11.
    Donahue, J.E. Complementary Definitions of Programming Language Semantics. Lecture notes in Computer Science 42, Springer-Verlag, New York, (1976).Google Scholar
  12. 12.
    Floyd, R.W. Assigning meanings to programs. Proceedings of symposia in applied mathematics, 19, American Mathematical Society, Providence, (1967).Google Scholar
  13. 13.
    Hoare, C.A.R. An axiomatic basis for computer programming. CACM 12:10, (1969), 576–580.Google Scholar
  14. 14.
    Hoare, C.A.R. and Wirth, N. An axiomatic definition of the programming language PASCAL. Acta Informatica 2:4, (1973), 335–355.CrossRefGoogle Scholar
  15. 15.
    Kowaltowski, T. Axiomatic approach to side effects and general jumps. Acta Informatica 7:4, (1977), 357–360.CrossRefGoogle Scholar
  16. 16.
    London, R.L., Guttag, J.V., Horning, J.J., Lampson, B.W., Mitchell, J.G., and Popek, G.J. Proof rules for the programming language Euclid. Acta Informatica 10:1, (1978), 1–26.CrossRefGoogle Scholar
  17. 17.
    Manna, Z. and Waldinger, R. Is "sometime" sometimes better than "always"? Second international conference on Software Engineering, (1976).Google Scholar
  18. 18.
    Mendelson, E. Introduction to Mathematical Logic. 2nd edition, Van Nostrand, N.Y., (1976).Google Scholar
  19. 19.
    Musser, D. A proof rule for functions. USC information sciences institute technical report ISI/RR-77-62, (1977).Google Scholar
  20. 20.
    Olderog, E. Sound and complete Hoare-like calculi based on copy rules. Technical report 7905, Christian-Albrechts Universitat, Kiel, (1979).Google Scholar
  21. 21.
    Russell, B. Letter to G. Frege, June 16, 1902. From Frege to Godel: A Source Book in Mathematical Logic, 1879–1931. J. van Heijenoort (Ed.), Harvard University Press, Cambridge, (1967), 124–125.Google Scholar
  22. 22.
    Scott, D. and Strachey, C. Towards a mathematical semantics for computer languages. Computers and Automata. J. Fox (Ed.), Wiley, New York, (1972), 19–46.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1982

Authors and Affiliations

  • Michael J. O'Donnell
    • 1
  1. 1.Purdue UniversityUSA

Personalised recommendations