Difference between pages "Code Generation Tutorial" and "Current Developments"

From Event-B
(Difference between pages)
Jump to navigationJump to search
imported>Andy
 
imported>Jastram
(Team-Based Development)
 
Line 1: Line 1:
For more information contact Andy Edmunds - University of Southampton - mailto:ae2@ecs.soton.ac.uk
+
{{TOCright}}
=== Tutorial Overview ===
+
This page sum up the known developments that are being done around or for the [[Rodin Platform]]. ''Please contributes informations about your own development to keep the community informed''
  
The aim of the tutorial is to allow users to explore the approach with a relatively simple example. The example uses a shared buffer with reader and writer processes. The tutorial is presented in three stages, making use of the example projects from the download site. There are two translations performed, one is to a common language model (IL1). The second is to an Event-B project which includes a model of the implementation. There is a PrettyPrinter for Ada source code, which uses the common language model. An overview of Tasking Event-B can be found at http://wiki.event-b.org/index.php/Tasking_Event-B_Overview.
+
== Deploy Tasks ==
 +
The following tasks were planned at some stage of the [[Deploy]] project.
 +
=== Core Platform ===
 +
==== New Mathematical Language ====
 +
==== Rodin Index Manager ====
 +
[[Systerel]] is in charge of this task.
 +
{{details|Rodin Index Design|Rodin index design}}
  
A typical Event-B development may be refined to the point where it is ready for implementation, but the Event-B language is not expressive enough to fully describe the implementation. Tasking Event-B facilitates this final step to implementation, by extending Event-B with the necessary constructs. Event-B machines that are to be implemented (and their seen Contexts) are selected and added to a ''Tasking Development''; the Tasking Development files have the file extension ''.tasking''. The machines in the Tasking Development are then extended with implementation details.
+
The purpose of the Rodin index manager is to store in a uniform way the entities that are declared in the database together with their occurrences. This central repository of declarations and occurrences will allow for fast implementations of various refactoring mechanisms (such as renaming) and support for searching models or browsing them.  
  
The example/tutorial projects are,
+
==== Undo / Redo ====
 +
[[Systerel]] is in charge of this task.
 +
{{details|Undo Redo Design|Undo/Redo design}}
 +
{{TODO|describe current work in [[Undo Redo Design]]}}
  
{| border="1"
+
{{TODO|add a short summary about current work for undo/redo here}}
|SharedBuffer20100819Demo
 
|An example project with a completed Tasking Development and IL1 model (post IL1 translation, but before Event-B translation).
 
|-
 
|Sharedbuffer20100819Tasking
 
|Same as the example project above, but with Event-B model translations. The difference being that this development includes a model of the implementation. These are refinements that include a program counter to describe flow of execution in each task.
 
|-
 
|SharedBuffer20100819Tutorial
 
|A bare project for step 1 of the tutorial.
 
|-
 
|Sharedbuffer20100819Tutorial2
 
|A partially completed tasking development for steps 2 and 3 of the tutorial.
 
|}
 
  
== Preliminaries ==
+
==== Text Editor ====
Before further discussion of the modelling aspects, we take a look at the PrettyPrint viewers. The PrettyPrinters make the viewing of IL1 and tasking models easier; it also provides a route to generate source code. The source code can easily be pasted from the IL1 Pretty Printer window into an the Ada source file .
+
[[Düsseldorf]] has a prototype text-based editor for Event-B (courtesy of Fabian Fritz), but which needs more work to fully integrate into Rodin.
==== The PrettyPrint View of a Tasking Development ====
 
To open the Tasking PrettyPrint viewer,
 
* from the top-menu select ''Window/Show View/Other/Tasking Pretty Printer''.
 
  
Note that the Tasking PrettyPrinter may have to be closed when editing the Tasking Development, since it can give rise to exceptions. The PrettyPrinter would need further work to make it robust, however it is intended only as a short-term solution.
+
=== Plug-ins ===
 +
==== Requirement Management Plug-in ====
 +
[[User:Jastram|Michael]] at [[Düsseldorf]] is in charge of the [[:Category:Requirement Plugin|Requirements Management Plug-in]].
  
