D23 TEXT

From Event-B
Revision as of 09:43, 27 November 2009 by imported>Jastram
Jump to navigationJump to search

Overview

This part of the deliverable describes improvement of the ProB animation and model checking plugin.

Motivations

This paragraph shall express the motivation for each tool extension and improvement. More precisely, it shall first indicate the state before the work, the encountered difficulties, and shall highlight the requirements (eg. those of industrial partners). Then, it shall summarize how these requirements are addressed and what are the main benefits.

A number of frameworks for text editors are available, but EMF ((Eclipse Modeling Framework Project) ) was quickly identified as the target candidate, in combination with TEF (Textual Editing Framework), which is based on EMF. The framework seamlessly integrates into Eclipse. It is already proven within Rodin, as it is the foundation of UML-B. It is extensible - contributors of other plug-ins will be able to extend the text editor as well. And last, a proof-of-concept prototype had been put together very quickly.

Rodin has done away with a textual representation of the formal models. Indeed, events, theorems, axioms, etc. are stored in the Rodin database, and there is no classical text file for editing the models. The models are directly manipulated by a structural form-based editor. During the lifetime of the Rodin and Deploy projects it became increasingly apparent that the current structural editor was not able to cope with industrial needs. Functions that are taken for granted in an editor - copy & paste, undo or printing, just to name a few - were missing or only partially functional.

As an Event-B model consists of text, users were requesting a text editor, which would allow them to apply their already present editing skills. As text editing is a well-understood problem, a variety of frameworks were available for implementing one. These frameworks typically provide a wide range of standard features "for free", and typically provide extension points for extendability with additional features. The development team selected the Eclipse Modeling Framework (EMF), for the reasons outlined below.

The wide adaption of the text editor confirms that good decisions have been made. Besides standard text editing features as cut & paste, unlimited undo and redo, line numbering and many more, many Rodin-specific features had been implemented. The text editor supports syntax and semantic highlighting, code completion, templates, an outline view, quick navigation and many more.

Choices / Decisions

This paragraph shall summarize the decisions (eg. design decisions) and justify them. Thus, it may present the studied solutions, through their main advantages and inconvenients, to legitimate the final choices.


One important design consideration was to be able to re-use the Rodin formula syntax and parser. This was deemed vital for keeping up with future evolutions of the platform, e.g., the mathematical extensions will introduce new operators. As such, the grammar had to be carefully designed to be able to parse the structure of an Event-B model independently of the content of the predicates, expressions and actions. In other words, the structural parser detects the structure of the model and sends the formula content to the Rodin parser.

There is a very important limitation of the editor; while it can cope with changes of the mathematical language, it is not able to automatically deal with changes to the model’s structure. If we need to add information to the structure of a model itself, such as information on decomposition or flows it is necessary to modify the parser’s grammar and recompile it. There is to our best knowledge only one tool for the Eclipse framework that allows modification of the grammar during runtime. In theory, the features of TEF perfectly fit our needs and indeed Alexei Iliasov developed in 2008 a prototype based on TEF. However there were a number of things that convinced us to not use it. First of all, the framework is releases under the Gnu Public License which is legally not compatible with the Eclipse Public License used in Rodin. Second, the parser RunCC used in TEF has some issues related to handling parse errors. Because the project did not make progress for three years it is very unlikely that these problems will be fixed by the creators of the parser. Extending RunCC could solve this problem but it does not seem to be feasible without major effort and resources. The grammar used to generate Camille’s parser is close to EBNF, so we think it is not too difficult for plug-in developers to contribute to the grammar but one has to be careful to not restrict the current language, i.e., we can only add optional syntax elements to the grammar, otherwise we break older models. However, this does not mean, that we cannot have new mandatory elements, it only means that it has to be checked by the underlying model instead of the parser. We also considered the BE4 Framework as well as Eclipse XText

The most challenging technical part was the synchronisation with the Rodin database, particularly in the presence of other tools concurrently manipulating the same model. To achieve this we created a new abstraction of the Rodin database as an EMF (Eclipse Modeling Framework Project) data model. It allows us to work with Event-B models independently of the persistence strategy. In addition we can use EMF standard technologies for manipulating, comparing and merging of Event-B models.

Available Documentation

Online Documentation

Text Editor Wiki Page

EBNF Syntax for the Textual Representation

Papers

WS-TBFM Submission

Planning

This paragraph shall give a timeline and current status (as of 29 Jan 2010).