Chapter 3 Formal Framework
Total Page:16
File Type:pdf, Size:1020Kb
En vue de l’obt ention du DOCTORAT DE L’UNIVERSITÉ DE TOULOUSE Délivré par : Discipline ou spécialité : Présentée et soutenue par : le : Titre : JURY Ecole doctorale : Unité de recherche : Directeur(s) de Thèse : Rapporteurs : ♦ Her story all over ♦ There@ will be time, there will be@ time, to prepare a face to meet the faces that you meet, there will be time to murder and create and time for all the works and days of hands, that lift and drop a question on your plate, time for you and time for me and time yet for a hundred indecisions and for a hundred visions and revisions, before the taking of a toast and tea. – T.S. Eliot– iii iv Acknowledgements September 15th, 1991 was my first day at school and December 11th, 2012 is the date of my PhD defense. During these 21 years, I have met many persons who walked beside me and helped me along my way. I have done my best in this work. However, it would not have been possible without the kind support and help of many individuals. I would like to thanks all of them. First of all, I would like to thank my supervisor, Dr. Silvano Dal Zilio. Without his help, his guideness and his experience, this thesis will never have an end. During these 3 years, he was always available to answer my questions despite his commitments, to encourage me and to put me in the right path. I do not only consider him as my supervisor in work, but also as a friend. He helped me and gave me advices when I had difficult moments. It has been an honor to work with him. I extend my thanks to Dr. Didier Le Botlan, whose pedagogy and knowledge in formal proofs make me love this field and have a critical point of view. He encourages me and supports me to make my first steps in this critical domain. Despite of his commitments, he was all the time available to discuss with me and to give me advices. I found in him the right balance between humain character and competence of work. I would like to thank Dr. François Vernadat and Dr. Bernard Berthomieu. Their experience and knowledge were fundamental to accomplish this thesis and allowed me to achieve many of my goals. Both of them was for me an example to follow. Dr. Berthomieu has helped me in resolving many problems. I am impressed by his organisation in his work. Dr. Vernadat was for me a good example to follow. I am very impressed by his wisdom to treat problems. I would like also to thank Dr. Françoise Simonot-Lion, Dr. Olivier H.Roux, Dr. Yamine Ait Ameur and Odile Laurent for having reviewed this work. This thesis and its pages will be seen as an acknowledgement to the thousands of you who have helped me to make my life what is today. Nahla my sister... I want just to say “THANK YOU” for all things you give me. I would not have considered never to enroll me into a Doctorate program before you encouraged me and helped me in choosing my way. You were and you are still my example for life. I’m so proud of you! My parents Fatma & Mohamed, my brother Houssem... Thank you for the support you provided me through my entire life. Without your love and encouragements I would not have finished this thesis. Cosi... Thank you for all the encouragements you give me. You were all the time helping me. We have shared many moments that I will never forget. You are a great person. Thank you for all! I am indebted to many of my colleagues who supported me during these last three years. I will never forget our discussions about different subjects. Thank you for all things. These moments I spent with all of you were crucial to my personal and professional development. It was great to share experiences and knowledges with interesting people like you. Last, I express my regards and gratitude to all of those who supported me in any aspect during the completion of this thesis. Abstract The formal verification of critical, reactive systems is a very complicated task, especially for non experts. In this work, we more particularly address the problem of real time systems, that is in the situation where the correctness of the system depends upon timing constraints, such as the “timeliness” of some interactions. Many solutions have been proposed to ease the specification and the verification of such systems. An interesting approach—that we follow in this thesis—is based on the definition of specification patterns, that is sets of general, reusable templates for commonly occurring classes of properties. However, patterns are rarely implemented, in the sense that the designers of specification languages rarely provide an effective verification method for checking a pattern on a system. The most common technique is to rely on a timed extension of a temporal logic to define the semantics of patterns and then to use a model-checker for this logic. However, this approach may be inadequate, in particular if patterns require the use of a logic associated to an undecidable model-checking problem or to an algorithm with a very high practical complexity. We make several contributions. We propose a complete theoretical frame- work to specify and check real time properties on the formal model of a system. First, our framework provides a set of real time specification patterns (that may be viewed as a timed extension of Dwyer’s patterns). We provide a verification technique based on the use of observers that has been implemented in a tool for the Fiacre modelling language. Finally, we provide two methods to check the correctness of our verification approach; a “semantics”—theoretical— method as well as a “graphical”—practical— method. [Keywords:] Verification; Requirement; Specification Patterns; Model Checking; Observers; Real Time Systems Contents List of Figures vii 1 Introduction 1 2 State of the Art 8 2.1 Introduction . .8 2.2 Modeling of Real Time Systems . 10 2.3 Specification of Real Time Systems . 11 2.3.1 Timed Automata . 11 2.3.2 Time Petri Nets . 12 2.3.3 Discussion . 13 2.3.4 PROMELA Language . 13 2.3.5 Fiacre Language . 14 2.4 Verification of Real Time Systems . 15 2.4.1 Static Analysis . 15 2.4.2 Theorem Proving . 16 2.4.3 Model Checking . 17 2.5 Comparison with Related Works and Contributions . 27 2.5.1 Contributions on Specifying Properties . 28 2.5.2 Contributions on Verifying Properties . 29 2.5.3 Contributions on Checking the Correctness of the Model Checker 30 3 Formal Framework 32 3.1 Fiacre Language . 33 3.1.1 Processes . 34 3.1.2 Components . 34 iv CONTENTS 3.2 Systems Specification . 35 3.2.1 Time Transition Systems . 35 3.2.2 Semantics of Time Transition Systems expressed as Timed Traces 39 3.2.3 Composition of Time Transition Systems and Composition of Timed Traces . 41 3.3 Formal Framework for Expressing Timed Properties . 46 3.3.1 Metric Temporal Logic . 46 3.3.2 First Order Formula over Timed Traces . 47 3.3.3 Timed Graphical Interval Logic . 48 3.4 Conclusion . 54 4 Real Time Specification Patterns 55 4.1 Introduction . 55 4.2 Observable Events . 56 4.3 Catalogue of Real Time Patterns . 57 4.3.1 Existence patterns . 60 4.3.2 Absence patterns . 61 4.3.3 Response patterns . 62 4.3.4 Universality patterns . 63 4.3.5 Precedence patterns . 64 4.3.6 Pattern Composition . 64 4.4 Case Study: Rail car System . 64 4.5 Meta Model . 70 4.6 Conclusion . 70 5 Checking Patterns Using TTS Observers 73 5.1 Observers at the TTS level . 74 5.1.1 Observers for the Leadsto Pattern . 75 5.2 Experimentation . 77 5.2.1 Experiment analysis: why Data observer is the best in practice? 81 5.3 Proving the correctness of TTS observers . 85 5.4 Catalogue of TTS Observers for Patterns Verification . 89 5.4.1 Composite Patterns . 91 5.5 Conclusion . 92 v CONTENTS 6 Checking Patterns Using Probes and Fiacre Observers 93 6.1 Introduction . 93 6.2 Probes and Observers in Fiacre . 95 6.2.1 Probes Syntax . 95 6.2.2 Observers in Fiacre . 96 6.3 Catalogue of Fiacre Observers for Patterns Verification . 96 6.3.1 Existence Patterns . 97 6.3.2 Absence Patterns . 101 6.3.3 Response Patterns . 105 6.4 Proving the correctness of observers . 109 6.4.1 Universal Program. 109 6.4.2 Graphical Verification. 109 6.5 Experimentation . 112 6.6 Conclusion . 114 7 Conclusions 115 A Catalogue of Real Time Patterns 117 A.1 Existence Patterns . 117 A.2 Absence patterns . 122 A.3 Response patterns . 126 A.4 Universality patterns . 130 B pFrac: Frac with Real Time Properties 131 B.1 Technical Description . 131 B.2 Installation . 132 B.3 Usage . 132 C Résumé en Français 137 Bibliography 146 vi List of Figures 2.1 The process of modeling and verification of (Real Time) Systems . .9 2.2 Timed Automaton Example . 11 2.3 Time Petri Nets Example . 12 2.4 The Observer based Approach . 25 3.1 A double-click example in Fiacre . 33 3.2 The double-click example in TTS . 36 4.1 The approach used to name events in Fiacre . 58 4.2 The Airlock system . 60 4.3 Rail car System . 65 4.4 A Rail car system example in Fiacre: The process Terminal .