Summary
This paper is about the Floyd-Hoare Principle which says that the semantics of a programming language can be formally specified by axioms and rules of inference for proving the correctness of programs written in the language. We study the simple language WP of while-programs and Hoare's system for partial correctness and we calculate the relational semantics of WP as this is determined by Hoare's logic. This calculation is possible by using relational semantics to build a completeness theorem for the logic. The resulting semantics AX we call the axiomatic relational semantics for WP. This AX is not the conventional semantics for WP: it need not be effectively computable or deterministic, for example. A large number of elegant properties of AX are proved and the Floyd-Hoare Principle is reconsidered.
Similar content being viewed by others
References
Apt, K.R.: Ten years of Hoare's logic. A Survey: Part 1. ACM Trans. Progr. Lang. Syst. 3, 431–483 (1981)
Andreka, H., Nemeti, I.: Completeness of Floyd Logic. Bull. Sect. Logic Wroclaw 7, 115–121 (1978)
Andreka, H., Nemeti, I., Sain, I.: A complete logic for reasoning about programs via non-standard model theory. Theor. Comput. Sci. 17, 193–212 (1982)
Andreka, H., Nemeti, I., Sain, I.: A characterization of Floyd-provable programs. In: Mathematical Foundations of Computer Science 1981, Lecture Notes in Computer Science 118. Berlin, Heidelberg, New York: Springer, pp. 162–171, 1981
de Bakker, J.W.: Mathematical theory of program correctness. London: Prentice-Hall 1980
Bergstra, J.A., Tiuryn, J., Tucker, J.V.: Floyd's Principle, correctness theories and program equivalence. Theor. Comput. Sci. 17, 113–149 (1982)
Bergstra, J.A., Tucker, J.V.: Some natural structures which fail to possess a sound and decidable Hoare-like logic for their while-programs. Theor. Comput. Sci. 17, 303–315 (1982)
Bergstra, J.A., Tucker, J.V.: Algebraically specified programming systems and Hoare's logic. In: International Colloquium on Automata, Languages and Programming 1981, Lecture Notes in Computer Science 115. Berlin, Heidelberg, New York: Springer pp. 348–362, 1981
Bergstra, J.A., Tucker, J.V.: The refinement of specifications and the stability of Hoare's logic. In: Logics of Programs, Lecture Notes in Computer Science 131. Berlin, Heidelberg, New York: Springer pp. 24–36, 1981
Bergstra, J.A., Tucker, J.V.: Expressiveness and the completeness of Hoare's logic. J. Comput. Syst. Sci. 25, 276–284 (1982)
Bergstra, J.A., Tucker, J.V.: Two theorems about the completeness of Hoare's logic. Information Processing Lett. 15, 143–149 (1982)
Bergstra, J.A., Tucker, J.V.: Hoare's logic and Peano's Arithmetic. Theor. Comput. Sci. 22, 265–284 (1983)
Bergstra, J.A., Tucker, J.V.: Hoare's logic for programming languages with two data types. Theor. Comput. Sci. 28, 213–221 (1984)
Cook, S.A.: Soundness and completeness of an axiomatic system for program verification. SIAM J. Comput. 7, 70–90 (1978), Corrigendum 10, 612 (1981)
Csirmaz, L.: On the completeness of proving partial correctness. Acta Cybernet. 5, 181–190 (1981)
Csirmaz, L., Paris, J.B.: A property of 2-sorted Peano models and program verification. Preprint, Math. Inst., Hungarian Academy, Budapest, 1981
Dijkstra, E.W.: Guarded commands, nondeterminacy and formal derivation of programs. Commun. ACM 18, 453–457 (1975)
Dijkstra, E.W.: A discipline of programming. Engelwood Cliffs: Prentice-Hall, 1976
Floyd, R.W.: Assigning meaning to programs. In: Mathematical aspects of computer science. J.T. Schwartz (ed.). AMS, pp. 19–32, 1967
Goguen, J.A., Thatcher, J.W., Wagner, E.G.: An initial algebra approach to the specification, correctness and implementation of abstract data types. In: Current trends in programming methodology IV, Data structuring. R.T. Yeh (ed.). Englewood Cliffs, New Jersey: Prentice-Hall, pp. 80–149, 1978
Greif, I., Meyer, A.R.: Specifying the semantics of while programs: a tutorial and critique of a paper by Hoare and Lauer. ACM Trans. Progr. Lang. Syst. 3, 484–507 (1981)
Hoare, C.A.R.: An axiomatic basis for computer programming, Commun. ACM 12, 576–580 (1969)
Hoare, C.A.R.: Procedures and parameters: an axiomatic approach. In: Symposium on the semantics of algorithmic languages. E. Engeler (ed.). Berlin, Heidelberg, New York: Springer pp. 102–116, 1971
Hoare, C.A.R., Lauer, P.: Consistent and complementary formal theories of the semantics of programming languages. Acta Informat. 3, 135–155 (1974)
Hoare C.A.R., Wirth, N.: An axiomatic definition of the programming language PASCAL. Acta Informat. 2, 335–355 (1973)
Kröger, F.: Infinite proof rules for loops. Acta Informat. 14, 371–389 (1980)
Lauer, P.: Consistent and complementary formal theories of the semantics of programming languages, Ph. D. Thesis Queens University, Belfast, 1972
London, R.L., Guttag, J.V., Horning, J.J., Lampson, B.W., Mitchell, J.G., Popek, G.L.: Proof rules for the programming language EUCLID. Acta Informat. 10, 1–26 (1978)
Manna, Z.: The correctness of programs. J. Comput. Syst. Sci. 3, 119–127 (1969)
Mal'cev, A.I.: Constructive algebras I. Russian Math. Surveys 16, 77–129 (1961)
McGettrick, A.: The definition of programming languages, Cambridge: University Press, 1980
Meyer, A.R., Halpern, J.Y.: Axiomatic definitions of programming languages. A theoretical assessment. J. ACM 29, 555–576 (1982)
Meyer, A.R., Halpern, J.Y.: Axiomatic definitions of programming languages II. MIT Lab. Comput. Sci. TM-179 (1980)
Pagan, F.G.: Formal specification of programming languages. Englewood Cliffs: Prentice-Hall, 1981
Rabin, M.O.: Computable algebra, general theory and the theory of computable fields. Trans. AMS 95, 341–360 (1960)
Schwartz, R.: An axiomatic semantic definition of ALGOL 68. UCLA Computer Science Report 7838, 1978
Tucker, J.V., Zucker, J.I.: Program correctness over abstract data types, with error state semantics, Monograph (In prep.)
Author information
Authors and Affiliations
Rights and permissions
About this article
Cite this article
Bergstra, J.A., Tucker, J.V. The axiomatic semantics of programs based on Hoare's logic. Acta Informatica 21, 293–320 (1984). https://doi.org/10.1007/BF00264252
Received:
Issue date:
DOI: https://doi.org/10.1007/BF00264252