A Simulation Framework for the Validation of Event-B Specifications Faqing Yang
Total Page:16
File Type:pdf, Size:1020Kb
A Simulation Framework for the Validation of Event-B Specifications Faqing Yang To cite this version: Faqing Yang. A Simulation Framework for the Validation of Event-B Specifications. Formal Languages and Automata Theory [cs.FL]. Université de Lorraine, 2013. English. NNT : 2013LORR0158. tel- 01750224v2 HAL Id: tel-01750224 https://tel.archives-ouvertes.fr/tel-01750224v2 Submitted on 25 Feb 2014 HAL is a multi-disciplinary open access L’archive ouverte pluridisciplinaire HAL, est archive for the deposit and dissemination of sci- destinée au dépôt et à la diffusion de documents entific research documents, whether they are pub- scientifiques de niveau recherche, publiés ou non, lished or not. The documents may come from émanant des établissements d’enseignement et de teaching and research institutions in France or recherche français ou étrangers, des laboratoires abroad, or from public or private research centers. publics ou privés. AVERTISSEMENT Ce document est le fruit d'un long travail approuvé par le jury de soutenance et mis à disposition de l'ensemble de la communauté universitaire élargie. Il est soumis à la propriété intellectuelle de l'auteur. Ceci implique une obligation de citation et de référencement lors de l’utilisation de ce document. D'autre part, toute contrefaçon, plagiat, reproduction illicite encourt une poursuite pénale. Contact : [email protected] LIENS Code de la Propriété Intellectuelle. articles L 122. 4 Code de la Propriété Intellectuelle. articles L 335.2- L 335.10 http://www.cfcopies.com/V2/leg/leg_droi.php http://www.culture.gouv.fr/culture/infos-pratiques/droits/protection.htm École Doctorale IAEM Lorraine DFD en informatique ——————————————————————————————————— Un environnement de simulation pour la validation de spécifications B événementiel THÈSE présentée et soutenue publiquement le 29 Novembre 2013 pour l’obtention du Doctorat de l’Université de Lorraine (Spécialité : informatique) par Faqing YANG Composition du jury Rapporteurs : Michael LEUSCHEL Professeur, Université de Düsseldorf, Allemagne Catherine DUBOIS Professeur, ENSIIE, Evry Examinateurs : Pascale LE GALL Professeur, Ecole Centrale, Paris Stephan MERZ Directeur de recherche, INRIA, Nancy Directeurs de thèse : Jeanine SOUQUIÈRES Professeur, Université de Lorraine, Nancy, LORIA Jean-Pierre JACQUOT Maître de conférences, Université de Lorraine, Nancy, LORIA ——————————————————————————————————— UMR 7503 Laboratoire Lorrain de Recherche en Informatique et ses Applications Acknowledgments ——————————————————————————————————— Foremost, I would like to express my sincere gratitude to my advisor Prof. Jeanine Souquières and my co-advisor Dr. Jean-Pierre Jacquot for the continuous support during my Ph.D. study and research, for their patience, motivation, enthusiasm, and immense knowledge. Without their guidance, I cannot imagine to successfully achieve my research goals. I would also like to thank their helps in my life, especially in a foreign country. I would always remember them as the best advisors and the mentors for the lifetime. Furthermore, I would like to thank the rest of my thesis committee : Prof. Michael Leuschel, Prof. Catherine Dubois, Prof. Pascale Le Gall, and Dr. Stephan Merz, for their participation, insightful comments, and constructive criticism. In addition, I am indebted to the colleagues from MAIA and TRIO teams at LORIA with special thanks to Dr. Alexis Scheuer for his development of the 2D platooning mathematical model. I would like to especially dedicate this thesis to my family, for their love, support, patience, and understanding. They allowed me to spend most of the time on this thesis. Last, but certainly not least, I am thankful to my friends, for all the moral encouragement and support. Contents 1 Introduction 1 1.1 Motivation ................................. 1 1.1.1 Research Context ......................... 1 1.1.2 Scientific Problem ........................ 2 1.1.3 Technical Problems ........................ 2 1.1.4 Objectives ............................. 3 1.2 Contributions ............................... 3 1.3 Case Studies ................................ 4 1.4 Publications ................................ 4 1.5 Thesis Outline ............................... 6 2 State of the Art 7 2.1 Introduction ................................ 7 2.2 Development Process ........................... 8 2.2.1 Construction Activities ...................... 9 2.2.2 Verification and Validation Activities . 10 2.2.3 Other Activities .......................... 11 2.2.4 Some Process Models ...................... 11 2.3 Formal Methods .............................. 13 2.3.1 Formal Specification ....................... 13 2.3.2 Formal Verification ........................ 14 2.3.3 Code Generation ......................... 14 2.4 B Method ................................. 14 2.4.1 Overview ............................. 14 2.4.2 Presentation of Event-B ..................... 15 2.4.3 Rodin Platform .......................... 18 2.5 Animation of Event-B Models ...................... 20 2.5.1 Animation Difficulties ...................... 20 2.5.2 Event-B Animators ........................ 20 2.5.3 Multi-level Animation of Refinement . 22 2.6 Platooning Models ............................ 23 2.6.1 Platooning Problem ........................ 23 2.6.2 1D Platooning Models ...................... 24 2.6.3 2D Platooning Model ....................... 25 2.7 Summary ................................. 27 i ii CONTENTS I Assessment of Event-B Usability 29 3 Analysis of the 1D Platooning Model 31 3.1 Introduction ................................ 31 3.2 Proofs ................................... 32 3.2.1 Interactive Proof ......................... 32 3.2.2 False Statement .......................... 33 3.2.3 Unprovable Goal ......................... 34 3.3 Non-Collision Property .......................... 36 3.3.1 Machine platoon0 ......................... 36 3.3.2 Machine platoon1 ......................... 37 3.3.3 Machine platoon2 ......................... 37 3.3.4 Machine platoon3 and platoon4 . 38 3.4 Summary ................................. 38 4 Automatic Generation of DLF Theorems 39 4.1 Introduction ................................ 39 4.2 Deadlock-Freeness Rule ......................... 40 4.2.1 Deadlock-Freeness of Complete Model . 40 4.2.2 Deadlock-Freeness of a Subset of Events . 40 4.3 Exigence of a Tool ............................ 41 4.4 Implementation Issue ........................... 42 4.5 Usage ................................... 42 4.6 Summary ................................. 43 5 Scaling Up with Event-B 45 5.1 Introduction ................................ 45 5.2 Model Structure .............................. 46 5.2.1 Decomposition of Events ..................... 46 5.2.2 Increase in Complexity ...................... 48 5.3 Physical and Mathematical Equations . 48 5.3.1 1D Equation Adaptation ..................... 48 5.3.2 2D Equation Adaptation ..................... 49 5.4 Temporal Properties ............................ 50 5.5 Adaptation of Tools ............................ 51 5.5.1 Edition .............................. 52 5.5.2 Verification ............................ 52 5.5.3 Validation ............................. 52 5.6 Summary ................................. 53 II JavaScript Simulation Framework for Event-B 55 6 JeB Design 57 6.1 Introduction ................................ 57 6.2 Requirements for a Simulation Generator . 58 6.3 Architecture of the Simulation Framework . 60 CONTENTS iii 6.4 Implementation Choices ......................... 61 6.5 Translation Strategies ........................... 62 6.5.1 Annotations vs. Set Library ................... 62 6.5.2 Interfaces for User Hand-coded Functions . 63 6.5.3 Invariant, Witness and Variant . 63 6.5.4 Quantified Formulas ....................... 64 6.6 Summary ................................. 64 7 JeB Implementation 65 7.1 Introduction ................................ 66 7.2 Namespace ................................ 66 7.3 Translation of Contexts .......................... 67 7.3.1 Sets and Constants ........................ 68 7.3.2 Axioms .............................. 68 7.3.3 Constant Checker ......................... 68 7.4 Translation of Machines ......................... 68 7.4.1 Variables ............................. 69 7.4.2 Invariants ............................. 70 7.4.3 Events ............................... 70 7.4.4 Event Parameters ......................... 71 7.4.5 Event Guards ........................... 72 7.4.6 Event Actions ........................... 73 7.4.7 User Interface ........................... 74 7.5 Translation of Formulas .......................... 75 7.5.1 Predicates ............................. 75 7.5.2 Expressions ............................ 76 7.5.3 Assignments ........................... 78 7.6 Interpretation of Translated Formulas . 79 7.7 Simulation Control ............................ 79 7.7.1 Simulation Scheduler ....................... 79 7.7.2 Parameters of a Simulation .................... 80 7.7.3 Scenario Controller ........................ 80 7.7.4 Animator ............................. 80 7.8 Event-B Project Diagram ......................... 81 7.9 Summary ................................. 81 8 JeB Utilization and Analysis of Simulations 83 8.1 Introduction ................................ 83 8.2 Simulation of the 1D Platooning ..................... 84 8.2.1 Minimal Simulation ....................... 84 8.2.2 Graphic Display ......................... 86 8.2.3 Simulation of the Refinements . 86 8.3