Difference between pages "D45 Code Generation" and "Rodin Workshop 2012"

From Event-B
(Difference between pages)
Jump to navigationJump to search
imported>Andy
 
imported>WikiSysop
 
Line 1: Line 1:
= Overview =
+
= Rodin User and Developer Workshop, 27-29 February 2012,  Fontainebleau, France =
The code generation plug-in allows the generation of code for typical real-time embedded control software from refined Event-B models. Such a feature will be an important factor in ensuring eventual deployment of the DEPLOY approach within industrial organisations.
 
  
= Motivations =
 
DEPLOY industrial partners are interested in the formal development of multi-tasking, embedded control systems. During the project, work has been undertaken to investigate automatic generation, from Event-B models, for these type of systems
 
<ref name="aaa">http://eprints.soton.ac.uk/270824/ "Edmunds, Andrew and Butler, Michael (2010) Tool Support for Event-B Code Generation. In, WS-TBFM2010"</ref><ref name="aab">http://eprints.soton.ac.uk/272006/ "Edmunds, Andrew and Butler, Michael (2011) Tasking Event-B: An Extension to Event-B for Generating Concurrent Code. In, PLACES 2011, Saarbrucken, Germany"</ref><ref name="aac">http://eprints.soton.ac.uk/272771/ "Edmunds, Andrew, Rezazadeh, Abdolbaghi and Butler, Michael (2011) From Event-B Models to Code: Sensing, Actuating, and the Environment. At SBMF2011, Sao Paulo, Brazil, 28 - 26 Sep 2011."</ref><ref name="aad">http://eprints.soton.ac.uk/335400/ "Edmunds, Andrew, Rezazadeh, Abdolbaghi and Butler, Michael (2012) Formal modelling for Ada implementations: tasking Event-B. In, Ada-Europe 2012: 17th International Conference on Reliable Software Technologies, Stockholm, SE, 11 - 15 Jun 2012. 14pp. (In Press)"</ref><ref name="aae">http://eprints.soton.ac.uk/336226/ "Edmunds, Andrew, Butler, Michael, Maamria, Issam, Silva, Renato and Lovell, Chris (2012) Event-B code generation: type extension with theories. In, ABZ 2012, Pisa, IT, 19 - 21 Jun 2012. 4pp. (In Press)"</ref>. Initially, we chose to translate to the Ada programming language
 
  
<ref name="aaf" J. Barnes. Programming in Ada 2005. International Computer Science Series. Addison Wesley, 2006.</ref>
+
Event-B is a formal method for system-level modelling and analysis. The Rodin Platform is an Eclipse-based toolset for Event-B that provides effective support for modelling and automated proof. The platform is open source and is further extendable with plug-ins. A range of plug-ins have already been developed including ones that support animation, model checking and UML-B.
 +
