On Two Friends for Getting Correct Programs

Automatically Translating Event B Specifications to Recursive Algorithms in Rodin
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 9952)


We report on our progress-to-date in implementing a software development environment which integrates the efforts of two formal software engineering techniques: program refinement as supported by Event B and program verification as supported by the Spec# programming system. Our objective is to improve the usability of formal verification tools by providing a general framework for integrating these two approaches to software verification. We show how the two approaches Correctness-by-Construction and Post-hoc Verification can be used in a productive way. Here, we focus on the final steps in this process where the final concrete specification is transformed into an executable algorithm. We present EB2RC, a plug-in for the Rodin platform, that reads in an Event B model and uses the control framework introduced during its refinement to generate a graphical representation of the executable algorithm. EB2RC also generates a recursive algorithm that is easily translated into executable code. We illustrate our technique through case studies and their analysis.


  1. 1.
    Abrial, J.-R.: Modeling in Event-B: System and Software Engineering. Cambridge University Press, Cambridge (2010)CrossRefMATHGoogle Scholar
  2. 2.
    Barnett, M., Chang, B.-Y.E., DeLine, R., Jacobs, B., M. Leino, K.R.: Boogie: a modular reusable verifier for object-oriented programs. In: de Boer, F.S., Bonsangue, M.M., Graf, S., de Roever, W.-P. (eds.) FMCO 2005. LNCS, vol. 4111, pp. 364–387. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  3. 3.
    Barnett, M., Leino, K.R.M., Schulte, W.: The Spec# programming system: an overview. In: Barthe, G., Burdy, L., Huisman, M., Lanet, J.-L., Muntean, T. (eds.) CASSIS 2004. LNCS, vol. 3362, pp. 49–69. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  4. 4.
    Floyd, R.W.: Algorithm 97: shortest path. Commun. ACM 5(6), 345 (1962)CrossRefGoogle Scholar
  5. 5.
    Kaufmann, M., Moore, S.J.: Some key research problems in automated theorem proving for hardware software verification. Revista de la Real Academia de Ciencias Exactas, Físicas y Naturales. Serie A. Matemâticas 98(1), 181–195 (2004)Google Scholar
  6. 6.
    Kourie, D.G., Watson, B.W.: The Correctness-by-Construction Approach to Programming. Springer, Heidelberg (2012)CrossRefMATHGoogle Scholar
  7. 7.
    Leavens, G.T., Abrial, J.-R., Batory, D., Butler, M., Coglio, A., Fisler, K., Hehner, E., Jones, C., Miller, D., Peyton-Jones, S., Sitaraman, M., Smith, D.R., Stump, A.: Roadmap for enhanced languages and methods to aid verification. In: 5th International Conference on Generative Programming and Component Engineering, Portland, Oregon, pp. 221–235. ACM (2006)Google Scholar
  8. 8.
    Méry, D.: A simple refinement-based method for constructing algorithms. ACM SIGCSE Bulletin 41(2), 51–59 (2009)CrossRefGoogle Scholar
  9. 9.
    Méry, D.: Refinement-based guidelines for algorithmic systems. Int. J. Softw. Inform. 3(2–3), 197–239 (2009)Google Scholar
  10. 10.
    Méry, D., Monahan, R.: Transforming Event-B models into verified C# implementations. In: 1st International Workshop on Verification and Program Transformation, Saint Petersburg, Russia, pp. 57–73. EasyChair (2013)Google Scholar
  11. 11.
    Méry, D., Singh, N.K.: The EB2ALL code generation tool (2011). http://eb2all.loria.fr/
  12. 12.
    Project RODIN. Rigorous open development environment for complex systems (2004). http://rodin-b-sharp.sourceforge.net/

Copyright information

© Springer International Publishing AG 2016

Authors and Affiliations

  • Zheng Cheng
    • 1
  • Dominique Méry
    • 2
  • Rosemary Monahan
    • 1
  1. 1.Computer Science DepartmentMaynooth UniversityCo. KildareIreland
  2. 2.LORIAUniversité de LorraineVandœUvre-lès-nancyFrance

Personalised recommendations