Towards Generating SPARK from Event-B Models

This paper presents an approach to generate SPARK code from Event-B models. System models in Event-B are translated into SPARK packages including proof annotations. Properties of the Event-B models such as axioms and invariants are also translated and embedded in the resulting models as pre- and post-conditions. This helps with generating SPARK proof annotations automatically hence ensuring the correct behaviour of the resulting code. A prototype plug-in for the Rodin has been developed and the approach is evaluated on different examples. We also discuss the possible extensions including to generate scheduled code and data structures such as records.

[1]  C. A. R. Hoare,et al.  An axiomatic basis for computer programming , 1969, CACM.

[2]  K. Rustan M. Leino,et al.  The EventB2Dafny Rodin plug-in , 2012, 2012 Second International Workshop on Developing Tools as Plug-Ins (TOPI).

[3]  Grady Booch,et al.  Software engineering with Ada (3. ed.) , 1993, Benjamin/Cummings series in object-oriented software engineering.

[4]  Michael Butler Reasoned Modelling with Event-B , 2016, SETSS.

[5]  Jean-Raymond Abrial,et al.  Modeling in event-b - system and software engineering by Jean-Raymond Abrial , 2010, SOEN.

[6]  Colin F. Snook,et al.  Behaviour-Driven Formal Model Development , 2018, ICFEM.

[7]  Thai Son Hoang,et al.  Decomposition tool for event‐B , 2011, Softw. Pract. Exp..

[8]  Thai Son Hoang,et al.  Rodin: an open toolset for modelling and reasoning in Event-B , 2010, International Journal on Software Tools for Technology Transfer.

[9]  Néstor Cataño,et al.  Translating event-B to JML-specified Java programs , 2014, SAC.

[10]  Andrew Ireland,et al.  E-SPARK: Automated Generation of Provably Correct Code from Formally Verified Designs , 2012, Electron. Commun. Eur. Assoc. Softw. Sci. Technol..

[11]  K. Rustan M. Leino Developing Verified Programs with Dafny , 2012, VSTTE.

[12]  Michael J. Butler,et al.  Verifiable Code Generation from Scheduled Event-B Models , 2018, ABZ.