The [http://wiki.event-b.org/index.php/Rodin_Workshop_2009 first Rodin User and Developer Workshop was held in July 2009 at the University of Southampton] while the [http://wiki.event-b.org/index.php/Rodin_Workshop_2010 second took place at the University of Düsseldorf in September 21-23, 2010]. The 2012 workshop will be part of the [http://www.bmethod.com/php/federated-event-2012-en.php DEPLOY Federated Event] hosted by the [http://lacl.univ-paris12.fr/ LACL laboratory] at [http://www.iutsf.u-pec.fr/ IUT Sénart-Fontainebleau]. Fontainebleau is within easy reach of Paris.
  
, and use it as a basis for the abstractions used in our approach.<br>
+
While much of the development and use of Rodin takes place within the [http://www.deploy-project.eu EU FP7 DEPLOY Project], there is a growing group of users and plug-in developers outside of DEPLOY. The purpose of this workshop is to bring together existing and potential users and developers of the Rodin toolset and to foster a broader community of Rodin users and developers.
We described our previous code generation feature as a demonstrator tool; chiefly a tool designed as a proof of concept, used by us to validate the approach. In this sense, the tool as it stands now, is the first prototype intended to be used by developers, and thus motivated numerous evolutions and new features such as:
 
* allowing a more seamless edition of tasking Event-B,
 
* supporting extensibility,
 
* supporting other target languages than just Ada,
 
* supporting programming concepts reification using abstract translators.
 
  
= Choices / Decisions =
+
For Rodin users the workshop will provide an opportunity to share tool experiences and to gain an understanding of on-going tool developments. For plug-in developers the workshop will provide an opportunity to showcase their tools and to achieve better coordination of tool development effort.
Considering the demonstrator as a baseline, we can list the new features as follows:
 
* Tasking Event-B is now integrated with the Event-B explorer. It uses the extensibility mechanism of Event-B EMF (In the previous version it was a separate model).
 
* Tasking Event-B is now integrated with the Event-B model editors. Tasking Event-B features can now be edited in the same place as the other Event-B features.
 
* We have the ability to translate to Java and C, in addition to Ada source code; and the source code is placed in appropriate files within the project.
 
* We use theories to define translations of the Event-B mathematical language (Theories for Ada and C are supplied).
 
* We use the theory plug-in as a mechanism for defining new data types , and the translations to target data types.
 
* The Tasking Event-B to Event-B translator is fully integrated. The previous tool generated a copy of the project, but this is no longer the case.
 
* The translator is extensible.
 
* The composed machine component is used to store event 'synchronizations'.
 
* Minimal use is made of the EMF tree editor in Rose.
 
  
These evolutions will be detailed hereafter. Moreover, the code generators have been completely re-written. The translators are now implemented using Java only. In our previous work we attempted to make use of the latest model-to-model transformation technology, available in the Epsilon tool set, but we decided to revert to Java since Epsilon lacked the debugging and productivity features of the Eclipse Java editor.
+
The format will be presentations together with plenty of time for discussion. On Day 1 a Developer Tutorial will be held while Days 2 and 3 will be devoted to tool usage and tool developments. The workshop will be followed by an open  [http://www.bmethod.com/php/federated-event-2012-en.php Industry Day].
  
== Tasking Event-B and its edition ==
+
If you are interested in giving a presentation at the Rodin workshop, send a short abstract (1 or 2 pages in PDF) to rodin@ecs.soton.ac.uk by 16 January 2012. Indicate whether it is a tool usage or tool development presentation. Plug-in presentations may be about existing developments or planned future developments.  We will endeavour to accommodate all submissions that are relevant to Rodin and Event-B.
A text-based task body editor was added, to minimize the amount of editing required with the EMF tree editor. The task body editor is associated with a parser-builder; after the text is entered in the editor the EMF representation is generated (by clicking a button) that is, assuming parsing is successful. If the parser detects an error, information about the parse error is displayed in an adjoining text box. When specifying events in the task body, there is no longer a need to specify two events involved in a synchronization. The code generator automatically finds the corresponding event of a synchronization, based on the event name, and using the composed machine component. Composed machines are used to store event 'synchronizations', and are generated automatically during the decomposition process. This reduces the amount of typing in the TaskBody editor, since we no longer need to specify both local and remote (synchronizing) events. The new feature also overcomes the 'problem' that we previously experienced, with duplicate event names in a development, and event selection, when specifying the task body. The EMF tree editor in Rose is now only used minimally; to add annotations for Tasking, Shared and Environ Machines; typing annotations, and parameter direction information; and sensing/actuating annotations, where necessary. Further work is under way to integrate the code generation feature with the new Rodin editor.
 
  
== Allowing Extensibility ==
+
Attendance at the DEPLOY Federated Event (including the Rodin Workshop) is open to all.
The code generation approach is now extensible; in that, new target language constructs can be added using the Eclipse extension mechanism. The translation of target's mathematical language is now specified in the theory plug-in. This improves clarity since the the translation from source to target is achieved by specifying pattern matching rules. The theory plug-in is used to specify new data-types, and how they are implemented. Translated code is deposited in a directory in the appropriate files. An Ada project file is generated for use with AdaCore's GPS workbench. Eventually this could be enabled/disabled in a preferences dialog box. The Tasking Event-B to Event-B translator is now properly integrated. Control variable updates to the Event-B model are made in a similar way to the equivalent updates in the state-machine plug-in. The additional elements are added to the Event-B model and marked as 'generated'. This prevents users from manually modifying them, and allows them to be removed through a menu choice.
 
  
== Targeting new Languages ==
 
Making the step from Event-B to code is a process that can be aided through automatic code generation.
 
The code generation plug-in for Rodin is a new tool for translating Event-B models to concurrent programmes.
 
However users of such a tool will likely require a diverse range of target languages and target platforms, for which we do not currently provide translations.Some of these languages may be subtly different to existing languages and only have modest differences between the translation rules, for example C and C++, whilst others may have more fundamental differences. As the translation from Event-B to executable code is non-trivial and to reduce the likelihood of error, we want to generalize as much of the translation as possible so that existing translation rules are re-used.
 
Therefore significant effort is needed to ensure that such a translation tool is extensible to allow additional languages to be included with relative ease. Here we concentrate on translation from a previously defined Common Language Meta-model, the intermediary language IL1, which Event-B translates to directly. IL1 is an EMF metamodel representation of generic properties and functionality found in many programming languages. It has representations for key structural concepts such as variables, subroutines, function calls and parameters. The translation of predicates and expressions contained within the code are handled by a new extension to the theory plug-in, which allows translation rules to be developed for specific target languages within the Rodin environment. The generic nature of the intermediary language is designed to allow for a wide range of different target languages. Developers of new target languages are required to write translators in Java for the conversion from the EMF representation to the code of their target language. To do this we provide a central translation manager, that takes an IL1 model and automatically calls the appropriate translators for each element of the model, whilst also providing the link to the predicate and expression translators provided by the new theory plug-in. The developer registers their translators for the target language through an extension point, where currently there are 15 light-weight translators required for a new target language.
 
To aid the developer, we provide abstract translators for each required element in the IL1 model that has to be translated. These translators perform the majority of the translation automatically, meaning that in most cases all the developer is required to do is format strings into the appropriate structure for their target language.
 
For example in an branch statement, the developer would be required to write a method stating how a branch is defined and structured in their language, using a set of previously translated guard conditions and actions.
 
Importantly, the flexibility remains for the developer to re-write any of the translations if the ones provided are not suitable.
 
  
== Using Abstract Translators ==
+
----
To test our approach, we have built translators for C, Ada and Java using the same underlying abstract translators.
 
Additionally we consider the case where a new language may be required that has only modest differences to an existing language. A good example of this is to consider the case where a different library may want to be used from one used in an existing translation. For instance in C, concurrency can be achieved through different mechanisms such as OpenMP or Pthreads. In this case it may be that all but the mechanism for handling a subroutine call are the same, meaning that the majority of the translation can occur using common translators, with separate translators for the different methods of handling a subroutine call. To allow for this we allow the developer to assign a core and specialisation language to each translator they build. In cases where a translator for the specialisation language does not exist, the translator will automatically defer to the default core language translator, if one exists. This means that default translators for a particular core language can be written for the majority of the translation, with specialisations being provided where differences occur. The core and specialisation of the language is also reflected in the theory translator, meaning that language theories are only required for the core languages, rather than for each individual specialization.
 
  
= Available Documentation =
+
'''Organisers'''
We have updated the documentation, including the Tasking Event-B Overview, and Tutorial materials.
 
[[TODO]] ''complete''
 
  
= Status =
+
Michael Butler, University of Southampton
  
We released a new version of the code generator on 22-03-2012. The changes were made to the methodology, user interface, and tooling. The first version of the code generator supported translation to Ada, and the current version also has limited support for C.
+
Stefan Hallerstede, University of Aarhus
  
= References =
+
Thierry Lecomte, ClearSy
<references/>
 
  
[[Category:D45 Deliverable]]
+
Michael Leuschel, University of Düsseldorf
 +
 
 +
Alexander Romanovsky, University of Newcastle
 +
 
 +
Laurent Voisin, Systerel

Revision as of 13:33, 9 September 2011

Rodin User and Developer Workshop, 27-29 February 2012, Fontainebleau, France

Event-B is a formal method for system-level modelling and analysis. The Rodin Platform is an Eclipse-based toolset for Event-B that provides effective support for modelling and automated proof. The platform is open source and is further extendable with plug-ins. A range of plug-ins have already been developed including ones that support animation, model checking and UML-B. The first Rodin User and Developer Workshop was held in July 2009 at the University of Southampton while the second took place at the University of Düsseldorf in September 21-23, 2010. The 2012 workshop will be part of the DEPLOY Federated Event hosted by the LACL laboratory at IUT Sénart-Fontainebleau. Fontainebleau is within easy reach of Paris.

While much of the development and use of Rodin takes place within the EU FP7 DEPLOY Project, there is a growing group of users and plug-in developers outside of DEPLOY. The purpose of this workshop is to bring together existing and potential users and developers of the Rodin toolset and to foster a broader community of Rodin users and developers.

For Rodin users the workshop will provide an opportunity to share tool experiences and to gain an understanding of on-going tool developments. For plug-in developers the workshop will provide an opportunity to showcase their tools and to achieve better coordination of tool development effort.

The format will be presentations together with plenty of time for discussion. On Day 1 a Developer Tutorial will be held while Days 2 and 3 will be devoted to tool usage and tool developments. The workshop will be followed by an open Industry Day.

If you are interested in giving a presentation at the Rodin workshop, send a short abstract (1 or 2 pages in PDF) to rodin@ecs.soton.ac.uk by 16 January 2012. Indicate whether it is a tool usage or tool development presentation. Plug-in presentations may be about existing developments or planned future developments. We will endeavour to accommodate all submissions that are relevant to Rodin and Event-B.

Attendance at the DEPLOY Federated Event (including the Rodin Workshop) is open to all.



Organisers

Michael Butler, University of Southampton

Stefan Hallerstede, University of Aarhus

Thierry Lecomte, ClearSy

Michael Leuschel, University of Düsseldorf

Alexander Romanovsky, University of Newcastle

Laurent Voisin, Systerel