Difference between pages "Rodin Platform 2.0 Release Notes" and "Tasking Event-B Tutorial"

From Event-B
(Difference between pages)
Jump to navigationJump to search
imported>Pascal
 
imported>Andy
 
Line 1: Line 1:
{{TOCright}}
+
THIS PAGE IS UNDER CONSTRUCTION !!!!!!
  
== What's New in Rodin 2.0? ==
+
For more information contact Andy Edmunds - University of Southampton - mailto:ae2@ecs.soton.ac.uk
* General Interface
+
=== Tasking Event-B Tutorial Overview ===
:'''Improved Statistic View'''. The statistic view was simplified and unified, to make it clearer and easily resizable and be displayed at first click on every element.
 
  
* Modelling
+
This code generation tutorial supplements the Heating Controller tutorial example, and makes use of example projects from the download site. The code generation stage produces implementable Ada code, and also an Event-B project which models the implementation. The Ada code is produced using a pretty printer tool from an intermediate model, the Common Language model (IL1), generated by a translation tool. An overview of Tasking Event-B can be found on the [[Tasking_Event-B_Overview]] page.
:'''Mathematical Extensions'''. Rodin was extended to allow definition of basic predicates, new operators or new algebraic types.  
 
::See [[Mathematical extensions]]
 
  
:'''Better platform's behaviour'''. Some cumbersome behaviours where improved:
+
The Heating Controller development has been refined to the point where we wish to add implementation constructs. 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.
::- It is now possible to display statistics for a project without expanding it first.
 
::- The view on selected hypotheses is now correctly scrolled to bottom, to display freshly added ones.
 
::- Navigating through proof tree nodes is faster (useless refreshings of search hypotheses where removed to gain performance).
 
  
:'''Independent quantified variables with the same name'''. It is now possible to use the same name for quantified variables which are independant.
+
The example/tutorial projects are,
  
