Summary
General correctness, which subsumes partial and total correctness, is defined for both weakest preconditions and strongest postconditions. Healthiness properties for general-correctness predicate transformers are more uniform and complete than those for partial- and total-correctness systems. In fact, the healthiness properties for partial and total correctness are simple restrictions of those for general correctness. General correctness allows simple formulations of the connections between weakest and strongest postconditions and between the notions of weakest precondition under the “demonic” and “angelic” interpretations of nondeterminism. A problem that plagues sp-sp(P, C) is undefined if execution of C begun in some state of P may not terminate — disappears with the generalization.
This paper is a study of some simple theory underlying predicate transformer semantics, and as yet has little bearing on current programming practices. The theory uses a relational model of programs.
Similar content being viewed by others
References
Back, R.J.: Semantics of unbounded nondeterminism. Proc. ICALP 80, Lecture Notes in Computer Science 85, pp. 51–63. Berlin-Heidelberg-New York: Springer 1980
de Bakker, J.W.: Recursive programs as predicate transformers. In: Formal Description of Programming Concepts (E.J. Neuhold, ed.), pp. 165–181. Amsterdam: North Holland 1978
Barringer, H., Cheng, J.H., Jones, C.B.: A logic covering undefinedness in program proofs. Tech. Rep., University of Manchester 1984
Dijkstra, E.W.: A Discipline of Programming. Englewood Cliffs: Prentice-Hall 1976
Floyd, R.W.: Nondeterministic algorithms. J. ACM 4, 636–644 (1967)
Gries, D.: The Science of Programming. Berlin-Heidelberg-New York: Springer 1981
Guerreiro, P.: Another characterization of weakest preconditions. Lecture Notes in Computer Science 137, pp. 164–177. Berlin-Heidelberg-New York: Springer 1982
Harel, D.: On the total correctness of nondeterministic programs. IBM Research Report RC 7691, 1979
Hehner, R.: Predicative programming. Part I. CACM 27, 134–143 (1984)
Hoare, C.A.R.: Some properties of predicate transformers. J. ACM 23, 461–480 (1978)
Hoare, C.A.R., Lauer, P.E.: Consistent and complementary formal theories of the semantics of programming languages. Acta Inf. 3, 135–153 (1974)
Jacobs, D.: General Correctness: a Unification of Partial and Total Correctness. Ph.D. Thesis, Computer Science Dept., Cornell University 1984
Majster-Cederbaum, M.E.: A simple relation between relational and predicate transformer semantics for nondeterministic programs. Inf. Process. Lett. 4, 190–192 (1980)
Plotkin, G.D.: A powerdomain construction. SIAM J. Comput 5, 452–487 (1976)
de Roever, W.P.: Dijkstra's predicate transformer, nondeterminism, recursion, and termination. Lecture Notes in Computer Science 45, pp. 472–481. Berlin-Heidelberg-New York: Springer 1976
Smyth, M.: Powerdomains. J. Comput. Syst Sci. 16 (1978)
Wand, M.: A characterization of weakest preconditions. J. Comput Syst Sci. 15, 209–212 (1977)
Author information
Authors and Affiliations
Additional information
This work was supported by the National Science Foundation under grant MCS-81-03605 and by the second author's Guggenheim Fellowship. This paper is based on the first author's Ph.D. thesis at Cornell.
Rights and permissions
About this article
Cite this article
Jacobs, D., Gries, D. General correctness: A unification of partial and total correctness. Acta Informatica 22, 67–83 (1985). https://doi.org/10.1007/BF00290146
Received:
Issue Date:
DOI: https://doi.org/10.1007/BF00290146