EventB2Java: A Code Generator for Event-B

Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 9690)


Event-B is a formal specification language and a methodology used to build software systems. Formal specifications are more useful when they can be executed. An executable formal specification provides insight on the behaviour of the system being modelled w.r.t an expected behaviour. This paper presents a tool that generates executable implementations of Event-B models. The tool is implemented as a plug-in of the Rodin platform, an Eclipse IDE that provides a set of tools to work with Event-B models. Our tool has extensively been used for generating code for Event-B models of Android applications, reactive systems, Smart Cards, searching algorithms, among others. The first author regularly uses EventB2Java in teaching to help master students of Software Engineering to get a better grasp of the behaviour of a model in Event-B and to detect inconsistencies in the model.


Code generation Event-B EventB2Java Java JML Rodin 


  1. 1.
    Abrial, J.-R.: Sequential Program Development: Teaching Resources (2009). Accessed 2015
  2. 2.
    Abrial, J.-R.: Modeling in Event-B: System and Software Design. Cambridge University Press, New York (2010)CrossRefzbMATHGoogle Scholar
  3. 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. Softw. Tools Technol. Transf. 12(6), 447–466 (2010)CrossRefGoogle Scholar
  4. 4.
    Catano, N., Rueda, C.: Teaching formal methods for the unconquered territory. In: Gibbons, J., Oliveira, J.N. (eds.) TFM 2009. LNCS, vol. 5846, pp. 2–19. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  5. 5.
    Catano, N., Rueda, C.: Matelas: a predicate calculus common formal definition for social networking. In: Frappier, M., Glässer, U., Khurshid, S., Laleau, R., Reeves, S. (eds.) ABZ 2010. LNCS, vol. 5977, pp. 259–272. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  6. 6.
    Edmunds, A., Butler, M.: Tool support for Event-B code generation. In: Workshop on Tool Building in Formal Methods, Québec, Canada. John Wiley and Sons (2010)Google Scholar
  7. 7.
    Edmunds, A., Rezazedeh, A.: Development of a Heating Controller System (2011). Accessed Mar 2015
  8. 8.
    Leavens, G., Baker, A., Ruby, C.: Preliminary design of JML: a behavioral interface specification language for Java. ACM Spec. Interest Group Softw. Eng. 31(3), 1–38 (2006)CrossRefGoogle Scholar
  9. 9.
    Méry, D., Singh, N.: Automatic code generation from Event-B models. In: Symposium on Information and Communication Technology, Hanoi, Vietnam. ACM (2011)Google Scholar
  10. 10.
    Meyer, B.: Object-Oriented Software Construction, 2nd edn. Prentice-Hall Inc, Upper Saddle River (1997)zbMATHGoogle Scholar
  11. 11.
    Ostroumov, S., Tsiopoulos, L.: VHDL code generation from formal Event-B models. In: Euromicro Conference on Digital System Design, pp. 127–134 (2011)Google Scholar
  12. 12.
    Víctor, R., Cataño, N.: The Social-Event Planner (2012). Accessed 2015
  13. 13.
    Rivera, V., Cataño, N.: Translating Event-B to JML-specified Java programs. In: 29th ACM SAC, Gyeongju, South Korea, 24–28 March 2014Google Scholar
  14. 14.
    Rivera, V., Cataño, N., Wahls, T., Rueda, C.: Code generation for Event-B. Int. J. Softw. Tools Technol. Transf. (STTT), pp. 1–22 (2015)Google Scholar
  15. 15.
    State-Machines and Code Generation (2012). Accessed Aug 2013
  16. 16.
    Wright, S.: Automatic generation of C from Event-B. In: Workshop on Integration of Model-based Formal Methods and Tools, Nantes, France. Springer-Verlag (2009)Google Scholar

Copyright information

© Springer International Publishing Switzerland 2016

Authors and Affiliations

  1. 1.Innopolis UniversityTatarstanRussia

Personalised recommendations