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].
Access provided by Autonomous University of Puebla. Download to read the full chapter text
Chapter PDF
Similar content being viewed by others
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
References
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)
The Coq Development Team: The Coq Proof Assistant Reference Manual – Version V8.0 (2004), http://coq.inria.fr
Kozen, D.: Semantics of probabilistic programs. J. of Comput. and Syst. Sci. 22(3), 328–350 (1981)
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)
Morgan, C., McIver, A.: pGCL: formal reasoning for random algorithms. South African Computer J. (1999)
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)
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)
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)
Hurd, J.: Formal Verification of Probabilistic Algorithms. PhD thesis, Univ. of Cambridge (2002)
Hurd, J.: Verification of the Miller-Rabin probabilistic primality test. J. of Logic and Algebraic Program. 50(1-2), 3–21 (2003)
Jones, C.: Probabilistic Non-determinism. PhD thesis, Univ. of Edinburgh (1989)
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)
McIver, A., Morgan, C.: Abstraction, Refinement and Proof for Probabilistic Systems. In: Monographs in Computer Science. Springer, Heidelberg (2005)
Moggi, E.: Notions of computation and monads. Inform. and Comput. 93(1), 55–92 (1991)
Pfenning, F., Davies, R.: A judgmental reconstruction of modal logic. Math. Struct. in Comput. Sci. 11(4), 511–540 (2001)
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)
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)
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
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)
Filliâtre, J.C.: Verification of non-functional programs using interpretations in type theory. J. of Funct. Program. 13(4), 709–745 (2003)
Filliâtre, J.C.: The why verification tool (2002), http://why.lri.fr/
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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)