Abstract
An extension of Dijkstra's guarded command language is studied, including unbounded demonic choice and a backtrack operator. We consider three orderings on this language: a refinement ordering defined by Back, a new deadlock ordering, and an approximation ordering of Nelson. The deadlock ordering is in between the two other orderings. All operators are monotonic in Nelson's ordering, but backtracking is not monotonic in Back's ordering and sequential composition is not monotonic for the deadlock ordering. At first sight recursion can only be added using Nelson's ordering. We show that, under certain circumstances, least fixed points for non-monotonic functions can be obtained by iteration from the least element. This permits the addition of recursion even using Back's ordering or the deadlock ordering in a fully compositional way. In order to give a semantic characterization of the three orderings that relates initial states to possible outcomes of the computation, the relation between predicate transformers and discrete power domains is studied. We consider (two versions of) the Smyth power domain and the Egli-Milner power domain.
Similar content being viewed by others
References
Apt, K.R. and Plotkin, G.: A Cook's tour of Countable Nondeterminism. In S. Evens and O. Kariv, editors,Proc. 8th ICALP, Lecture Notes in Computer Science 115, Akko, Israel, 1981. Springer-Verlag.
Apt, K.R. and Plotkin, G.: Countable Nondeterminism and Random Assignment.Journal of the ACM, 33(4):724–767, October 1986.
Back, R.-J.R.:On the Correctness of Refinement Steps in Program Development. PhD thesis, Department of Computer Science, University of Helsinki, 1978. Report A-1978-4.
Back, R.-J.R.:Correctness Preserving Program Refinements: Proof Theory and Applications. Mathematical Centre Tracts vol. 131, Mathematical Centre, Amsterdam, 1980.
Back, R.-J.R.: On Correct Refinement of Programs.Journal of Computer and System Sciences, 23(l):49–68, 1981.
Back, R.-J.R.: Refinement Calculus, part II: Parallel and Reactive Programs. In J.W. de Bakker, W.-P. de Roever, and G. Rozenberg, editors,Stepwise Refinement of Distributed Systems: Models, Formalisms, Correctness, Lecture Notes in Computer Science 430, pp. 67–93. Springer-Verlag, 1990.
de Bakker, J.W.:Mathematical Theory of Program Correctness. Prentice-Hall, 1980.
Best, E.: Relational Semantic of Concurrent Programs (with some Applications). In D. Bjorner, editor,Proc. of the IFIP Working Conference on on Formal Description of Programming Concepts-II, pp. 431–452, Garmisch-Partenkirchen, FRG, 1983. North-Holland Publishing Company.
Bonsangue, M.M. and Kok, J.N.: Isomorphisms between State and Predicate Transformers. In A.M. Borzyszkowski and S. Sokolowoski, editors,Proc. MFCS '93, Gdansk, Poland, Lecture Notes in Computer Science 711, pp. 301–310. Springer-Verlag, 1993.
Bonsangue, M.M. and Kok, J.N.: The Weakest Precondition Calculus: Recursion and Duality.Formal Aspects of Computing, 6(E): 71–100, 1994.
Back, R.-J.R. and von Wright, J.: Refinement Calculus, part I: Sequential Nondeterministic Programs. In J.W. de Bakker, W.-P. de Roever, and G. Rozenberg, editors,Stepwise Refinement of Distributed Systems: Models, Formalisms, Correctness, Lecture Notes in Computer Science 430, pp. 42–66. Springer-Verlag, 1990.
Dijkstra, E.W. and van Gasteren, A.J.M.: A Simple Fixpoint Argument without the Restriction to Continuity.Acta Informatica, 23:l-7, 1986.
Dijkstra, E.W.:A Discipline of Programming. Prentice-Hall, 1976.
Dijkstra, E.W. and Scholten, C.S.:Predicate Calculus and Program Semantics. Springer-Verlag, New York, 1990.
Hehner, E.C.R.: do considered od: a Contribution to Programming Calculus.Acta Informatica, 11:287–304, 1979.
Hesselink, W.H.: Predicate Transformer Semantics of General Recursion.Acta Informatica, 26:309–332, 1989.
Hitchcock, P. and Park, D.: Induction Rules and Termination Proofs. In M. Nivat, editor,Proc. 1st ICALP, Rocquencourt, France, 1972. North-Holland.
Meyer, J.-J.Ch:Programming Calculi Based on Fixed Point Transformations: Semantics and Applications. PhD thesis, Vrije Universiteit, Amsterdam, 1985.
Morris, J.: A Theoretical Basis for Stepwise Refinement and the Programming Calculus.Science of Computer Programming, 9:287–306, 1987.
Morgan, C.C., Robinson, K.A., and Gardiner, P.H.B.: On the Refinement Calculus. Technical Report PRG-70, Programming Research Group, 1988.
Nelson, G.: A Generalization of Dijkstra's Calculus.ACM Transaction on Programming Languages and Systems, 11(4):517–561, 1989.
Plotkin, G.D.: Dijkstra's Predicate Transformer and Smyth's Powerdomain. InProc. of the Winter School on Abstract Software Specification, Lecture Notes in Computer Science 86, pp. 527–553. Springer-Verlag, 1979.
Plotkin, G.D.: Post-Graduate Lecture Notes in Advanced Domain Theory (incorporating the “Pisa Notes”). Department of Computer Science, Univ. of Edinburgh, 1981.
de Roever, W.P.: Dijkstra's Predicate Transformer, Non-Determinism, Recursion, and Terminations. InProc. 5th MFCS, Lecture Notes in Computer Science 45, pp. 472–481. Springer-Verlag, 1976.
Smyth, M.B.: Power Domains.Journal of Computer and System Sciences, 16(1):23–36, 1978.
Smyth, M.B.: Power Domains and Predicate Transformers: A Topological View. In J. Diaz, editor,Proc. 10th ICALP, Lecture Notes in Computer Science 154, pp. 662–675, Barcelona, Spain, 1983. Springer-Verlag.
Wand, M.: A Characterisation of Weakest Preconditions.Journal of Computer and System Sciences, 15:209–212, 1977.
von Wright, J.: A Lattice-theoretical Basis for Program Refinement. PhD thesis, Abo Akademi, 1990.
Author information
Authors and Affiliations
Corresponding author
Electronic supplementary material
Rights and permissions
About this article
Cite this article
Bonsangue, M.M., Kok, J.N. The weakest precondition calculus: Recursion and duality. Formal Aspects of Computing 6 (Suppl 1), 788–800 (1994). https://doi.org/10.1007/BF01213603
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/BF01213603