Skip to main content

Generating SPARK from Event-B, Providing Fundamental Safety and Security

  • Conference paper
  • First Online:
Advances in Model and Data Engineering in the Digitalization Era (MEDI 2022)

Abstract

Event-B is a formal method that facilitates rigorous analysis and correct-by-construction development of software and hardware systems. SPARK is a computer programming language for the development of high integrity software. Linking Event-B at design level and SPARK at implementation level allows us to formally verify the relationship between application-level requirements and software implementations. Event-B is supported by an integrated development environment, Rodin, and extension plug-in tools, enabling various validation and verification techniques. However it lacks a comprehensive code generation feature with support for data structures, to connect to implementation. In this paper, we propose a tool to translate verified Event-B models into the SPARK programming language. We describe the translation rules and how the proposed tool can be integrated with other EMF-based plug-ins in Rodin. We demonstrate the proposed translation rules through a ‘smart ballot box’ case study.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

Notes

  1. 1.

    https://www.adacore.com/about-spark.

  2. 2.

    https://www.gnu.org/software/gnat/.

References

  1. Galois and Free & Fair. The BESSPIN Voting System (2019). https://github.com/GaloisInc/BESSPIN-Voting-System-Demonstrator-2019. Accessed 16 Aug 2022

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

    Book  MATH  Google Scholar 

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

    Article  Google Scholar 

  4. Barnes, J.: Bibliography, 2nd edn., pp. 951–952. Cambridge University Press, Cambridge (2022). https://doi.org/10.1017/9781009181358.045

    Book  Google Scholar 

  5. Curtis, D.: SPARK annotations within executable UML. In: Pinho, L.M., González Harbour, M. (eds.) Ada-Europe 2006. LNCS, vol. 4006, pp. 83–93. Springer, Heidelberg (2006). https://doi.org/10.1007/11767077_7

    Chapter  Google Scholar 

  6. Dghaym, D., Hoang, T.S., Butler, M., Hu, R., Aniello, L., Sassone, V.: Verifying system-level security of a smart ballot box. In: Raschke, A., Méry, D. (eds.) ABZ 2021. LNCS, vol. 12709, pp. 34–49. Springer, Cham (2021). https://doi.org/10.1007/978-3-030-77543-8_3

    Chapter  Google Scholar 

  7. Eysholdt, M., Behrens, H.: Xtext: implement your language faster than the quick and dirty way. In: OOPSLA, pp. 307–309. ACM (2010). http://doi.acm.org/10.1145/1869542.1869625

  8. Salehi Fathabadi, A., Snook, C., Hoang, T.S., Dghaym, D., Butler, M.: Extensible record structures in Event-B. In: Raschke, A., Méry, D. (eds.) ABZ 2021. LNCS, vol. 12709, pp. 130–136. Springer, Cham (2021). https://doi.org/10.1007/978-3-030-77543-8_12https://eprints.soton.ac.uk/448194/

    Chapter  Google Scholar 

  9. Georgiou, K., Cluzel, G., Butcher, P., Moy, Y.: Security-hardening software libraries with Ada and SPARK - a TCP stack use case. CoRR abs/2109.10347 (2021). https://arxiv.org/abs/2109.10347

  10. Hoang, T.S., Snook, C., Dghaym, D., Fathabadi, A.S., Butler, M.: Building an extensible textual framework for the Rodin platform. In: Proceedings of the 7th Workshop on Formal Integrated Development Environment, F-IDE2022, to be published

    Google Scholar 

  11. Moy, Y., Ledinot, E., Delseny, H., Wiels, V., Monate, B.: Testing or formal verification: do-178c alternatives and industrial experience. IEEE Softw. 30(3), 50–57 (2013). https://doi.org/10.1109/MS.2013.43

    Article  Google Scholar 

  12. Murali, R., Ireland, A.: E-SPARK: automated generation of provably correct code from formally verified designs. Electron. Commun. Eur. Assoc. Softw. Sci. Technol. 53 (2012)

    Google Scholar 

  13. Sautejeau, X.: Modeling SPARK systems with UML. In: SigAda 2005, pp. 11–16. Association for Computing Machinery, New York (2005). https://doi.org/10.1145/1103846.1103848

  14. Silva, R., Pascal, C., Hoang, T.S., Butler, M.: Decomposition tool for Event-B. Softw. Pract. Experience 41(2), 199–208 (2011). https://eprints.soton.ac.uk/271714/

  15. Sritharan, S., Hoang, T.S.: Towards generating SPARK from Event-B models. In: Dongol, B., Troubitsyna, E. (eds.) IFM 2020. LNCS, vol. 12546, pp. 103–120. Springer, Cham (2020). https://doi.org/10.1007/978-3-030-63461-2_6

    Chapter  Google Scholar 

  16. Wilkie, I.: Executable UML and SPARK Ada: the best of both worlds (2005). https://abstractsolutions.co.uk/wp-content/uploads/2018/03/Executable-UML-and-SPARK-Ada-V2.1.pdf

  17. Zhang, Z., Robby, Hatcliff, J., Moy, Y., Courtieu, P.: Focused certification of an industrial compilation and static verification toolchain. In: Cimatti, A., Sirjani, M. (eds.) SEFM 2017. LNCS, vol. 10469, pp. 17–34. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-66197-1_2

    Chapter  Google Scholar 

Download references

Acknowledgements

This work is supported by the following projects: HD-Sec project, which was funded by the DSbD Programme delivered by UKRI. And HiClass project, which is part of the ATI Programme, a joint Government and industry investment to maintain and grow the UK’s competitive position in civil aerospace design and manufacture.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Asieh Salehi Fathabadi .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2022 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Salehi Fathabadi, A., Dghaym, D., Hoang, T.S., Butler, M., Snook, C. (2022). Generating SPARK from Event-B, Providing Fundamental Safety and Security. In: Fournier-Viger, P., et al. Advances in Model and Data Engineering in the Digitalization Era. MEDI 2022. Communications in Computer and Information Science, vol 1751. Springer, Cham. https://doi.org/10.1007/978-3-031-23119-3_13

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-23119-3_13

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-23118-6

  • Online ISBN: 978-3-031-23119-3

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics