Showing posts with label event-B. Show all posts
Showing posts with label event-B. Show all posts

Sunday, January 7, 2018

Lectures of Jean-Raymond Abrial on B, Event-B, Rodin (vidéos)

Lecture 1

 https://www.youtube.com/watch?v=2GP1pJINVT4

Lecture 2

https://www.youtube.com/watch?v=M8nvVaZ74wA

Lecture 3

https://www.youtube.com/watch?v=Y5OUtq8cdV8 

Mini-course around Event-B and Rodin


Developping sequential programs


https://www.youtube.com/watch?v=C0tpgPOKAyg

This lecture gives a status report of the hypervisor we are developing using Event-B.

https://www.youtube.com/watch?v=i-GKHZAWWjU

Verification Corner, Modeling, refinement, and verification


In this episode of Verification Corner, Jean-Raymond Abrial and Rustan Leino show how to do a design starting from a model that is gradually refined toward executable code. They use the Rodin tool, which supports the Event-B formalism.

Saturday, June 4, 2016

An Incremental B-Model for RBAC-Controlled Electronic Marking System


Nasser Al-hadhrami (Ministry of Education, Nizwa, Oman), Benjamin Aziz (School of Computing, University of Portsmouth, Portsmouth, UK) and Lotfi ben Othmane (Fraunhofer Institute for Secure Information Technology, Darmstadt, Germany)

Modelling and Refining Hybrid Systems in Event-B and Rodin

Sunday, March 27, 2016

B événementiel, l'île et le pont de J.R. Abrial

Source : Présentation de J.R. Abrial (Janvier 2000) 
  
Le contrôleur du pont de l'île 
Le principe : le saut en parachute. 


Plus on s'approche du sol, plus on voit de choses, plus on voit d'événements.
Première vue du système (ou modèle initial) 
Quelles sont les données ? 
On a une seule variable, n, le nombre de véhicules qui sont dans le système. 
De plus, le nombre maximum de véhicules que peut contenir le système est constant (d) 
La contrainte à satisfaire est : 
0 <= n <= d
La forme générale d'un événement pour cette présentation 
  
==
    WHEN
       < garde>
    THEN
    < action>
    END

On a deux événements 
Sortie du continent vers le système 
  
ML_OUT ==
    WHEN
        n < d
    THEN
        n := n+ 1
    END

Entrée sur le continent 
  
ML_IN ==
    WHEN
        n > 0
    THEN
        n := n - 1
    END

Les obligations de preuve 
1) La préservation de l'invariant 
  
Etant donné un événement de forme générale : EVENT ==
    WHEN
        G(x)
    THEN
        x := E(x)
    END
et un invariant I(x) à préserver, il faut prouver que :
I(x) & G(x) => I(E(x))

Soit dans notre cas 
pour l'événement ML_OUT 
0 <= n <= d & n 0 <= n + 1 <= d 
pour l'événement ML-IN 
0 <= n <= d & n 0 <= n - 1 <= d 
2) Preuve de vivacité (liveness) 
  
 Etant donné un système d'événements avec les gardes :
G1 (x), ..., Gn (x) et un invariant I(x), l'énoncé à prouver est :
I(x) => G1(x) or ...or Gn(x)
i.e. un événement au moins est toujours prêt à être déclenché (ABSENCE DE VERROU FATAL)

Soit ici : 
0 <= n <= d => 0 < n or n < d 
Ce que l'on ne peut prouver ! 
Quand n = 0, on ne peut prouver n < d 
On a oublié 0 < d 
Il y a un deadlock si d = O (plus aucune voiture ne peut entrer). 
On corrige donc et alors on peut prouver que : 
  
0 <= n <= d  & 0 < d => 0 < n or n < d 
3) Preuve d'absence de sous-boucles infinies 
Pour chaque événement (dans le cas de deux événements seulement) : 
  
EVENT ==
    WHEN G(x) THEN x := E(x) END Il faut prouver, étant donné un invariant I(x) :
I(x) => 0 <= V(x) &
I(x) & G(x) =< V (E(x)) < V(x)
où V(x) est un variant à exhiber pour chaque événement.

Soit ici 
Pour ML_OUT, un variant est d - n 
0 <= n <= d & 0 < d => 0 <= d - n 
0 <= n <= d & 0 < d & n < d 
=> 
d - (n + 1) < d - n 
Pour ML_IN, un variant est n 
0 <= n <= d & 0 < d => 0 <= n 
0 <= n <= d & 0 < d & n < d 
=> 
n -1 <  n 
Deuxième vue du système , raffinage par introduction du pont 
On est descendu  et on aperçoit maintenant le pont. 
On voit : 
  
- des véhicules sur le pont qui se dirigent vers l'île (un nombre n)
- des véhicules qui sont dans l'île (un nombre b)
- des véhicules qui se dirigent vers le contenant (un nombre c)
L'invariant 
  
0 <= a &
0 <= b &
0 <= c &
a = 0 or c = 0 /* tous les véhicules vont dans la même direction */

Invariant de collage 
  
a + b + c = n

Les techniques de raffinage : 
  
1) Chaque événement est raffiné par un événement concret 2) Le monde abstrait travaille avec x et le concret avec y
3) Un invariant de collage I(x, y) lie les deux mondes

Les mécanismes de raffinage sont : 
  
- le renforcement des gardes (normal, plus on voit de choses en s'approchant du sol, plus on voit de contraintes. C'est bien connu, quand on est "haut placé" on est en dehors des contingences matérielles...voilà sans doute pourquoi certains recherchent ces places...dans les amphis (?!))     Rappel : en ce qui concerne les préconditions, on les affaiblit lors du raffinage.
- des actions "simultanées" sur l'invariant de collage.

Dans notre cas, 
1) Raffinage de l'événement abstrait 
ML_OUT == WHEN n < d THEN n := n + 1 END 
en : 
ML_OUT == 
    WHEN 
        a + b + c < d & c = 0  /* On a renforcé la garde */ 
    THEN 
        a := a + 1 
    END 
Raffinage de l'autre événement abstrait : 
ML_IN == 
    WHEN 
        n > 0 
    THEN 
        n := n + 1 
    END 
en : 
ML_IN == 
        WHEN 
            c > 0 
        THEN 
            c := c - 1 
        END 
2) Spécification des nouveaux événements 
IL_IN == 
    WHEN 
        a > 0 
    THEN 
        a, b := a - 1, b + 1 
    END 
IL_OUT == 
    WHEN 
        b > 0 & 
        a = 0 
    THEN 
        b, c := b - c, c + 1 
    END 
Les obligations de preuve du raffinage d'événement 
  
Etant donné un événement abstrait  et un événement concret correspondant EVENT == WHEN G(x) THEN x := E(x) END
EVENT == WHEN H(y) THEN y := F(y) END
et les invariant I(x) (supposé être déjà préservé par l'événement abstrait) et J(x, y),
I(x) & J(x, y) & H(y) => G(x)
I(x) & J(x, y) & H(y) => J(E(x), F(y))

... 
à vous maintenant d'appliquer cela... 
Les niveaux suivants seront : 
1) Introduction de deux feux de circulation à chaque entrée du pont 
2) Introduction de capteurs  (il faut bien compter les véhicules pour vérifier l'invariant fourni au premier niveau) à l'entrée et à la sortie du pont 
Puis introduction du contrôleur qui : 
  
- décide quand les feux doivent changer
- n'a pas accès aux variables physiques
- a accès à des variables de contrôle
- qui sont des copies de variables physiques

    - qui représentent ce que le contrôleur croit de la situation physique 
    - dont les valeurs peuvent être différentes de celles des variables physiques 
            mais néanmoins le système doit fonctionner correctement comme celà est prescrit par les vairiables physiques 
- conservées en mémoire du contrôleur 
3) Introduction des canaux de communication 
        - entre le monde physique et le contrôleur (annonce de l'arrivée ou du départ d'un véhicule) 
        - entre le contrôleur et le monde physique (pour faire changer) 
Des hypothèses temporelles doivent être faites (par exemple que les capteurs physiques sont moins réactifs que les autres événements) 
4) Réunion des variables physiques et des variables canaux pour former une seule entité, l'environnement fait de : 
        - des variables physiques et des variables canaux 
        - tous les événements physiques 
        - deux services d'entrée/sortie

Sunday, March 6, 2016

Code Generation for Event-B

http://arxiv.org/pdf/1602.02004.pdf

Universidade da Madeira Centro de Ciencias Exactas e da Engenharia 
PhD THESIS presented in fulfilment of the requirement for the degree of Doctor of Philosophy 

Major: Software Engineering 

Code Generation for Event-B 
presented by V´ICTOR ALFONSO RIVERA ZU´ NIGA ˜ 

supervised by NESTOR CATA ´ NO COLLAZOS ˜ June 2014 

Abstract Stepwise refinement and Design-by-Contract are two formal approaches for modelling systems. These approaches are widely used in the development of systems. Both approaches have (dis-)advantages: in stepwise refinement a model starts with an abstraction of the system and more details are added through refinements. Each refinement must be provably consistent with the previous one. Hence, reasoning about abstract models is possible. A high level of expertise is necessary in mathematics to have a good command of the underlying languages, techniques and tools, making this approach less popular. Design-by-Contract, on the other hand, works on the program rather than the program model, so developers in the software industry are more likely to have expertise in it. However, the benefit of reasoning over more abstract models is lost. A question arises: is it possible to combine both approaches in the development of systems, providing the user with the benefits of both? This thesis answers this question by translating the stepwise refinement method with EventB to Design-by-Contract with Java and JML, so users can take full advantage of both formal approaches without losing their benefits. This thesis presents a set of syntactic rules that translates Event-B to JML-annotated Java code. It also presents the implementation of the syntactic rules as the EventB2Java tool. We used EventB2Java to translate several Event-B models. The tool generated JML-annotated Java code for all the considered Event-B models that serve as final implementation. We also used EventB2Java for the development of two software applications. Additionally, we compared EventB2Java against two other tools that also generate Java code from Event-B models. EventB2- Java enables users to start the software development process in Event-B, where users can model the system and prove its consistency, to then transition to JML-annotated Java code, where users can continue the development process. Key Words— Modelling system by stepwise refinement, Event-B, Designby-Contract, Java, JML, EventB2Java

Wednesday, June 17, 2015

Conférence de J-R Abrial au Collège de France, avril 2015

 http://www.college-de-france.fr/site/gerard-berry/seminar-2015-04-01-17h30.htm

Spécification, construction et vérification de programmes : le parcours d'une pensée scientifique sur une trentaine d'années

Saturday, December 14, 2013

Event-B patterns and their tool support

Software & Systems ModelingVolume 12Issue 2pp 229-244Event-B patterns and their tool support

Monday, November 11, 2013

EB2ALL - The Event-B To C, C++, Java And C# Code Generator

http://eb2all.loria.fr/

"EB2ALL is a set of translator tools that automatically generates efficient target programming language code (C, C++, Java and C#) from Event-B formal specification related to the analysis of the complex problems. The EB2ALL contains four plugin namely EB2C, EB2C++, EB2J and EBC#. The goal of EB2ALL is to be able to generate a verified source code that satisfies behavioral properties of the develop formal system (abstractly). The EB2ALL tool is developed as a set of plugins for RODIN development tool under the Eclipse framework. RODIN is an integrated development environment (IDE) for developing Event-B models. The RODIN tool is written entirely in Java and build on top of the Eclipse platform."

Friday, April 30, 2010

Jean-Raymond Abrial, conference in Nantes on June 7, 2010

Jean-Raymond Abrial is invited for the 2010 conference.  The new book of J.R. Abrial will be available for the conference.

Contents

Prologue: faultless systems – yes we can!; Acknowledgements; 1. Introduction; 2. Controlling cars on a bridge; 3. A mechanical press controller; 4. A simple file transfer protocol; 5. The Event-B modeling notation and proof obligations rules; 6. Bounded re-transmission protocol; 7. Development of a concurrent program; 8. Development of electronic circuits; 9. Mathematical language; 10. Leader election on a ring-shaped network; 11. Synchronizing a tree-shaped network; 12. Routing algorithm for a mobile agent; 13. Leader election on a connected graph network; 14. Mathematical models for proof obligations; 15. Development of sequential programs; 16. A location access controller; 17. Train system; 18. Problems; Index.

Wednesday, November 25, 2009

Event-B and Rodin Documentation Wiki

http://wiki.event-b.org/index.php/Main_Page

This is the documentation wiki for the Event-b.org site providing documentation for users and developers of the Rodin toolset.
Event-B is a formal method for system-level modelling and analysis. Key features of Event-B are the use of set theory as a modelling notation, the use of refinement to represent systems at different abstraction levels and the use of mathematical proof to verify consistency between refinement levels.
The Rodin Platform is an Eclipse-based IDE for Event-B that provides effective support for refinement and mathematical proof. The platform is open source, contributes to the Eclipse framework and is further extendable with plugins.