* Open the ''SharedBuffer20100819Demo'' Project and switch to the Resource Perspective.
+
{{See also|ReqsManagement|Requirements Tutorial|l1=Requirements Management Plug-in}}
* Open the ''.tasking'' model and inspect it. Clicking on the Main, Machine or Event nodes updates the pretty print window.
 
  
==== Viewing Source Code ====
+
This plug-in allows:
aka. The PrettyPrint View of an IL1 Model.
+
* Requirements to be edited in a set of documents (independently from Rodin)
 +
* Requirements to be viewed within Rodin
 +
* Individual Requirements to be linked to individual Event-B-Entities
 +
* A basic completion test to be performed
  
To view Ada source code,
+
==== UML-B Plug-in ====
* from the top-menu select ''Window/Show View/Other/IL1 Pretty Printer''.
+
[[Southampton]] is in charge of [[UML-B]] plug-in.
* Open the ''SharedBuffer20100819Demo'' Project and switch to the Resource Perspective.
 
* Open the ''.il1'' model and inspect it. Clicking on the Protected, Main Entry, or Task nodes updates the pretty print window.
 
  
==== Cleaning the Tasking Development ====
+
* Support for synchronisation of transitions from different statemachines. This feature will allow two or more transitions in different statemachines to contribute to a single event. This feature is needed because a single event can alter several variables (in this case statemachines) simultaneously.
If the ''.tasking'' file has errors, then it may need cleaning. To do this right-click on the ''Main'' node, select ''Epsilon Translation/CleanUp''. If a model has errors it can still be viewed by clicking on the ''Selection'' tab at the bottom of the tasking editor window.
 
  
== The Tutorial ==
+
*Allow user to allocate the name of the 'implicit contextual instance' used in a class. Events and Transitions owned by a class are implicitly acting upon an instance of the class which has formerly been denoted by the reserved word 'self'. This modification allows the modeller to override 'self' (which is now the default name) with any other identifier. This feature is needed to avoid name clashes when synchronising transitions into a single event. It also allows events to be moved between different classes (or outside of all classes) during refinement without creating name clashes.
The steps needed to generate code from an Event-B model, in this tutorial, are as follows,
 
