D23 Flow Plug-in

From Event-B
Jump to navigationJump to search


Event-B, being an event systems formalism, does not have a mechanism to explicitly define event ordering. Although event guards may express any desired event ordering, the ability to have a summary of possible event flows in a concise and compact form is useful for many tasks, for example, code generation and connecting with other formalisms. The flows plug-in addresses one aspect of event ordering: it allows a modeller to specify and prove that a given sequence of events does not contradict a given machine specification. More precisely, if we were to execute a machine step-by-step following our prescribed sequence of events we would not discover divergences and deadlocks not already present in the original machine. In other words, the constraint on event ordering must be such that the overall specification is an Event-B refinement of the original model. Importantly, this means that all the desired model properties proved before are preserved.

Sequential composition of events may be expressed in a number of ways:

  • Event immediately follows another event; no other events may take place between the composed events.
  • Event eventually follows an event; thus, although there is an interference from other events, it is guaranteed that the second is eventually enabled.
  • Event may follow an event; this is the weakest form of connection when we only say that it may be the case that the second event follows the first event; it may happen, however, that some other event interferes and the second event is delayed or is even not enabled ever.

Although the last case may seem the least appealing, it is the one that forms the basis of the Flows plug-in. The primary reason to offer such a weak guarantee is proof effort required for stronger types of connectives.


There are a number of reasons to consider an extension of Event-B with an event ordering mechanism:

  • For some problems the information about event ordering is an essential part of requirements; it comes as a natural expectation to be able to adequately reproduce these in a model.
  • Explicit control flow may help in proving properties related to event ordering.
  • Sequential code generation requires some form of control flow information.
  • Since event ordering could restrict the non-determinism in event selection, model checking is likely to be more efficient for a composition of a machine with event ordering information.
  • A potential for a visual presentation based on control flow information.
  • Bridging the gap between high-level workflow and architectural languages, and Event-B.

It is also hoped that the plug-in would improve readability of larger models: currently they are simply a long list of events with nothing except comments to provide any structuring clues.

Choices / Decisions

The primary functionality of the plug-in is the generation of additional proof obligations. Rodin model builder automatically invokes the static checker and the proof obligations generator of the plug-in and the proof obligations related to flow appear in the list of the model proof obligations.

One of the lessons learned with an initial plug-in prototype was that a CSP-like language notation is not the best way to express event ordering as not all users are familiar with process algebraic notations. It was decided to use graphical editor to allow a visual layout of flow diagrams. This, in our view, is a more intuitive way of specifying event ordering. To realise this, we have relied on GMF - an Eclipse library to manipulate EMF models using graphical editors.

Available Documentation

There is a wiki page summarising proof obligation involved in proving machine/flow consistency.


The plug-in is available since the release 1.2 of the platform.