Skip to main content

Prototyping Games Using Formal Methods

  • Conference paper
  • First Online:
Formal Methods – Fun for Everybody (FMFun 2019)

Abstract

Courses on formal methods are often based on examples and case studies, which are supposed to show students how to apply formal methods in practice. However, examples often fall into one of two categories: First, many are artificial and thus do not relate to practice. Second, other examples are based on projects of industry partners and therefore often are too involved for students to understand them.

In this paper, we present a different approach. By formalizing the rules of commonly known games, we achieve examples both engaging and suited for students. Furthermore, we broaden the horizon of formal methods, driving research at the same time: we present extensions such as playable visualizations and explore the relationship between game AIs and model checking heuristics.

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

Notes

  1. 1.

    Regarding the trade-off between ease of implementation and efficient execution see [16] for a general point of view and [22] for a perspective on B and Event-B.

  2. 2.

    A full version of the model can be found at:

    https://github.com/pkoerner/EventBPacman-Plugin/tree/master/eventb.

  3. 3.

    The main B machine can be found at:

    https://github.com/pkoerner/b-chess-example/blob/master/b/board.mch.

  4. 4.

    https://lightbot.com/.

  5. 5.

    Available at: https://www3.hhu.de/stups/models/fmfun19/lb.zip.

References

  1. Abrial, J.-R.: The B-Book. Cambridge University Press, Cambridge (1996)

    Book  Google Scholar 

  2. Abrial, J.-R.: Modeling in Event-B: System and Software Engineering. Cambridge University Press, Cambridge (2010)

    Book  Google Scholar 

  3. Abrial, J.-R., Butler, M., Hallerstede, S., Hoang, T.S., Mehta, F., Voisin, L.: Rodin: an open toolset for modelling and reasoning in Event-B. STTT 12(6), 447–466 (2010)

    Article  Google Scholar 

  4. Baldamus, M., Schneider, K., Wenz, M., Ziller, R.: Can American checkers be solved by means of symbolic model checking? Electron. Notes Theoret. Comput. Sci. 43, 3–17 (2000)

    Google Scholar 

  5. Bendisposto, J., Leuschel, M., Ligot, O., Samia, M.: La validation de modèles Event-B avec le plug-in ProB pour RODIN. TSI 27(8), 1065–1084 (2008)

    Article  Google Scholar 

  6. Carlsson, M., Mildner, P.: SICStus Prolog-the first 25 years. TPLP 12(1–2), 35–66 (2012)

    MathSciNet  MATH  Google Scholar 

  7. Carlsson, M., Ottosson, G., Carlson, B.: An open-ended finite domain constraint solver. In: Glaser, H., Hartel, P., Kuchen, H. (eds.) PLILP 1997. LNCS, vol. 1292, pp. 191–206. Springer, Heidelberg (1997). https://doi.org/10.1007/BFb0033845

    Chapter  Google Scholar 

  8. ClearSy. Atelier B, User and Reference Manuals (2016). http://www.atelierb.eu/

  9. Curzon, P., McOwan, P.W.: Teaching formal methods using magic tricks. In: Fun with Formal Methods: Workshop at the 25th International Conference on Computer Aided Verification, Number 122 (2013)

    Google Scholar 

  10. Dietl, W., et al.: Verification games: making verification fun. In: Proceedings FTfJP 2012, pp. 42–49. ACM (2012)

    Google Scholar 

  11. Dobrikov, I., Leuschel, M., Plagge, D.: LTL model checking under fairness in ProB. In: De Nicola, R., Kühn, E. (eds.) SEFM 2016. LNCS, vol. 9763, pp. 204–211. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-41591-8_14

    Chapter  Google Scholar 

  12. Déharbe, D., Fontaine, P., Guyot, Y., Voisin, L.: SMT solvers for Rodin. In: Derrick, J., et al. (eds.) ABZ 2012. LNCS, vol. 7316, pp. 194–207. Springer, Heidelberg (2012). https://doi.org/10.1007/978-3-642-30885-7_14

    Chapter  Google Scholar 

  13. Déharbe, D., Fontaine, P., Guyot, Y., Voisin, L.: Integrating SMT solvers in Rodin. Sci. Comput. Program. 94, 130–143 (2014). Part 2(0)

    Article  Google Scholar 

  14. Gordon, M.J.C.: HOL: a proof generating system for higher-order logic. In: Birtwistle, G., Subrahmanyam, P.A. (eds.) VLSI Specification, Verification and Synthesis. SECS, vol. 35, pp. 73–128. Springer, Boston (1988). https://doi.org/10.1007/978-1-4613-2007-4_3

    Chapter  Google Scholar 

  15. Hurd, J.: Formal verification of chess endgame databases. Technical report, Oxford University Computing Laboratory (2005)

    Google Scholar 

  16. Kennedy, K., Koelbel, C., Schreiber, R.: Defining and measuring the productivity of programming languages. Int. J. High Perform. Comput. Appl. 18(4), 441–448 (2004)

    Article  Google Scholar 

  17. Krings, S., Leuschel, M.: Proof assisted symbolic model checking for B and Event-B. In: Butler, M., Schewe, K.-D., Mashkoor, A., Biro, M. (eds.) ABZ 2016. LNCS, vol. 9675, pp. 135–150. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-33600-8_8

    Chapter  Google Scholar 

  18. Krings, S., Leuschel, M.: SMT solvers for validation of B and Event-B models. In: Ábrahám, E., Huisman, M. (eds.) IFM 2016. LNCS, vol. 9681, pp. 361–375. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-33693-0_23

    Chapter  Google Scholar 

  19. Körner, P., Bendisposto, J., Dunkelau, J., Krings, S., Leuschel, M.: Integrating formal specifications into applications: the ProB Java API. Form. Methods Syst. Des. (2020). https://doi.org/10.1007/s10703-020-00351-3

  20. Ladenberger, L.: Rapid creation of interactive formal prototypes for validating safety-critical systems. Ph.D. thesis, Heinrich-Heine-Universität Düsseldorf (2017)

    Google Scholar 

  21. Ladenberger, L., Leuschel, M.: BMotionWeb: a tool for rapid creation of formal prototypes. In: De Nicola, R., Kühn, E. (eds.) SEFM 2016. LNCS, vol. 9763, pp. 403–417. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-41591-8_27

    Chapter  Google Scholar 

  22. Leuschel, M.: The high road to formal validation. In: Börger, E., Butler, M., Bowen, J.P., Boca, P. (eds.) ABZ 2008. LNCS, vol. 5238, pp. 4–23. Springer, Heidelberg (2008). https://doi.org/10.1007/978-3-540-87603-8_2

    Chapter  Google Scholar 

  23. Leuschel, M., Bendisposto, J.: Directed model checking for B: an evaluation and new techniques. In: Davies, J., Silva, L., Simao, A. (eds.) SBMF 2010. LNCS, vol. 6527, pp. 1–16. Springer, Heidelberg (2011). https://doi.org/10.1007/978-3-642-19829-8_1

    Chapter  MATH  Google Scholar 

  24. Leuschel, M., Bendisposto, J., Dobrikov, I., Krings, S., Plagge, D.: From animation to data validation: the ProB constraint solver 10 years on, Chap. 14. In: Boulanger, J.-L. (ed.) Formal Methods Applied to Complex Systems: Implementation of the B Method, pp. 427–446. Wiley ISTE (2014)

    Google Scholar 

  25. Leuschel, M., Butler, M.: ProB: a model checker for B. In: Araki, K., Gnesi, S., Mandrioli, D. (eds.) FME 2003. LNCS, vol. 2805, pp. 855–874. Springer, Heidelberg (2003). https://doi.org/10.1007/978-3-540-45236-2_46

    Chapter  Google Scholar 

  26. Leuschel, M., Butler, M.: ProB: an automated analysis toolset for the B method. STTT 10(2), 185–203 (2008)

    Article  Google Scholar 

  27. Nummenmaa, T.: Executable formal specifications in game development. Dissertation, University of Tampere (2013)

    Google Scholar 

  28. Nummenmaa, T., Berki, E., Mikkonen, T.: Exploring games as formal models. In: Proceedings SEEFM 2009, pp. 60–65 (2009)

    Google Scholar 

  29. Nummenmaa, T., Kuittinen, J., Holopainen, J.: Simulation as a game design tool. In: Proceedings ACE 2009, pp. 232–239. ACM (2009)

    Google Scholar 

  30. Plagge, D., Leuschel, M.: Seven at one stroke: LTL model checking for high-level specifications in B, Z, CSP, and more. Int. J. Softw. Tools Technol. Transf. 12(1), 9–21 (2010)

    Article  Google Scholar 

  31. Plagge, D., Leuschel, M.: Validating B, Z and TLA\({\text{+ }}\) using ProB and Kodkod. In: Giannakopoulou, D., Méry, D. (eds.) FM 2012. LNCS, vol. 7436, pp. 372–386. Springer, Heidelberg (2012). https://doi.org/10.1007/978-3-642-32759-9_31

    Chapter  Google Scholar 

  32. Schlingloff, B.-H.: Teaching model checking via games and puzzles. In: Pre-proceedings FMFUN 2019 (2019)

    Google Scholar 

  33. Shannon, C.E.: Programming a computer for playing chess. In: Levy, D. (ed.) Computer Chess Compendium, pp. 2–13. Springer, New York (1988). https://doi.org/10.1007/978-1-4757-1968-0_1

    Chapter  Google Scholar 

  34. Torlak, E., Jackson, D.: Kodkod: a relational model finder. In: Grumberg, O., Huth, M. (eds.) TACAS 2007. LNCS, vol. 4424, pp. 632–647. Springer, Heidelberg (2007). https://doi.org/10.1007/978-3-540-71209-1_49

    Chapter  Google Scholar 

  35. Zhumagambetov, R.: Teaching formal methods in academia: a systematic literature review. In: Pre-proceedings FMFUN 2019 (2019)

    Google Scholar 

Download references

Acknowledgement

We thank Christoph Heinzen who created several versions of the Pac-Man case study, as well as Philip Höfges for the chess model, AI and GUI.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Sebastian Krings .

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

Krings, S., Körner, P. (2021). Prototyping Games Using Formal Methods. In: Cerone, A., Roggenbach, M. (eds) Formal Methods – Fun for Everybody. FMFun 2019. Communications in Computer and Information Science, vol 1301. Springer, Cham. https://doi.org/10.1007/978-3-030-71374-4_6

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-71374-4_6

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-71373-7

  • Online ISBN: 978-3-030-71374-4

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics