Abstract
Semantics for nondeterministic probabilistic sequential programs has been well studied in the past decades. In a variety of semantic models, how nondeterministic choice interacts with probabilistic choice is the most significant difference. In He, Morgan, and McIver’s relational model, probabilistic choice refines nondeterministic choice. This model is general because of its predicative-style semantics in Hoare and He’s Unifying Theories of Programming, and suitable for automated reasoning because of its algebraic feature. Previously, we gave probabilistic semantics to the RoboChart notation based on this model, and also formalised the proof that the semantic embedding is a homomorphism, and revealed interesting details. In this paper, we present our mechanisation of the proof in Isabelle/UTP enabling automated reasoning for probabilistic sequential programs including a subset of the RoboChart language. With mechanisation, we even reveal more interesting questions, hidden in the original model. We demonstrate several examples, including an example to illustrate the interaction between nondeterministic choice and probabilistic choice, and a RoboChart model for randomisation based on binary probabilistic choice.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
Woodcock, J., Cavalcanti, A., Foster, S., Mota, A., Ye, K.: Probabilistic semantics for RoboChart. In: Ribeiro, P., Sampaio, A. (eds.) UTP 2019. LNCS, vol. 11885, pp. 80–105. Springer, Cham (2019). https://doi.org/10.1007/978-3-030-31038-7_5
Miyazawa, A., Ribeiro, P., Li, W., Cavalcanti, A., Timmis, J., Woodcock, J.: RoboChart: modelling and verification of the functional behaviour of robotic applications. Softw. Syst. Model. 18(5), 3097–3149 (2019)
Jifeng, H., Morgan, C., McIver, A.: Deriving probabilistic semantics via the ‘weakest completion’. In: Davies, J., Schulte, W., Barnett, M. (eds.) ICFEM 2004. LNCS, vol. 3308, pp. 131–145. Springer, Heidelberg (2004). https://doi.org/10.1007/978-3-540-30482-1_17
Hoare, C.A.R., He, J.: Unifying Theories of Programming. Prentice-Hall, Hoboken (1998)
Hoare, C.A.R., He, J.: The weakest prespecification. Inf. Process. Lett. 24(2), 127–132 (1987)
Foster, S., Baxter, J., Cavalcanti, A., Woodcock, J., Zeyda, F.: Unifying semantic foundations for automated verification tools in Isabelle/UTP. Sci. Comput. Program. 197, 102510 (2020)
Nipkow, T., Wenzel, M., Paulson, L.C.: Isabelle/HOL: A Proof Assistant for Higher-order Logic. Springer, Cham (2002). https://doi.org/10.1007/3-540-45949-9
McIver, A., Morgan, C.: Introduction to pGCL: Its logic and Its Model. In: Abstraction, Refinement and Proof for Probabilistic Systems. Springer, New York, January 2005. https://doi.org/10.1007/0-387-27006-X_1
Woodcock, J., Cavalcanti, A.: A tutorial introduction to designs in unifying theories of programming. In: Boiten, E.A., Derrick, J., Smith, G. (eds.) IFM 2004. LNCS, vol. 2999, pp. 40–66. Springer, Heidelberg (2004). https://doi.org/10.1007/978-3-540-24756-2_4
Hehner, E.C.R.: A Practical Theory of Programming. Texts and Monographs in Computer Science. Springer, New York (1993). https://doi.org/10.1007/978-1-4419-8596-5
Guttmann, W., Möller, B.: Normal design algebra. J. Log. Algebraic Meth. Program. 79(2), 144–173 (2010)
Hölzl, J., Lochbihler, A.: Probability Mass Function. Technical Report https://isabelle.in.tum.de/library/HOL/HOL-Probability/Probability_Mass_Function.html
Hoare, C.A.R., He, J.: The weakest prespecification. Technical Report PRG44, OUCL, June 1985
Dijkstra, E.W.: Guarded commands, nondeterminacy and formal derivation of programs. Commun. ACM 18(8), 453–457 (1975)
Jifeng, H., Seidel, K., McIver, A.: Probabilistic models for the guarded command language. Sci. Comput. Program. 28(2–3), 171–192 (1997)
Alur, R., Henzinger, T.A.: Reactive modules. Formal Meth. Syst. Des. 15(1), 7–48 (1999). https://doi.org/10.1023/A:1008739929481
Hehner, E.C.R.: Probabilistic predicative programming. In: Kozen, D. (ed.) MPC 2004. LNCS, vol. 3125, pp. 169–185. Springer, Heidelberg (2004). https://doi.org/10.1007/978-3-540-27764-4_10
Hurd, J.: Formal verification of probabilistic algorithms. Technical report, University of Cambridge, Computer Laboratory (2003)
Gordon, M.J.C., Melham, T.F. (eds.): Introduction to HOL: A Theorem Proving Environment for Higher Order Logic. Cambridge University Press, Cambridge (1993)
Hurd, J., McIver, A., Morgan, C.: Probabilistic guarded commands mechanized in HOL. Theor. Comput. Sci. 346(1), 96–112 (2005)
Morgan, C., McIver, A., Seidel, K.: Probabilistic predicate transformers. ACM Trans. Program. Lang. Syst. (TOPLAS) 18(3), 325–353 (1996)
Audebaud, P., Paulin-Mohring, C.: Proofs of randomized algorithms in Coq. Sci. Comput. Program. 74(8), 568–589 (2009)
The Coq development team: The Coq Proof Assistant. https://coq.inria.fr. Accessed 20 May 2021
Cock, D.: Verifying Probabilistic Correctness in Isabelle with pGCL. In Cassez, F., Huuck, R., Klein, G., Schlich, B., (eds.): Proceedings Seventh Conference on Systems Software Verification, SSV 2012, Sydney, Australia, 28–30 November 2012, volume 102 of EPTCS, pp. 167–178 (2012)
McIver, A., Morgan, C.: Abstraction, Refinement and Proof for Probabilistic Systems. Monographs in Computer Science. Springer, New York (2005). https://doi.org/10.1007/b138392
Ye, K., Foster, S., Woodcock, J.: Compositional assume-guarantee reasoning of control law diagrams using UTP. In: Adamatzky, A., Kendon, V. (eds.) From Astrophysics to Unconventional Computation. ECC, vol. 35, pp. 215–254. Springer, Cham (2020). https://doi.org/10.1007/978-3-030-15792-0_10
Acknowledgements
This work is funded by the EPSRC projects RoboCalc (Grant EP/M025756/1), RoboTest (Grant EP/R025479/1), and CyPhyAssure (CyPhyAssure Project: https://www.cs.york.ac.uk/circus/CyPhyAssure/) (Grant EP/S001190/1). The icons used in RoboChart have been made by Sarfraz Shoukat, Freepik, Google, Icomoon and Madebyoliver from www.flaticon.com, and are licensed under CC 3.0 BY.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2021 Springer Nature Switzerland AG
About this paper
Cite this paper
Ye, K., Foster, S., Woodcock, J. (2021). Automated Reasoning for Probabilistic Sequential Programs with Theorem Proving. In: Fahrenberg, U., Gehrke, M., Santocanale, L., Winter, M. (eds) Relational and Algebraic Methods in Computer Science. RAMiCS 2021. Lecture Notes in Computer Science(), vol 13027. Springer, Cham. https://doi.org/10.1007/978-3-030-88701-8_28
Download citation
DOI: https://doi.org/10.1007/978-3-030-88701-8_28
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-88700-1
Online ISBN: 978-3-030-88701-8
eBook Packages: Computer ScienceComputer Science (R0)