Skip to main content

Proofs of Randomized Algorithms in Coq

  • Conference paper
Mathematics of Program Construction (MPC 2006)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 4014))

Included in the following conference series:

Abstract

Randomized algorithms are widely used either for finding efficiently approximated solutions to complex problems, for instance primality testing, or for obtaining good average behavior, for instance in distributed computing. Proving properties of such algorithms requires subtle reasoning both on algorithmic and probabilistic aspects of the programs. Providing tools for the mechanization of reasoning is consequently an important issue. Our paper presents a new method for proving properties of randomized algorithms in a proof assistant based on higher-order logic. It is based on the monadic interpretation of randomized programs as probabilistic distribution [1]. It does not require the definition of an operational semantics for the language nor the development of a complex formalization of measure theory, but only use functionals and algebraic properties of the unit interval. Using this model, we show the validity of general rules for estimating the probability for a randomized algorithm to satisfy certain properties, in particular in the case of general recursive functions.

We apply this theory for formally proving a program implementing a Bernoulli distribution from a coin flip and the termination of a random walk. All the theories and results presented in this paper have been fully formalized and proved in the Coq proof assistant [2].

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Ramsey, N., Pfeffer, A.: Stochastic lambda calculus and monads of probability distributions. In: Conf. Record of 29th ACM SIGPLAN-SIGACT Symp. on Principles of Programming Languages, POPL 2002, pp. 154–165. ACM Press, New York (2002)

    Chapter  Google Scholar 

  2. The Coq Development Team: The Coq Proof Assistant Reference Manual – Version V8.0 (2004), http://coq.inria.fr

  3. Kozen, D.: Semantics of probabilistic programs. J. of Comput. and Syst. Sci. 22(3), 328–350 (1981)

    Article  MATH  MathSciNet  Google Scholar 

  4. Kozen, D.: A probabilistic PDL. In: Proc. of 15th Ann. ACM Symp. on Theory of Computing, STOC 1983, pp. 291–297. ACM Press, New York (1983)

    Chapter  Google Scholar 

  5. Morgan, C., McIver, A.: pGCL: formal reasoning for random algorithms. South African Computer J. (1999)

    Google Scholar 

  6. Park, S., Pfenning, F., Thrun, S.: A probabilistic language based upon sampling functions. In: Proc. of 32nd ACM SIGPLAN-SIGACT Symp. on Principles of Programming Languages, POPL 2005, pp. 171–182. ACM Press, New York (2005)

    Chapter  Google Scholar 

  7. Hurd, J., McIver, A., Morgan, C.: Probabilistic guarded commands mechanized in HOL. In: Cerone, A., Pierro, A.D. (eds.) Proc. of 2nd Wksh. on Quantitative Aspects of Programming Languages, QAPL 2004. Electron. Notes in Theor. Comput. Sci., vol. 112, pp. 95–111. Elsevier, Amsterdam (2005)

    Google Scholar 

  8. Kwiatkowska, M., Norman, G., Parker, D.: Probabilistic symbolic model checking with PRISM: A hybrid approach. J. on Software Tools for Technology Transfer 6(2), 128–142 (2004)

    Google Scholar 

  9. Hurd, J.: Formal Verification of Probabilistic Algorithms. PhD thesis, Univ. of Cambridge (2002)

    Google Scholar 

  10. Hurd, J.: Verification of the Miller-Rabin probabilistic primality test. J. of Logic and Algebraic Program. 50(1-2), 3–21 (2003)

    Article  MathSciNet  Google Scholar 

  11. Jones, C.: Probabilistic Non-determinism. PhD thesis, Univ. of Edinburgh (1989)

    Google Scholar 

  12. Jones, C., Plotkin, G.: A probabilistic powerdomain of evaluations. In: Proc. of 4th Ann. IEEE Symp. on Logic in Computer Science, LICS 1989, pp. 186–195. IEEE Comput. Soc. Press, Los Alamitos (1989)

    Google Scholar 

  13. McIver, A., Morgan, C.: Abstraction, Refinement and Proof for Probabilistic Systems. In: Monographs in Computer Science. Springer, Heidelberg (2005)

    Google Scholar 

  14. Moggi, E.: Notions of computation and monads. Inform. and Comput. 93(1), 55–92 (1991)

    Article  MATH  MathSciNet  Google Scholar 

  15. Pfenning, F., Davies, R.: A judgmental reconstruction of modal logic. Math. Struct. in Comput. Sci. 11(4), 511–540 (2001)

    MATH  MathSciNet  Google Scholar 

  16. Geuvers, H., Niqui, M.: Constructive reals in coq: Axioms and categoricity. In: Callaghan, P., Luo, Z., McKinna, J., Pollack, R. (eds.) TYPES 2000. LNCS, vol. 2277, pp. 79–95. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  17. Escardó, M., Simpson, A.: A universal characterization of the closed euclidean interval (extended abstract). In: Proc. of 16th Ann. IEEE Symp. on Logic in Computer Science, LICS 2001, pp. 115–125. IEEE Comput. Soc. Press, Los Alamitos (2001)

    Chapter  Google Scholar 

  18. Paulin-Mohring, C.: A library for reasoning on randomized algorithms in Coq: description of a Coq contribution, Univ. Paris Sud (2006), http://www.lri.fr/~paulin/ALEA/library.pdf

  19. Hurd, J.: A formal approach to probabilistic termination. In: Carreño, V.A., Muñoz, C.A., Tahar, S. (eds.) TPHOLs 2002. LNCS, vol. 2410, pp. 230–245. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  20. Filliâtre, J.C.: Verification of non-functional programs using interpretations in type theory. J. of Funct. Program. 13(4), 709–745 (2003)

    Article  MATH  Google Scholar 

  21. Filliâtre, J.C.: The why verification tool (2002), http://why.lri.fr/

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2006 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Audebaud, P., Paulin-Mohring, C. (2006). Proofs of Randomized Algorithms in Coq . In: Uustalu, T. (eds) Mathematics of Program Construction. MPC 2006. Lecture Notes in Computer Science, vol 4014. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11783596_6

Download citation

  • DOI: https://doi.org/10.1007/11783596_6

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-35631-8

  • Online ISBN: 978-3-540-35632-5

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics