Proofs of Randomized Algorithms in Coq
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 . 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 .
KeywordsOperational Semantic Algebraic Property Probabilistic Program Proof Assistant Denotational Semantic
Unable to display preview. Download preview PDF.
- 2.The Coq Development Team: The Coq Proof Assistant Reference Manual – Version V8.0 (2004), http://coq.inria.fr
- 5.Morgan, C., McIver, A.: pGCL: formal reasoning for random algorithms. South African Computer J. (1999)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
- 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
- 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
- 21.Filliâtre, J.C.: The why verification tool (2002), http://why.lri.fr/