"First Class Futures"
Total Page:16
File Type:pdf, Size:1020Kb
UNIVERSITÉ DE NICE - SOPHIA ANTIPOLIS École Doctorale STIC Sciences et Technologies de l’Information et de la Communication THÈSE pour obtenir le titre de Docteur en Sciences de l’Université de Nice - Sophia Antipolis Mention Informatique présentée et soutenu par Muhammad Uzair KHAN A Study of First Class Futures: Specification, Formalisation, and Mechanised Proofs Thèse dirigée par Ludovic HENRIO et Denis CAROMEL au sein de l’équipe OASIS, équipe commune de l’INRIA Sophia Antipolis, du CNRS et du laboratoire I3S soutenue le 25 Février 2011,devant le jury composé de: Président du Jury Yves Bertot INRIA-Sophia Antipolis Rapporteurs Jean-Bernard Stefani INRIA Grenoble-Rhône-Alpes, France Christian Perez INRIA-ENS Lyon, France Carlos Canal ETSI Informática Universidad de Málaga, Espagne Directeur de thèse Denis Caromel INRIA-CNRS-Université de Nice Sophia Antipolis Co-directeur Ludovic Henrio INRIA-CNRS-I3S–Sophia Antipolis 0.1 Acknowledgment Last thing to do :-) Contents 0.1 Acknowledgment.............................i 1 Introduction1 1.1 Motivation.................................2 1.2 Results and Contributions........................3 1.2.1 Specification and Implementation of Future Update Strategies4 1.2.2 Formalisation of Component Model and Proofs........4 1.3 Impact of Thesis.............................5 1.4 Thesis Outline..............................5 2 Related Works9 2.1 Background: Why Futures ?....................... 10 2.1.1 Some basic questions about futures............... 11 2.2 Distributed and Concurrent Programming............... 13 2.3 Distributed Concurrent Programming with Futures.......... 14 2.3.1 Futures in Multilisp World................... 14 2.3.2 Futures in ABCL/1 and ABCL/f................ 17 2.3.3 Futures in Alice ML and λ(fut) ................. 19 2.4 Distributed Concurrent Programming with Futures and Objects... 20 2.4.1 Future in Java-verse....................... 20 2.4.2 Futures in Creol......................... 22 2.4.3 Futures in ASP, ProActive and ASPfun ............. 24 2.4.4 Futures in AmbientTalk..................... 25 2.5 Component Models and Frameworks.................. 27 2.5.1 Common Object Model (COM) and DCOM.......... 28 2.5.2 Enterprise Java Beans...................... 28 2.5.3 CORBA Component Model (CCM) and GridCCM...... 29 2.5.4 Common Component Architecture (CCA)........... 30 2.5.5 Service Component Architecture (SCA) and FraSCAti.... 31 2.5.6 SOFtware Appliances Component Model (SOFA)....... 32 2.5.7 Fractal component model.................... 33 2.5.8 Grid Component Model (GCM)................. 34 2.6 Summary of Related Works and Positioning.............. 36 I Future Update Strategies: Specification and Implementation 41 3 First Class Futures: Specification of Update Strategies 43 3.1 Background: Futures in ASP-Calculus................. 45 3.2 Background: Update Strategies for Futures.............. 47 3.2.1 Classification of Future Update strategies........... 47 iv Contents 3.2.2 Eager Forward-based Strategy.................. 48 3.2.3 Eager Message-based Strategy.................. 49 3.2.4 Lazy Message-based Strategy.................. 51 3.3 Semi-Formal Specification of Update Strategies............ 52 3.3.1 General Notation......................... 52 3.3.2 Eager Forward-based Strategy.................. 55 3.3.3 Eager Message-based Strategy.................. 56 3.3.4 Lazy Message-based Strategy.................. 58 3.4 Analysis of Future Update Strategies.................. 59 3.5 Remarks on Semi-formal Specification of Strategies.......... 62 4 Implementing Future Update Strategies in ProActive 65 4.1 Background: First Class Futures in ProActive............. 66 4.1.1 First Class Futures in ProActive: Automatic Continuation.. 68 4.2 Missing Future Update Strategies.................... 70 4.2.1 Eager Message-based Strategy.................. 70 4.2.2 Lazy Message-based Strategy.................. 72 4.3 Experimental Evaluation......................... 74 4.4 Concluding Remarks on Future Update Strategies.......... 79 II Formal Reasoning on Components: Semantics and Proofs 81 5 A Framework for Reasoning on Component Composition 83 5.1 Background: Isabelle/HOL....................... 85 5.1.1 Isabelle/HOL Syntax....................... 86 5.2 An Asynchronous Component Model with Futures.......... 89 5.2.1 Component Model Overview.................. 90 5.2.2 Component Structure...................... 90 5.2.3 Communication Model...................... 92 5.2.4 Component Behaviour...................... 93 5.2.5 Why First Class Futures in GCM ?............... 94 5.3 Formalisation of a Component Model in Isabelle/HOL........ 96 5.3.1 Component Structure...................... 97 5.3.2 Efficient Specification of Component Manipulation...... 98 5.3.3 Component State......................... 103 5.3.4 Correct Component....................... 106 5.3.5 Basic Properties on Component Structure and Manipulation. 107 5.3.6 Properties on Component Correctness............. 109 5.4 Runtime Reconfiguration of Components................ 111 5.4.1 Complete Component...................... 112 5.4.2 Reconfiguration Primitives: Unbind and Replace....... 113 Contents v 6 Asynchronous Components with Futures : Semantics and Proofs 117 6.1 An Asynchronous Component Model with Futures.......... 119 6.2 Run time Semantics for GCM-like Components............ 121 6.2.1 Structure and Notations..................... 121 6.2.2 Semantics of Component Model................. 126 6.3 Formalisation in Isabelle and Properties................ 133 6.3.1 Semantics............................. 134 6.3.2 Properties and Proofs on Eager message-based Strategy... 135 7 Positioning and Concluding Remarks on Formalisation 139 8 Conclusion 143 8.1 Final remarks............................... 150 9 Future Works 153 9.1 Applied Aspects............................. 153 9.2 Theoretical Aspects............................ 157 A Summary of terms and notations 161 B Semantics of Lazy message-based Strategy 167 Bibliography 171 List of Figures 3.1 Futures propagate throughout the system............... 46 3.2 Eager forward-based: Future updates follow the flow of futures... 48 3.3 Eager message-based: All future recipients register.......... 50 3.4 Lazy message-based: Register only on wait-by-necessity....... 51 3.5 Future-update in eager forward-based strategy............. 56 3.6 Future-update in eager message-based strategy............ 57 3.7 Future update in lazy message-based strategy............. 58 4.1 Anatomy of an Active Object...................... 67 4.2 Active objects and futures in ProActive................ 68 4.3 A small example tree configuration................... 75 4.4 Comparison of strategies for a tree configuration........... 76 4.5 Pipe of varying length.......................... 77 4.6 Comparison of strategies for a pipe configuration........... 78 5.1 High level view of a GCM component [1]............... 90 5.2 Component composition......................... 91 5.3 Structure of a primitive component.................. 92 5.4 Example composite component..................... 92 5.5 Behaviour of primitive components................... 94 5.6 First Class Futures in GCM (a).................... 94 5.7 First Class Futures in GCM (b).................... 95 5.8 First Class Futures in GCM (c)..................... 95 5.9 First Class Futures in GCM (d)..................... 96 5.10 Composite Component......................... 98 6.1 Future registration............................ 120 6.2 Future update.............................. 121 6.3 Structure and behaviour of a primitive component.......... 123 6.4 Primitive Component Semantics.................... 127 6.5 Component Communications...................... 129 6.6 CompositeCall ............................ 129 6.7 Semantics of the component composition (a)............. 130 6.8 CommBrother ............................. 131 6.9 CommChild rule............................ 132 6.10 CommParent .............................. 132 6.11 Semantics of the component composition (b)............. 133 B.1 Primitive Component Semantics (Lazy message-based)........ 167 B.2 Semantics of the component composition (a)............. 168 B.3 Semantics of the components...................... 169 Chapter 1 Introduction Contents 1.1 Motivation.............................2 1.2 Results and Contributions....................3 1.2.1 Specification and Implementation of Future Update Strategies4 1.2.2 Formalisation of Component Model and Proofs........4 1.3 Impact of Thesis..........................5 1.4 Thesis Outline...........................5 2 Chapter 1. Introduction 1.1 Motivation Ever since the introduction and first serious applications of computer networks in 1970-1980s, the field of distributed computing has been growing enormously. Start- ing from their humble roots as E-mail application of ARPANET and the Usenet discussion system, distributed systems have become prevalent in modern life. Every aspect of modern life is somehow influenced by one or more applications of dis- tributed computing. At the same time, the computational capabilities of individual microprocessors have grown exponentially. Today’s processors used in standalone machines are more powerful than some of the earliest mainframes. To better harness the available processing power, and to optimise the computational efficiency, a lot of effort has been put on studying concurrency, parallelism and distribution. Distributed systems have been described in literature in a number of ways, de- pending upon factors such as distribution model, communication model,