:'''Improved WD Lemma Generation '''. The WD Lemma Generation was improved to simplify unnecessarily complicated lemmas.Some old proofs could appear as undischarged, the "Proof Replay on Undischarged POs" commmand will discharge these proofs.
+
{| border="1"
:See also: [[Improved WD Lemma Generation]]
+
|HeatingController20110429Demo
 +
|An example project with a completed Tasking Development and IL1 model (post IL1 translation, but before Event-B translation).
 +
|-
 +
|HeatingController20110429Tasking
 +
|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.
 +
|-
 +
|HeatingController20110429Tutorial
 +
|A bare project for step 1 of the [[Code_Generation_Tutorial#The_Tutorial |tutorial]].
 +
|-
 +
|HeatingController20110429Tutorial2
 +
|A partially completed tasking development for steps 2 and 3 of the [[Code_Generation_Tutorial#The_Tutorial |tutorial]].
 +
|}
  
:'''Auto-completion in wizards'''. It is now possible to use the auto-completion in the wizards of the modelling perspective.
+
== Preliminaries ==
 +
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 .
 +
==== 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''.
  
* Proving
+
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.
:'''Project Explorer's Actions now able to run in background'''. The "Proof Replay on Undischarged POs", "Retry Auto Provers" and "Recalculate Auto Status" commands are now able to run in background. The user is allowed to modify his models, and do interactive proving while such commands are running. Note that the "Save" action on interactively proved PO, which is concerned by such a command, might be delayed as concurrency occurs. The "Save" action will then be scheduled as a further task to be performed, and the user will have to wait or cancel the command. Those commands are accessible by right-clicking in the Event-B Explorer.
 
:See also: [[Proof Obligation Commands]]
 
  
:'''Proof details can now be displayed'''. It is now possible for the user to have a look at what a proof rule really did. A new view, the Rule Details View, was added to the proving perspective to show up the various operations performed by a rule on a proof tree node. It is for example possible, now, to look at instantiated hypotheses, or even, find hypotheses that where removed or hidden by a rule.
+
* Open the ''HeatingController20110429Demo'' Project and switch to the Resource Perspective.
:See also: [[Rodin_Proving_Perspective#Rule_Details_View]]
+
* Open the ''.tasking'' model and inspect it. Clicking on the Main, Machine or Event nodes updates the pretty print window.
  
:'''Proof Control auto-completion'''. It is now possible to use the auto-completion in the proof control input area.
+
==== Viewing Source Code ====
 +
aka. The PrettyPrint View of an IL1 Model.
  
* Changes for plugin-developers
+
To view Ada source code,
:'''Rodin 2.0 is Helios based'''. Rodin 2.0 is based on the Eclipse 3.6 Helios release. A wiki page has been added to document main improvements that could be of interest to plug-in developpers.
+
* from the top-menu select ''Window/Show View/Other/IL1 Pretty Printer''.
:See [[#Requirements | Migration to Eclipse 3.6]].
+
* Open the ''HeatingController20110429Demo'' 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.
  
:'''Rodin 2.0 is Java 1.6 based'''.
+
==== Cleaning the Tasking Development ====
:See [[#Requirements | Migration to Java 6]].
+
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.
  
:'''Simplified addition of tactic providers for the proving UI'''. A new attribute ("any") can now be used to describe the tactic providers that both apply on hypotheses and goal (i.e. that have the same behavior for both hypothesis predicates and goal predicate).
+
== The Tutorial ==
 +
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].
  
:'''A new mechanism to collect informations while traversing formulae'''. The <tt>IFormulaInspector<F></tt> interface has been added and published in order to ease the aggregation of informations (of type F) computed while traversing the AST of a formula. This mechanism replace the old one, where one should retrieve positions where such informations could take place and iterate in a second time on each positions to calculate and accumulate informations.
+
==== Creating The Tasking Development ====
 +
* Change to the Event-B Perspective.
 +
* Open the ''HeatingController20110429Tutorial'' Project.  
 +
* Select the following Machines: Display_Update_Task1, Envir1, Heater_Monitor_Task1, Shared_Object1, Temp_Ctrl_Task1 and HC_CONTEXT.
 +
* Right-click and select ''Make Tasking Development/Generate Tasking Development''.
  
== Requirements ==
+
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.  
{{TODO | Inform here of some specific system requirements (version of Java, etc).}}
 
  
* Reusing your development workspace with 1.6 JVM and Eclipse 3.6 :
+
Change to the Project ''HeatingController20110429Tutorial2'' to begin the next step.
:Update the compiler settings to be compliant with level 1.6. This can be done in '''Window > Preferences > Java > Compiler'''.
 
  
:One also has to check that eclipse no longer use the old JRE and resolved the new JRE.
+
==== Providing the Annotations for Implementations ====
:It can happen after switching to JRE version 1.6, used as the execution environment, that Eclipse no longer links any JRE to be used, hence leading to compiler linking errors.
+
* Close any Tasking Pretty Print Viewers that remain open. The incomplete model will give rise to exceptions.
:To check this, go to '''Window > Preferences > Java > Installed JREs''' and check that the currently used JRE actually points to the JRE 1.6.
+
* Go to the to the Resource Perspective.
:Once this operation made, it is needed to perform a '''clean''', '''build''' and '''refresh''' on all the worskpace.
+
* Open and inspect the ''.tasking'' machine.
  
* It is recommended to run the Rodin platform with a Java 6 Runtime Environment.
+
The ''WriterTsk'' and ''SharedObj'' machines are incomplete. We will take the steps to necessary to provide implementation details.  
  
* Only a 32-bit version of the Rodin platform is provided for PCs.
+
===== The WriterTsk Machine =====
 +
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.
  
* Only a 64-bit version of the Rodin platform is provided for MAC.
+
*'''Add Synchronisation between TWrite and SWrite'''.
: In other terms, Rodin 2.0 does not support MAC PowerPC / Intel 32-bit based platforms any longer.
+
** Expand the ''Auto Task Machine'' node.
 +
** 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.
  
* Migration to Eclipse 3.6 (Helios)
+
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.
:Some incompatibilities may arise while moving from Eclipse 3.5 to Eclipse 3.6.  
 
:The following page aims to list exhaustively the items to be checked and modified in order to make a plug-in compatible with Rodin 2.0.
 
:See [[Migration to Eclipse 3.6]].
 
  
* Migration to Java 6
+
*'''Add the Wrapped Event TcalcWVal'''.
:Plugin developers should be aware of possibly occurring issues when migrating from the JVM 1.5 to the JVM 6.
+
** Expand the sub-tree of the second ''Seq'' node.
:A typical example that could produce errors or an unwanted behaviour, is to compare the inlined result of a <tt>HashMap</tt> with hard-coded values (eg. a string).
+
** Right-click on the ''Seq'' node and select ''New Child/Left Branch EventWrapper''.
:As a consequence, it is required to set the JVM used by a plug-in to the 6 version, and then check and modify if necessary the code which produces or could potentially lead to errors.
+
** 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.
  
== Incompatibilities between Rodin 1.x and Rodin 2.0 ==
+
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''.
  
=== For Rodin 1.x users ===
+
*'''Identify Incoming and Outgoing parameters'''.
:No incompatibility is introduced when migrating to Rodin 2.0. In other terms, models used within Rodin 1.3 are compatible with Rodin 2.0.
+
** Right-click on the ''outAP'' node and add an ''Extension''.
 +
** 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 ''actualOut''.
 +
** Right-click on the ''inAP'' node and add an ''Extension''.
 +
** 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''.
  
=== For Rodin 1.x plugin developers ===
+
===== The Shared Machine =====
:This part lists the incompatibilities encountered when migrating from Rodin 1.x to Rodin 2.0.
 
  
* The "2-step" mechanism to get tactic applications from applicable positions (used by old ITacticProvider) is no longer available. In fact, the formerly called ITacticProvider2 interface now supersedes this old interface to become the "official" ITacticProvider interface. Implementors of this interface must provide a single method
+
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.
  
List<ITacticApplication> getPossibleApplications(IProofTreeNode node, Predicate hyp, String globalInput);
+
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''.
 +
* '''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''.
  
which gives the list of calculated tactic applications.
+
* '''Identify incoming and outgoing parameters'''.
 +
** Right-click on the ''inFP'' node and add an ''Extension''.
 +
** 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 ''formalIn''.
 +
** Right-click on the ''outFP'' node and add an ''Extension''.
 +
** 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 ''formalOut''.
  
* misspelling in extension org.eventb.ui/proofTactics/tactic#priorty corrected to priority (i was missing)
+
===== A Summary of Steps =====
: the correction must be made in every extension of this point
 
  
== External Plug-ins ==
+
For a Tasking Machine definition:
{{TODO | Describe here the available plug-ins, and the supported versions for this release.}}
+
# Add the Tasking Machine type (Auto etc).
 +
# 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.
  
=== Rodin Update Site ===
 
  
=== B Method Update Site ===
+
For a Shared Machine definition:
*Atelier-B provers 1.2.0 are available for Rodin 2.0 via its update mechanism.
+
# Add the ''SharedMachine'' Machine type.
 +
# For each event, define the Event Type.
 +
# For each event parameter, define the Parameter Type.
  
=== other Updates Sites ===
+
==== Invoking the Translation ====
*AnimB 0.2.0 is now available for the Rodin Platform 2.0. Use the update site <tt>http://www.animb.org/updatesite</tt>.
 
  
== Downloading ==
+
* To create the IL1 model,
{{TODO | Add here a link to download the platform.}}
+
** 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.
  
== Fixed Bugs and Implemented Feature requests ==
+
* 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.
  
  Bug 1737819: WD properties are not fully propagated
+
There are errors in the generated machines (not investigated the cause yet); these can be fixed in the following way.
  Bug 2174629: No PO generated for unrefined event
+
* Open a Machine in the Event-B Machine Editor.
  Bug 2510307: Proof information window empty for grd/WD
+
* Select the Edit tab.
  Bug 2782243: BraveSansMono
+
* Open the REFINES section, the error lies here.
  Bug 2893782: error when building new project with a context
+
* The correct machine is refined, but choose a different machine to refine (any one, it doesn't matter).
  Bug 2964346: RBP: illegal theory directory leads to strange behaviour
+
* Select the original refined machine again.  
  Bug 2964350: RBP allows to generate theory with same name as a context
+
* Save and clean the project, and the error should disappear.  
  Bug 2964359: Rule based prover allows me to define unsound rule
+
* Repeat for the same errors in the other machines; save and clean again.
  Bug 2974863: Camille text editor -  Class cast exception when saving a sm
+
* The machines can viewed as normal using the Rodin editors.
  Bug 2979365: Auto completion in wizards
 
  Bug 2979444: Matching ;
 
  Bug 2989932: SM translation flow-down buttons KO
 
  Bug 2990934: UML-B Cannot add statemachines to refined Class
 
  Bug 2991364: Project explorer jumps to first element
 
  Bug 2995930: unsound simplification
 
  Bug 2996407: NullPointer in Builder
 
  Bug 2997671: Identical SCActions causes static check failure
 
  Bug 2998051: Some spurious spaces are sometime inserted
 
  Bug 2998543: incorrect display on hypothesis window
 
  Bug 2999977: Can not save proof after functional image simplification
 
  Bug 3005211: Spaces between elements in structured editor
 
  Bug 3005226: Copy/Paste in the structured editor
 
  Bug 3005230: Combo boxes in structured editor
 
  Bug 3006807: NPE in FunOvr
 
  Bug 3007475: Plug-in startup not in UI thread
 
  Bug 3008554: Scroll bar does not refresh when adding hypotheses
 
  Bug 3008907: Bad display of instantiation boxes
 
  Bug 3008973: Indexer job still running after shutdown
 
  Bug 3009562: Search Hypothesis pattern
 
  Bug 3010324: Linebreaks not displayed in pretty printer
 
  Bug 3011601: Unexpected Error occurs
 
  Bug 3019062: Error in Context Menu
 
  Bug 3022706: Empty Goal Window on Rodin 1.3.1
 
  Bug 3022881: NPE when recalculating Auto-Status
 
  Bug 3025480: Side effect when commenting an event
 
  Bug 3025754: Spaces in a search prevent to "find"
 
  Bug 3025836: Rodin 1.3.1 prover is still unsound
 
  Bug 3027365: Proof replay resilient to useless rules
 
  Bug 3027428: OnePointRule in post tactics makes proof save crash
 
  Bug 3028473: Rule produced by contrHyps is too weak
 
  Bug 3029910: Failed assertion in newPP
 
  Bug 3049319: Wrong action statement causes SC tool error
 
  Bug 3053075: hypothesis gets deselected unexpectedly
 
  Bug 3056815: interface theorems preferably without INV proof obligations
 
  Bug 3066966: weird translation problems with operation calls
 
  Bug 3076552: Wrong behaviour in the 'new variable wizard' on OSX
 
  
  FR 1469740: Add information on the splash screen
+
[[Category:User documentation]]
  FR 1595966: Sequence types
 
  FR 1737333: Refines button
 
  FR 1793844: Decomposition Support
 
  FR 1793869: Proof Display/PrettyPrint
 
  FR 1828319: Renaming constants and variables
 
  FR 2682114: Having an extra row in "statistics view”
 
  FR 2793244: Make legibility check optional
 
  FR 2932968: (NAVIGATOR) Carrier Sets sb "higher"
 
  FR 2979367: Auto completion in Proof Control
 
  FR 3008636: Display instantiated hyp
 
  FR 3014340: Type rewrite rule for s <: T and API
 
  FR 3021293: Automatic completion in Proving perspective
 
  FR 3046951: how to instantiate quantifiers
 
  FR 3048253: "Refine" and "any" button on the new event wizard 
 
  FR 3051547: inference rules table headings
 
  FR 3051570: translation between Rodin and Event-B Book
 
  FR 3051575: Event-B Books PDFs need refreshing
 
  FR 3051588: Initialization vs Initialisation
 
  FR 3052182: more support to proofs in interfaces
 
  FR 3052261: document rules that are both automatic and manual
 
  FR 3055966: Warning for INITIALIZATION
 
  FR 3067513: interface theorems to be visible to interface users
 
  FR 3067580: option for avoiding duplicated contexts
 
 
 
== Known Issues ==
 
 
 
* The list of the currently open bugs is given below:
 
 
 
  Bug 1441596: Tool conflicts caused by identically named files
 
  Bug 1766826: Error messages from math parser incomprehensible
 
  Bug 1824177: B4free prover translation for <<-> fails
 
  Bug 1841129: Incorrect proof status
 
  Bug 1949927: newPP is too sensitive to unused hyps
 
  Bug 1954442: Too many handles used by Edit page on Windows
 
  Bug 2082375: input file write-protection a problem to Rodin
 
  Bug 2105507: too difficult to work with explicit set expressions
 
  Bug 2371318: Unable to apply equality from left to right
 
  Bug 2531738: RODIN crash adding text to note or text box in class diagram
 
  Bug 2573332: Long formulas get truncated
 
  Bug 2630205: reasoning with "finite" clause
 
  Bug 2817523: No paste in root contextual menu of explorer
 
  Bug 2824204: Change to Rodin Elements not reflected in editor
 
  Bug 2835692: Text Editor exception
 
  Bug 2844786: Invisible icons in Proof Control coolbar
 
  Bug 2844813: Turnstile unicode character
 
  Bug 2869663: Changing the font in the pretty print view
 
  Bug 2871281: Bad display of marked math symbols
 
  Bug 2871290: Comments are still editable in a generated model
 
  Bug 2882318: Error while entering symbol from symbol table
 
  Bug 2883199: Fix "new" actions
 
  Bug 2886026: "Overflow" in partition rewriting
 
  Bug 2894645: Error on context named "axioms"
 
  Bug 2900427: Problems parsing complex expressions
 
  Bug 2916134: Atelier-B PP does not understand S /= {}
 
  Bug 2931450: editor extension - clause names defined in wrong element
 
  Bug 2934585: animB : impossible to start animation
 
  Bug 2937124: Symbol Table and Properties
 
  Bug 2937132: newPP unresponsive
 
  Bug 2940315: mod operator should be compatible with itself
 
  Bug 2940575: some fomulas are truncated
 
  Bug 2941496: NewPP outputs incorrect set of required Hypotheses
 
  Bug 2942182: unparsing then parsing gives a different expression
 
  Bug 2949652: Event-B editor doesn't refresh
 
  Bug 2952091: newPP is unsound
 
  Bug 2952134: conversion to mathematical symbols generates trailing spaces
 
  Bug 2952645: Unable to parse ||
 
  Bug 2952705: Progress bar running too fast
 
  Bug 2952758: Highlighting of bound variables
 
  Bug 2957980: Proof Skeleton View : \n displayed as squares
 
  Bug 2958877: {1 | true} --> Error Running Tool
 
  Bug 2968560: Dependence of Explorer & eventb.ui
 
  Bug 2974867: Camille text editor -  doesn't allow non alphanumeric chars
 
  Bug 2987749: Axioms in classtypes not quantified
 
  Bug 2988294: Nested elaborated transitions produce conflicting actions
 
  Bug 2997510: undo behaviour
 
  Bug 3003164: NPE when loading a PO
 
  Bug 3005167: Inherited elements
 
  Bug 3005170: Becomes such that
 
  Bug 3005202: Renaming and provers
 
  Bug 3005204: Cumbersome popup
 
  Bug 3006903: Rename Bug
 
  Bug 3007792: Theorems in Guards - Syntax Error
 
  Bug 3007793: Issue with refines clauses of events
 
  Bug 3009555: Search Hypothesis refresh
 
  Bug 3009838: Order of variables and invariants not preserved
 
  Bug 3014775: partition operator is not accepted by Camille
 
  Bug 3019063: Error on Double Click
 
  Bug 3020776: Issue with indentation
 
  Bug 3022742: Problem with Software Sites
 
  Bug 3024811: Leaks in Event-B Explorer
 
  Bug 3027387: Proof simplification does not remove useless rules
 
  Bug 3048530: New Event Wizard :: NAT[tab]
 
  Bug 3052238: Saving failed caused by AssertionError in rebuild
 
  Bug 3053410: type mismatch in an operation call observed too late
 
  Bug 3054228: Proof simplification too slow
 
  Bug 3058915: insufficiency in proof obligation generation
 
  Bug 3061858: invariant violated but all proof obligations discharged
 
  Bug 3067672: unfair requests for witnesses
 
  Bug 3073433: implicit actions needed but not generated
 
  Bug 3074011: a namespace-sensitive translation problem
 
  Bug 3075420: Unable to save project after renaming invariants
 
  Bug 3078116: Rule DERIV_SUBSETEQ_SETMINUS_L automatic
 
  Bug 3080950: Incorrect display of <<->  <->> <<->> and <+  in the editor
 
 
 
[[Category:Rodin Platform Release Notes]]
 

Revision as of 15:39, 27 April 2011

THIS PAGE IS UNDER CONSTRUCTION !!!!!!

For more information contact Andy Edmunds - University of Southampton - mailto:ae2@ecs.soton.ac.uk

Tasking Event-B Tutorial Overview

This code generation tutorial supplements the Heating Controller tutorial example, and makes use of example projects from the download site. The code generation stage produces implementable Ada code, and also an Event-B project which models the implementation. The Ada code is produced using a pretty printer tool from an intermediate model, the Common Language model (IL1), generated by a translation tool. An overview of Tasking Event-B can be found on the Tasking_Event-B_Overview page.

The Heating Controller development has been refined to the point where we wish to add implementation constructs. 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 example/tutorial projects are,

HeatingController20110429Demo An example project with a completed Tasking Development and IL1 model (post IL1 translation, but before Event-B translation).
HeatingController20110429Tasking 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.
HeatingController20110429Tutorial A bare project for step 1 of the tutorial.
HeatingController20110429Tutorial2 A partially completed tasking development for steps 2 and 3 of the tutorial.

Preliminaries

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 .

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.

  • Open the HeatingController20110429Demo Project and switch to the Resource Perspective.
  • Open the .tasking model and inspect it. Clicking on the Main, Machine or Event nodes updates the pretty print window.

Viewing Source Code

aka. The PrettyPrint View of an IL1 Model.

To view Ada source code,

  • from the top-menu select Window/Show View/Other/IL1 Pretty Printer.
  • Open the HeatingController20110429Demo 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

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

The steps needed to generate code from an Event-B model, in this tutorial, are as follows,

Creating The Tasking Development

  • Change to the Event-B Perspective.
  • Open the HeatingController20110429Tutorial Project.
  • Select the following Machines: Display_Update_Task1, Envir1, Heater_Monitor_Task1, Shared_Object1, Temp_Ctrl_Task1 and HC_CONTEXT.
  • 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.

Change to the Project HeatingController20110429Tutorial2 to begin the next step.

Providing the Annotations for Implementations

  • Close any Tasking Pretty Print Viewers that remain open. The incomplete model will give rise to exceptions.
  • Go to the to the Resource Perspective.
  • Open and inspect the .tasking machine.

The WriterTsk and SharedObj machines are incomplete. We will take the steps to necessary to provide implementation details.

The WriterTsk Machine

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.
    • Expand the Auto Task Machine node.
    • 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 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.

  • 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.
    • Right-click on the outAP node and add an Extension.
    • Right-click on the Extension and selectNew Child/Parameter Type.
    • Go to the Parameter Type properties view and set the Parameter Type property to actualOut.
    • Right-click on the inAP node and add an Extension.
    • Right-click on the Extension and selectNew 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.

  • 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.
    • Right-click on the inFP node and add an Extension.
    • Right-click on the Extension and selectNew Child/Parameter Type.
    • Go to the Parameter Type properties view and set the Parameter Type property to formalIn.
    • Right-click on the outFP node and add an Extension.
    • Right-click on the Extension and selectNew Child/Parameter Type.
    • Go to the Parameter Type properties view and set the Parameter Type property to formalOut.
A Summary of Steps

For a Tasking Machine definition:

  1. Add the Tasking Machine type (Auto etc).
  2. Add the task type (Periodic etc.).
  3. Define the task priority.
  4. Define the task body.
  5. For each event, add the Event Type.
  6. For each event parameter, add the Parameter Type.


For a Shared Machine definition:

  1. Add the SharedMachine Machine type.
  2. For each event, define the Event Type.
  3. 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.