Advertisement

Formal Aspects of Computing

, Volume 6, Supplement 1, pp 788–800 | Cite as

The weakest precondition calculus: Recursion and duality

  • Marcello M. Bonsangue
  • Joost N. Kok
Article

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.

Keywords

Weakest (liberal) preconditions Refinement Fixed point transformations Smyth power domain Egli-Milner power domain Recursion Denotational semantics 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Supplementary material

165_2005_BF01213603_MOESM1_ESM.pdf (350 kb)
Supplementary material, approximately 358 KB.

References

  1. [ApP81]
    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.Google Scholar
  2. [ApP86]
    Apt, K.R. and Plotkin, G.: Countable Nondeterminism and Random Assignment.Journal of the ACM, 33(4):724–767, October 1986.CrossRefzbMATHMathSciNetGoogle Scholar
  3. [Bac78]
    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.Google Scholar
  4. [Bac80]
    Back, R.-J.R.:Correctness Preserving Program Refinements: Proof Theory and Applications. Mathematical Centre Tracts vol. 131, Mathematical Centre, Amsterdam, 1980.Google Scholar
  5. [Bac81]
    Back, R.-J.R.: On Correct Refinement of Programs.Journal of Computer and System Sciences, 23(l):49–68, 1981.CrossRefzbMATHMathSciNetGoogle Scholar
  6. [Bac90]
    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.Google Scholar
  7. [Bak80]
    de Bakker, J.W.:Mathematical Theory of Program Correctness. Prentice-Hall, 1980.Google Scholar
  8. [Bes83]
    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.Google Scholar
  9. [BoK93]
    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.Google Scholar
  10. [BoK94]
    Bonsangue, M.M. and Kok, J.N.: The Weakest Precondition Calculus: Recursion and Duality.Formal Aspects of Computing, 6(E): 71–100, 1994.Google Scholar
  11. [BaW90]
    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.Google Scholar
  12. [DiG86]
    Dijkstra, E.W. and van Gasteren, A.J.M.: A Simple Fixpoint Argument without the Restriction to Continuity.Acta Informatica, 23:l-7, 1986.CrossRefGoogle Scholar
  13. [Dij76]
    Dijkstra, E.W.:A Discipline of Programming. Prentice-Hall, 1976.Google Scholar
  14. [DiS90]
    Dijkstra, E.W. and Scholten, C.S.:Predicate Calculus and Program Semantics. Springer-Verlag, New York, 1990.CrossRefzbMATHGoogle Scholar
  15. [Heh79]
    Hehner, E.C.R.: do considered od: a Contribution to Programming Calculus.Acta Informatica, 11:287–304, 1979.CrossRefzbMATHGoogle Scholar
  16. [Hes89]
    Hesselink, W.H.: Predicate Transformer Semantics of General Recursion.Acta Informatica, 26:309–332, 1989.zbMATHMathSciNetGoogle Scholar
  17. [HiP72]
    Hitchcock, P. and Park, D.: Induction Rules and Termination Proofs. In M. Nivat, editor,Proc. 1st ICALP, Rocquencourt, France, 1972. North-Holland.Google Scholar
  18. [Mey85]
    Meyer, J.-J.Ch:Programming Calculi Based on Fixed Point Transformations: Semantics and Applications. PhD thesis, Vrije Universiteit, Amsterdam, 1985.Google Scholar
  19. [Mor87]
    Morris, J.: A Theoretical Basis for Stepwise Refinement and the Programming Calculus.Science of Computer Programming, 9:287–306, 1987.CrossRefzbMATHMathSciNetGoogle Scholar
  20. [MRG88]
    Morgan, C.C., Robinson, K.A., and Gardiner, P.H.B.: On the Refinement Calculus. Technical Report PRG-70, Programming Research Group, 1988.Google Scholar
  21. [Nel89]
    Nelson, G.: A Generalization of Dijkstra's Calculus.ACM Transaction on Programming Languages and Systems, 11(4):517–561, 1989.CrossRefGoogle Scholar
  22. [Plo79]
    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.Google Scholar
  23. [Plo81]
    Plotkin, G.D.: Post-Graduate Lecture Notes in Advanced Domain Theory (incorporating the “Pisa Notes”). Department of Computer Science, Univ. of Edinburgh, 1981.Google Scholar
  24. [Roe76]
    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.Google Scholar
  25. [Smy78]
    Smyth, M.B.: Power Domains.Journal of Computer and System Sciences, 16(1):23–36, 1978.CrossRefzbMATHMathSciNetGoogle Scholar
  26. [Smy83]
    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.Google Scholar
  27. [Wan77]
    Wand, M.: A Characterisation of Weakest Preconditions.Journal of Computer and System Sciences, 15:209–212, 1977.CrossRefzbMATHMathSciNetGoogle Scholar
  28. [Wri90]
    von Wright, J.: A Lattice-theoretical Basis for Program Refinement. PhD thesis, Abo Akademi, 1990.Google Scholar

Copyright information

© British Computer Society 1994

Authors and Affiliations

  1. 1.Department of Computer ScienceVrije UniversiteitHV AmsterdamThe Netherlands
  2. 2.Department of Computer ScienceUtrecht UniversityThe Netherlands

Personalised recommendations