Skip to main content

Automated Reasoning for Probabilistic Sequential Programs with Theorem Proving

  • Conference paper
  • First Online:
Relational and Algebraic Methods in Computer Science (RAMiCS 2021)

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

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.

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 59.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 79.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

References

  1. 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

    Chapter  Google Scholar 

  2. 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)

    Article  Google Scholar 

  3. 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

    Chapter  Google Scholar 

  4. Hoare, C.A.R., He, J.: Unifying Theories of Programming. Prentice-Hall, Hoboken (1998)

    MATH  Google Scholar 

  5. Hoare, C.A.R., He, J.: The weakest prespecification. Inf. Process. Lett. 24(2), 127–132 (1987)

    Article  MathSciNet  Google Scholar 

  6. 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)

    Article  Google Scholar 

  7. 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

  8. 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

  9. 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

    Chapter  Google Scholar 

  10. 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

  11. Guttmann, W., Möller, B.: Normal design algebra. J. Log. Algebraic Meth. Program. 79(2), 144–173 (2010)

    Article  MathSciNet  Google Scholar 

  12. Hölzl, J., Lochbihler, A.: Probability Mass Function. Technical Report https://isabelle.in.tum.de/library/HOL/HOL-Probability/Probability_Mass_Function.html

  13. Hoare, C.A.R., He, J.: The weakest prespecification. Technical Report PRG44, OUCL, June 1985

    Google Scholar 

  14. Dijkstra, E.W.: Guarded commands, nondeterminacy and formal derivation of programs. Commun. ACM 18(8), 453–457 (1975)

    Article  MathSciNet  Google Scholar 

  15. Jifeng, H., Seidel, K., McIver, A.: Probabilistic models for the guarded command language. Sci. Comput. Program. 28(2–3), 171–192 (1997)

    Article  MathSciNet  Google Scholar 

  16. Alur, R., Henzinger, T.A.: Reactive modules. Formal Meth. Syst. Des. 15(1), 7–48 (1999). https://doi.org/10.1023/A:1008739929481

    Article  Google Scholar 

  17. 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

    Chapter  Google Scholar 

  18. Hurd, J.: Formal verification of probabilistic algorithms. Technical report, University of Cambridge, Computer Laboratory (2003)

    Google Scholar 

  19. Gordon, M.J.C., Melham, T.F. (eds.): Introduction to HOL: A Theorem Proving Environment for Higher Order Logic. Cambridge University Press, Cambridge (1993)

    MATH  Google Scholar 

  20. Hurd, J., McIver, A., Morgan, C.: Probabilistic guarded commands mechanized in HOL. Theor. Comput. Sci. 346(1), 96–112 (2005)

    Article  MathSciNet  Google Scholar 

  21. Morgan, C., McIver, A., Seidel, K.: Probabilistic predicate transformers. ACM Trans. Program. Lang. Syst. (TOPLAS) 18(3), 325–353 (1996)

    Article  Google Scholar 

  22. Audebaud, P., Paulin-Mohring, C.: Proofs of randomized algorithms in Coq. Sci. Comput. Program. 74(8), 568–589 (2009)

    Article  MathSciNet  Google Scholar 

  23. The Coq development team: The Coq Proof Assistant. https://coq.inria.fr. Accessed 20 May 2021

  24. 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)

    Google Scholar 

  25. 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

  26. 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

    Chapter  Google Scholar 

Download references

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

Authors

Corresponding author

Correspondence to Kangfeng Ye .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2021 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

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)

Publish with us

Policies and ethics