A Formal Approach to Probabilistic Termination

  • Joe Hurd
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 2410)

Abstract

We present a probabilistic version of the while loop, in the context of our mechanised framework for verifying probabilistic programs. The while loop preserves useful program properties of measurability and independence, provided a certain condition is met. This condition is naturally interpreted as “from every starting state, the while loop will terminate with probability 1”, and we compare it to other probabilistic termination conditions in the literature. For illustration, we verify in HOL two example probabilistic algorithms that necessarily rely on probabilistic termination: an algorithm to sample the Bernoulli(p) distribution using coin-flips; and the symmetric simple random walk.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    E.W. Dijkstra. A Discipline of Programming. Prentice-Hall, 1976.Google Scholar
  2. 2.
    M.J.C. Gordon and T.F. Melham. Introduction to HOL (A theorem-proving environment for higher order logic). Cambridge University Press, 1993.Google Scholar
  3. 3.
    Sergiu Hart, Micha Sharir, and Amir Pnueli. Termination of probabilistic concurrent programs. ACM Transactions on Programming Languages and Systems (TOPLAS), 5(3):356–380, July 1983.Google Scholar
  4. 4.
    Jifeng He, K. Seidel, and A. McIver. Probabilistic models for the guarded command language. Science of Computer Programming, 28(2–3):171–192, April 1997.Google Scholar
  5. 5.
    Joe Hurd. Verification of the Miller-Rabin probabilistic primality test. In Richard J. Boulton and Paul B. Jackson, editors, TPHOLs 2001: Supplemental Proceedings, number EDI-INF-RR-0046 in University of Edinburgh Informatics Report Series, pages 223–238, September 2001.Google Scholar
  6. 6.
    Joe Hurd. Formal Verification of Probabilistic Algorithms. PhD thesis, University of Cambridge, 2002.Google Scholar
  7. 7.
    Claire Jones. Probabilistic Non-Determinism. PhD thesis, University of Edinburgh, 1990.Google Scholar
  8. 8.
    Dexter Kozen. Semantics of probabilistic programs. In 20th Annual Symposium on Foundations of Computer Science, pages 101–114, Long Beach, Ca., USA, October 1979. IEEE Computer Society Press.Google Scholar
  9. 9.
    John Launchbury and Simon L. Peyton Jones. Lazy functional state threads. In SIGPLAN Symposium on Programming Language Design and Implementation (PLDI’94), Orlando, pages 24–35, June 1994.Google Scholar
  10. 10.
    Carroll Morgan. Proof rules for probabilistic loops. In Proceedings of the BCSFACS 7th Refinement Workshop, 1996.Google Scholar
  11. 11.
    Carroll Morgan, Annabelle McIver, Karen Seidel, and J. W. Sanders. Probabilistic predicate transformers. Technical Report TR-4-95, Oxford University Computing Laboratory Programming Research Group, February 1995.Google Scholar
  12. 12.
    Rajeev Motwani and Prabhakar Raghavan. Randomized Algorithms. Cambridge University Press, Cambridge, England, June 1995.MATHGoogle Scholar
  13. 13.
    Philip Wadler. The essence of functional programming. In 19th Symposium on Principles of Programming Languages. ACM Press, January 1992.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2002

Authors and Affiliations

  • Joe Hurd
    • 1
  1. 1.Computer LaboratoryUniversity of CambridgeUK

Personalised recommendations