* Step 1 - [http://wiki.event-b.org/index.php/Code_Generation_Tutorial#Creating_The_Tasking_Development Create the tasking development].
 
* Step 2 - [http://wiki.event-b.org/index.php/Code_Generation_Tutorial#Providing_the_Annotations_for_Implementations Add annotations]
 
* Step 3 - [http://wiki.event-b.org/index.php/Code_Generation_Tutorial#Invoking_the_Translation Invoke translators].
 
  
==== Creating The Tasking Development ====
+
* Better support for state machine refinement in UML-B. This revision to UML-B allows a statemachine to be recognised as a refinement of another one and to be treated in an appropriate way during translation to Event-B. The states and transitions of a refined statemachine can be elaborated by adding more detailed hierarchical statemachines.
* Change to the Event-B Perspective.
 
* Open the ''SharedBuffer20100819Tutorial'' Project.
 
* Select the following Machines: Reader, Writer and Shared.
 
* Right-click and select ''Make Tasking Development/Generate Tasking Development''.
 
  
The new Tasking Development will not be visible in the Event-B perspective, change to the resource perspective, open and inspect the new ''.tasking'' file. The Tasking Development contains (the EMF representation of) the machines that we wish to provide implementations for. In order to introduce the new concepts we have prepared a partially complete development.  
+
==== ProB Plug-in ====
 +
[[Düsseldorf]] is in charge of [[ProB]].
 +
{{details|ProB current developments|ProB current developments}}
  
Change to the Project ''SharedBuffer20100819Tutorial2'' to begin the next step.
+
===== Work already performed =====
  
==== Providing the Annotations for Implementations ====
+
We have now ported ProB to work directly on the Rodin AST. Animation is working and the user can now set a limited number of preferences.
* Close any Tasking Pretty Print Viewers that remain open. The incomplete model will give rise to exceptions.
+
The model checking feature is now also accessible.
* Go to the to the Resource Perspective.
+
It is also possible to create CSP and classical B specification files. These files can be edited with BE4 and animated/model checked with ProB.
* Open and inspect the ''.tasking'' machine.
+
On the classical B side we have moved to a new, more robust parser (which is now capable of parsing some of the more complicated AtelierB
 +
specifications from Siemens).
  
The ''WriterTsk'' and ''SharedObj'' machines are incomplete. We will take the steps to necessary to provide implementation details.  
+
On the developer side, we have moved to a continuous integration infrastructure using CruiseControl. Rodin is also building from CVS in that infrastructure.
  
===== The WriterTsk Machine =====
+
===== Ongoing and future developments=====
In the partially complete tutorial project we already identified the ''WriterTsk'' as an ''Auto Task'' Tasking Machine, by adding the ''Auto Task'' extension. ''Auto Tasks'' are tasks that will be declared and defined in the ''Main'' procedure of the implementation. The effect of this is that the ''Auto Tasks'' are created when the program first loads, and then activated (made ready to run) before the ''Main'' procedure body runs. We have added the ''Periodic Task'' extension to the ''Auto Task'', and set a period of 250 milliseconds. We will now complete the sequence that has been partially defined in the task body.
 
  
*'''Add Synchronisation between TWrite and SWrite'''.
+
We are currently developing a new, better user interface.
** Expand the ''Auto Task Machine'' node.
+
We also plan to support multi-level animation with checking of the gluing invariant.
** Expand the ''Seq'' sub-tree.
 
** Right-click on the ''Seq'' node and select ''New Child/Left Branch EventWrapper''.
 
** Provide the event label ''w1'' using the properties view.
 
** Right-click on Event Wrapper and select ''New Child/ Synch Events''.
 
** Select ''Synch Events'' and go to the drop-down menu of the ''Local Event'' property.
 
** At this point the drop-down box displays a number of event names, select the ''TWrite'' event.
 
** Go to the drop-down menu of the ''Remote Event'' property.
 
** From the list of events select the ''SWrite'' event.
 
  
The Synch Events construct is used to implement [http://wiki.event-b.org/index.php/Tasking_Event-B_Overview#Control_Constructs Event Synchronisation]. The next step wraps an event in an Event Wrapper in order to update the local state; there is no synchronisation as such but we will re-use the constructs that already exist.
+
We have prototypes for several extensions working, but they need to be fully tested and integrated into the plugin:
 +
* an inspector that allows the user to inspect complex predicates (such as invariants or guards) as well as expressions in a tree-like manner
 +
* a graphical animator based on SWT that allows the user to design his/her own animations easily within the tool
 +
* a 2D viewer to inspect the state space of the specification
  
*'''Add the Wrapped Event TcalcWVal'''.
 
** Expand the sub-tree of the second ''Seq'' node.
 
** Right-click on the ''Seq'' node and select ''New Child/Left Branch EventWrapper''.
 
** Provide the event label ''w2'' using the properties view.
 
** Right-click on Event Wrapper and select ''New Child/ Synch Events''.
 
** Select ''Synch Events'' and go to the drop-down menu of the ''Local Event'' property.
 
** From the list of events select the ''TcalcWVal'' event.
 
  
We have now completed the task body, and it just remains to complete provide details for the ''TWrite'' event. The ''TWrite'' event in ''WriterTsk'' is to be synchronized with the ''SWrite'' event in the ''SharedObj''.
 
*'''Add Event Extensions'''.
 
** Right-click on the ''TWrite'' Event node.
 
** Select ''New Child/Extension''.
 
** Right-click on the ''Extension'' node and select ''New Child/Implementation'' from the menu.
 
** Go to the Implementation properties view and set the ''Implementation Type'' property to ''ProcedureSynch''.
 
  
*'''Identify Incoming and Outgoing parameters'''.
+
== Exploratory Tasks ==
** Right-click on the ''outAP'' node and add an ''Extension''.
+
=== One Single View ===
** Right-click on the ''Extension'' and select''New Child/Parameter Type''.
+
[[Maria]] is in charge of this exploratory work during is internship.
** Go to the ''Parameter Type'' properties view and set the ''Parameter Type'' property to ''actualOut''.
+
{{details|Single View Design|Single View Design}}
** Right-click on the ''inAP'' node and add an ''Extension''.
+
The goal of this project is to present everything in a single view in Rodin. So the user won't have to switch perspectives.
** Right-click on the ''Extension'' and select''New Child/Parameter Type''.
 
** Go to the ''Parameter Type'' properties view and set the ''Parameter Type'' property to ''actualIn''.
 
  
===== The Shared Machine =====
 
  
The next step is to identify the ''SharedObj'' machine as a ''Shared Machine''. The ''SharedObj'' Machine will be extended using the Event-B EMF extension mechanism.
 
* Right-click on the ''SharedObj'' Machine node in the ''.tasking'' file.
 
* Select ''New Child/Extension''.
 
* Right-click on the ''Extension'' node and select ''New Child/Shared Machine'' from the menu.
 
  
We now show how to extend the ''SWrite'' event of the Shared Machine with details about its implementation. The ''SWrite'' event in ''SharedObj'' is to be synchronized with the ''TWrite'' event in the ''WriterTsk''.
+
== Others ==
* '''Identify SWrite as a Syncronisation'''.
 
** Right-click on the ''SWrite'' Event node.
 
** Select ''New Child/Extension''.
 
** Right-click on the ''Extension'' node and select ''New Child/Implementation'' from the menu.
 
** Go to the Implementation properties view and set the ''Implementation Type'' property to ''ProcedureSynch''.
 
  
* '''Identify incoming and outgoing parameters'''.
+
=== AnimB ===
** Right-click on the ''inFP'' node and add an ''Extension''.
+
[[Christophe]] devotes some of its spare time for this plug-in.
** Right-click on the ''Extension'' and select''New Child/Parameter Type''.
+
{{details|AnimB Current Developments|AnimB Current Developments}}
** Go to the ''Parameter Type'' properties view and set the ''Parameter Type'' property to ''formalIn''.
+
The current developments around the [[AnimB]] plug-in encompass the following topics:
** Right-click on the ''outFP'' node and add an ''Extension''.
+
;Live animation update
** Right-click on the ''Extension'' and select''New Child/Parameter Type''.
+
:where the modification of the animated event-B model is instantaneously taken into account by the animator, without the need to restart the animation.
** Go to the ''Parameter Type'' properties view and set the ''Parameter Type'' property to ''formalOut''.
+
;Collecting history
 +
:The history of the animation will be collected.
  
===== A Summary of Steps =====
+
=== Team-Based Development ===
  
For a Tasking Machine definition:
+
; Usage Scenarios
# Add the Tasking Machine type (Auto etc).
+
: In order to understand the problem properly, [http://www.stups.uni-duesseldorf.de/ Düsseldorf] created a number of usage [[Scenarios for Team-based Development]].
# Add the task type (Periodic etc.).
 
# Define the task priority.
 
# Define the task body.
 
# For each event, add the Event Type.
 
# For each event parameter, add the Parameter Type.
 
  
 
+
[[Category:Work in progress]]
For a Shared Machine definition:
 
# Add the ''SharedMachine'' Machine type.
 
# For each event, define the Event Type.
 
# For each event parameter, define the Parameter Type.
 
 
 
==== Invoking the Translation ====
 
 
 
* To create the IL1 model,
 
** Right-Click on the Main node, select ''Epsilon Translation/Translate Task Mch 2 IL1 EMF''.
 
** Open the Resource Perspective.
 
** Right-click on the ''sharedbuffer20100819Tutorial2'' project folder.
 
** Select refresh, the ''.il1'' file should appear in the project.
 
** Open and inspect the file, and view the source code by opening the IL1 Pretty Print view if desired.
 
 
 
* To create the Event-B model of the implementation,
 
** Return to the Rodin Modelling Perspective.
 
** Right-Click on the Main node, select ''Epsilon Translation/Translate Task Mch 2 Event-B EMF''.
 
** The ''sharedbuffer20100819bTasking'' project is generated, it can be opened and inspected.
 
 
 
There are errors in the generated machines (not investigated the cause yet); these can be fixed in the following way.
 
* Open a Machine in the Event-B Machine Editor.
 
* Select the Edit tab.
 
* Open the REFINES section, the error lies here.
 
* The correct machine is refined, but choose a different machine to refine (any one, it doesn't matter).
 
* Select the original refined machine again.
 
* Save and clean the project, and the error should disappear.
 
* Repeat for the same errors in the other machines; save and clean again.
 
* The machines can viewed as normal using the Rodin editors.
 
 
 
[[Category:User documentation]]
 

Revision as of 18:35, 28 September 2008

This page sum up the known developments that are being done around or for the Rodin Platform. Please contributes informations about your own development to keep the community informed

Deploy Tasks

The following tasks were planned at some stage of the Deploy project.

Core Platform

New Mathematical Language

Rodin Index Manager

Systerel is in charge of this task.

For more details on Rodin index design, see Rodin Index Design.

The purpose of the Rodin index manager is to store in a uniform way the entities that are declared in the database together with their occurrences. This central repository of declarations and occurrences will allow for fast implementations of various refactoring mechanisms (such as renaming) and support for searching models or browsing them.

Undo / Redo

Systerel is in charge of this task.

For more details on Undo/Redo design, see Undo Redo Design.

TODO: describe current work in Undo Redo Design

TODO: add a short summary about current work for undo/redo here

Text Editor

Düsseldorf has a prototype text-based editor for Event-B (courtesy of Fabian Fritz), but which needs more work to fully integrate into Rodin.

Plug-ins

Requirement Management Plug-in

Michael at Düsseldorf is in charge of the Requirements Management Plug-in.

See also: Requirements Management Plug-in and Requirements Tutorial

This plug-in allows:

  • Requirements to be edited in a set of documents (independently from Rodin)
  • Requirements to be viewed within Rodin
  • Individual Requirements to be linked to individual Event-B-Entities
  • A basic completion test to be performed

UML-B Plug-in

Southampton is in charge of UML-B plug-in.

  • Support for synchronisation of transitions from different statemachines. This feature will allow two or more transitions in different statemachines to contribute to a single event. This feature is needed because a single event can alter several variables (in this case statemachines) simultaneously.
  • Allow user to allocate the name of the 'implicit contextual instance' used in a class. Events and Transitions owned by a class are implicitly acting upon an instance of the class which has formerly been denoted by the reserved word 'self'. This modification allows the modeller to override 'self' (which is now the default name) with any other identifier. This feature is needed to avoid name clashes when synchronising transitions into a single event. It also allows events to be moved between different classes (or outside of all classes) during refinement without creating name clashes.
  • Better support for state machine refinement in UML-B. This revision to UML-B allows a statemachine to be recognised as a refinement of another one and to be treated in an appropriate way during translation to Event-B. The states and transitions of a refined statemachine can be elaborated by adding more detailed hierarchical statemachines.

ProB Plug-in

Düsseldorf is in charge of ProB.

For more details on ProB current developments, see ProB current developments.
Work already performed

We have now ported ProB to work directly on the Rodin AST. Animation is working and the user can now set a limited number of preferences. The model checking feature is now also accessible. It is also possible to create CSP and classical B specification files. These files can be edited with BE4 and animated/model checked with ProB. On the classical B side we have moved to a new, more robust parser (which is now capable of parsing some of the more complicated AtelierB specifications from Siemens).

On the developer side, we have moved to a continuous integration infrastructure using CruiseControl. Rodin is also building from CVS in that infrastructure.

Ongoing and future developments

We are currently developing a new, better user interface. We also plan to support multi-level animation with checking of the gluing invariant.

We have prototypes for several extensions working, but they need to be fully tested and integrated into the plugin:

  • an inspector that allows the user to inspect complex predicates (such as invariants or guards) as well as expressions in a tree-like manner
  • a graphical animator based on SWT that allows the user to design his/her own animations easily within the tool
  • a 2D viewer to inspect the state space of the specification


Exploratory Tasks

One Single View

Maria is in charge of this exploratory work during is internship.

For more details on Single View Design, see Single View Design.

The goal of this project is to present everything in a single view in Rodin. So the user won't have to switch perspectives.


Others

AnimB

Christophe devotes some of its spare time for this plug-in.

For more details on AnimB Current Developments, see AnimB Current Developments.

The current developments around the AnimB plug-in encompass the following topics:

Live animation update
where the modification of the animated event-B model is instantaneously taken into account by the animator, without the need to restart the animation.
Collecting history
The history of the animation will be collected.

Team-Based Development

Usage Scenarios
In order to understand the problem properly, Düsseldorf created a number of usage Scenarios for Team-based Development.