Development via Refinement in Probabilistic B - Foundation and Case Study

In earlier work, we introduced probability to the B by providing a probabilistic choice substitution and by extending B's semantics to incorporate its meaning [8]. This, a first step, allowed probabilistic programs to be written and reasoned about within B. This paper extends the previous work into refinement within B. To allow probabilistic specification and development within B, we must add a probabilistic specification substitution; and we must determine the rules and techniques for its rigorous refinement into probabilistic code. Implementation in B frequently contains loops. We generalise the standard proof obligation rules for loops giving a set of rules for reasoning about the correctness of probabilistic loops. We present a small case-study that uses those rules, the randomised Min-Cut algorithm.

[1]  Annabelle McIver,et al.  Abstraction, Refinement And Proof For Probabilistic Systems (Monographs in Computer Science) , 2004 .

[2]  Carroll Morgan,et al.  The Refinement Calculus , 1994, NATO ASI PDC.

[3]  Carroll Morgan,et al.  Programming from specifications , 1990, Prentice Hall International Series in computer science.

[4]  Rajeev Motwani,et al.  Randomized Algorithms , 1995, SIGA.

[5]  Annabelle McIver,et al.  Abstraction, Refinement and Proof for Probabilistic Systems , 2004, Monographs in Computer Science.

[6]  Annabelle McIver,et al.  Probabilistic Invariants for Probabilistic Machines , 2003, ZB.

[7]  Ken Robinson,et al.  Specification statements and refinements , 1987 .

[8]  Carroll Morgan,et al.  Programming from specifications (2nd ed.) , 1994 .

[9]  Carroll Morgan,et al.  Proof rules for probabilistic loops , 1996 .

[10]  Frank Waters,et al.  The B Book , 1971 .

[11]  Joseph M. Morris,et al.  A Theoretical Basis for Stepwise Refinement and the Programming Calculus , 1987, Sci. Comput. Program..

[12]  Carroll Morgan,et al.  The specification statement , 1988, TOPL.

[13]  Carroll Morgan The Generalised Substitution Language Extended to Probabilistic Programs , 1998, B.

[14]  Colin J. Fidge,et al.  But What if I Don't Want to Wait Forever? , 2003, Formal Aspects of Computing.

[15]  David Gries,et al.  A Note on a Standard Strategy for Developing Loop Invariants and Loops , 1982, Sci. Comput. Program..

[16]  Ralph-Johan Back,et al.  Refinement Calculus: A Systematic Introduction , 1998 .

[17]  Didier Bert B’98: Recent Advances in the Development and Use of the B Method , 1998, Lecture Notes in Computer Science.

[18]  Jonathan P. Bowen,et al.  ZB 2003: Formal Specification and Development in Z and B , 2003, Lecture Notes in Computer Science.

[19]  Dominique Cansell,et al.  A Mechanically Proved and Incremental Development of IEEE 1394 Tree Identify Protocol , 2003, Formal Aspects of Computing.

[20]  Annabelle McIver,et al.  Probabilistic Termination in B , 2003, ZB.