Designing, programming, and verifying (large scale) distributed systems Eric Madelaine INRIA Sophia-Antipolis SCALE team

Slides:



Advertisements
Similar presentations
Elton Mathias and Jean Michael Legait 1 Elton Mathias, Jean Michael Legait, Denis Caromel, et al. OASIS Team INRIA -- CNRS - I3S -- Univ. of Nice Sophia-Antipolis,
Advertisements

Ch:8 Design Concepts S.W Design should have following quality attribute: Functionality Usability Reliability Performance Supportability (extensibility,
Architecture Representation
Denis Caromel1 Joint work with Ludovic Henrio – Eric Madelaine et. OASIS members OASIS Team INRIA -- CNRS - I3S – Univ. of Nice Sophia-Antipolis, IUF.
Background information Formal verification methods based on theorem proving techniques and model­checking –to prove the absence of errors (in the formal.
Eric MADELAINE1 E. Madelaine, Antonio Cansado, Emil Salageanu OASIS Team, INRIA -- CNRS - I3S -- Univ. of Nice Sophia-Antipolis OSCAR meeting, Valparaiso,
Object-Oriented Analysis and Design
Component Patterns – Architecture and Applications with EJB copyright © 2001, MATHEMA AG Component Patterns Architecture and Applications with EJB JavaForum.
Session 2: task 3.2 GCM, Kracow, June l Current status of GCM Denis Caromel (10 mn each talk) l Wrapping CCA Components as GCM Components Maciej.
L4-1-S1 UML Overview © M.E. Fayad SJSU -- CmpE Software Architectures Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I.
Software Engineering Module 1 -Components Teaching unit 3 – Advanced development Ernesto Damiani Free University of Bozen - Bolzano Lesson 2 – Components.
Course Instructor: Aisha Azeem
Architectural Design Establishing the overall structure of a software system Objectives To introduce architectural design and to discuss its importance.
Optimisation of behaviour of component-based distributed systems INRIA - I3S - CNRS – University of Nice Sophia-Antipolis EPC SCALE Galyna Zholtkevych.
Asynchronous Components Asynchronous communications: from calculi to distributed components.
Safe composition of distributed adaptable components A distributed component model Behavioural specification and verification Ludovic Henrio and Eric Madelaine.
INRIA Sophia-Antipolis, Oasis team INRIA Rhône-Alpes, Vasy team Feria–IRIT/LAAS, SVF team Toulouse GET - ENST Paris, LTCI team FIACRE Models and Tools.
Oct Multi-threaded Active Objects Ludovic Henrio, Fabrice Huet, Zsolt Istvàn June 2013 –
The Grid Component Model: an Overview “Proposal for a Grid Component Model” DPM02 “Basic Features of the Grid Component Model (assessed)” -- DPM04 CoreGrid.
Oct Active objects: programming and composing safely large-scale distributed applications Ludovic Henrio SCALE team, CNRS – Sophia Antipolis July.
4/2/03I-1 © 2001 T. Horton CS 494 Object-Oriented Analysis & Design Software Architecture and Design Readings: Ambler, Chap. 7 (Sections to start.
The Grid Component Model and its Implementation in ProActive CoreGrid Network of Excellence, Institute on Programming Models D.PM02 “Proposal for a Grid.
Programming and Verifying Distributed and Adaptable Autonomous Components with GCM/ProActive Ludovic Henrio SCALE Team INRIA – UNS – I3S – CNRS Sophia.
Composing Adaptive Software Authors Philip K. McKinley, Seyed Masoud Sadjadi, Eric P. Kasten, Betty H.C. Cheng Presented by Ana Rodriguez June 21, 2006.
Formalism and Platform for Autonomous Distributed Components Bio-inspired Networks and Services A Distributed Component Model Formalisation in Isabelle.
Eric Madelaine FORTE ’04 -- Madrid sept /25 Parameterized Models for Distributed Java Objects Eric Madelaine work with Tomás Barros, Rabéa Boulifa.
Eric MadelaineOSMOSE -- WP2 -- Prague June 2004 Models for the Verification of Distributed Java Objects Eric Madelaine work with Tomás Barros, Rabéa Boulifa,
Eric MADELAINE1 T. Barros, L. Henrio, E. Madelaine OASIS Team, INRIA -- CNRS - I3S -- Univ. of Nice Sophia-Antipolis (FACS’05), Fractal workshop, Grenoble.
A graphical specification environment for GCM component-based applications INRIA – I3S – CNRS – University of Nice-Sophia Antipolis EPC OASIS Oleksandra.
Performance evaluation of component-based software systems Seminar of Component Engineering course Rofideh hadighi 7 Jan 2010.
Lyra – A service-oriented and component-based method for the development of communicating systems (by Sari Leppänen, Nokia/NRC) Traditionally, the design,
L6-S1 UML Overview 2003 SJSU -- CmpE Advanced Object-Oriented Analysis & Design Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I College.
Asynchronous Components with Futures: Semantics, Specification, and Proofs in a Theorem Prover Components (Distributed) Futures Formalisations (and proofs)
1 Qualitative Reasoning of Distributed Object Design Nima Kaveh & Wolfgang Emmerich Software Systems Engineering Dept. Computer Science University College.
Behavioural Verification of Distributed Components Ludovic Henrio and Eric Madelaine ICE Florence 1.
Behavioural Verification of Distributed Components Ludovic Henrio and Eric Madelaine ICE
Grid programming with components: an advanced COMPonent platform for an effective invisible grid © 2006 GridCOMP Grids Programming with components. An.
FDT Foil no 1 On Methodology from Domain to System Descriptions by Rolv Bræk NTNU Workshop on Philosophy and Applicablitiy of Formal Languages Geneve 15.
Distribution and components. 2 What is the problem? Enterprise computing is Large scale & complex: It supports large scale and complex organisations Spanning.
1. 2 Objects to Distributed Components (1) Typed Group Java or Active Object ComponentIdentity Cpt = newActiveComponent (params); A a = Cpt ….getFcInterface.
A Component Platform for Experimenting with Autonomic Composition A component framework for supporting composition of autonomic services and bio-inspired.
Mastère RSD - TC4 2005/20061 Distributed Components –ProActive-Fractal : main concepts –Behaviour models for components –Deployment, management, transformations.
Parameterized Models for Distributed Java Objects Tomás Barros & Rabéa Boulifa OASIS Project INRIA Sophia Antipolis April 2004.
ProActive components and legacy code Matthieu MOREL.
Architecture View Models A model is a complete, simplified description of a system from a particular perspective or viewpoint. There is no single view.
1 Technical & Business Writing (ENG-715) Muhammad Bilal Bashir UIIT, Rawalpindi.
Eric MadelaineOSCAR Workshop -- Santiago Nov Verification of Distributed Applications Eric Madelaine work with Isabelle Attali, Tomás Barros, Rabéa.
A visualisation and debugging tool for multi-active objects Ludovic Henrio, Justine Rochas LAMHA, Nov 2015.
Transparent First-class Futures and Distributed Components Introduction: components, futures, and challenges Statically Representing Futures An Example.
Eric MADELAINE ---- OASIS1 E. Madelaine Oasis team INRIA -- CNRS - I3S -- Univ. of Nice Sophia-Antipolis RESECO ’08 Santiago – Nov. 24, 2008 Specification.
Eric MADELAINE1 A. Cansado, L. Henrio, E. Madelaine OASIS Team, INRIA -- CNRS - I3S -- Univ. of Nice Sophia-Antipolis Fractal workshop, Nantes, 3 july.
RESECO - Montevideo - 22 nov 2007Reseco, Montevideo, 22 nov 2007 Eric Madelaine - OASIS Team1 Specifying and Generating Safe GCM Components INRIA – Sophia.
VERIFYING THE CORRECT COMPOSITION OF DISTRIBUTED COMPONENTS: FORMALISATION AND TOOL Ludovic Henrio 1, Oleksandra Kulankhina 1,2, Dongqian Liu 3, Eric Madelaine.
Component Patterns – Architecture and Applications with EJB copyright © 2001, MATHEMA AG Component Patterns Architecture and Applications with EJB Markus.
Specifying Fractal and GCM Components With UML Solange Ahumada, Ludovic Apvrille, Tomás Barros, Antonio Cansado, Eric Madelaine and Emil Salageanu SCCC.
Formal Verification. Background Information Formal verification methods based on theorem proving techniques and model­checking –To prove the absence of.
Tomás BarrosMonday, April 18, 2005FIACRE Toulouse p. 1 Behavioural Models for Hierarchical Components Tomás Barros, Ludovic Henrio and Eric Madelaine.
Distributed Components and Futures: Models and Challenges A Distributed Component Model Distributed Reconfiguration Calculi for Components and Futures.
A Theory of Distributed Objects Toward a Foundation for Component Grid Platforms Ludovic HENRIO l A Theory of Distributed Objects l Components l Perspectives.
Eric MADELAINE -- GridComp -- OASIS 1 E. Madelaine (A. Cansado) GridComp project OASIS team INRIA -- CNRS - I3S -- Univ. of Nice Sophia-Antipolis GridComp.
Eric MADELAINE1 T. Barros, L. Henrio, E. Madelaine OASIS Team, INRIA -- CNRS - I3S -- Univ. of Nice Sophia-Antipolis DCC, University.
GCM/ProActive: a distributed component model, its implementation, and its formalisation Ludovic Henrio OASIS Team INRIA – UNS – I3S – CNRS Sophia Antipolis.
2. CALCULUS: A S P. A Theory of Distributed Objects D. Caromel, L. Henrio, Springer 2005, Monograph A Calculus: ASP: Asynchronous Sequential Processes.
TTCN-3 Testing and Test Control Notation Version 3.
UML Diagrams By Daniel Damaris Novarianto S..
Behavioural Models for Distributed Hierarchical Components
UML Diagrams Jung Woo.
Distributed Components and Futures: Models and Challenges
Design Yaodong Bi.
The Grid Component Model and its Implementation in ProActive
Presentation transcript:

Designing, programming, and verifying (large scale) distributed systems Eric Madelaine INRIA Sophia-Antipolis SCALE team Summer School INRIA – ECNU Shanghai July

Context & people SCALE research team at INRIA Sophia-Antipolis 3 years of collaboration with -Research (distributed systems, semantics, formal methods) -Common PhD -Master internships Internship (master) available this autumn (Oct. – Dec.). Urgent, please contact me this week ! Also: Master (1&2) track “Ubiquitous Systems & Networks” at University of Nice Sophia-Antipolis. School -- ECNU, Shanghai, July 2014

Goals of the Course 1.Explore some features of component-based software 1.Fractal and GCM component models 2.GCM architecture and execution principles 2.VerCors: A software platform for abstract specification and verification of GCM applications 3.Understand a non-trivial case-study in (model-checking) behavior verification Hands-on session 1.Specification of distributed component architecture and behaviour with the VCE tools.

AGENDA Vocabulary and context  specification, modeling, testing, verification…: Formal methods in the design flow of distributed/embedded systems Modeling Software Component Systems :  Fractal / GCM Component Framework  The VerCors platform: architecture (ADL) and behavior specification formalisms Model-checking GCM applications  The BFT case-study

Formal methods Formal methods : Provide mathematical semantics to models so that their relation to implemented product can be asserted and proved : – specification formalisms, (temporal) logics – model checking, equivalence checking, theorem-proving – certification, testing – model-based test generation Modeling languages: – UML and variants (State machines, StateCharts, SysML,…) – Dedicated IDLs and ADLs for system decomposition (…) – Assertion languages (annotations) In blue, keywords of this course

Design Cycle Requirements capture (Initial) specification Architectural division Component design / programming Component testing Integration IP component reuse libraries Sign-off Global testing Implementation School -- ECNU, Shanghai, July 2014

Design cycle Requirements capture (Initial) specification Architectural division Component testing Integration IP component reuse libraries Sign-off Global testing Early specification of Architecture and Interaction Correct-by-Construction Implementation Synthesis Black box specification Test generation Correctness w.r.t. requirements Correct composition: interface compatibility, deadlock freeness, spec implementation School -- ECNU, Shanghai, July 2014 This Course

Goal :  Early specification of an Abstract view of the system: Architecture, Behavior, Requirements.  Model-checking based verification: Correct composition, Deadlock analysis, Correctness w.r.t. Requirements Through finite model generation.  Implementation: Preferably “Correct by construction” code, partially generated from models. Modeling & Verifying Component Systems Next sections of this course with focus on Fractal/GCM

AGENDA Vocabulary and context  specification, modeling, testing, verification…: Formal methods in the design flow of distributed/embedded systems Modeling Software Component Systems :  Fractal / GCM Component Framework  The VerCors platform: architecture (ADL) and behavior specification formalisms Model-checking GCM applications  The BFT case-study

At the beginning there was… The Fractal project Reflective software component model technology for the construction of highly adaptable, and reconfigurable distributed systems –A programming-language independent component model –A set of tools to support programming and assembling –Software industries needs (≠ object-orientation): Dependencies, assembly, packaging, deployment, configuration Open and adaptable/extensible Component [Szyperski, 2002]: “A component is a unit of composition with contractually specified interfaces and context dependencies only. A software component can be deployed independently and is subject to composition by third parties.” School -- ECNU, Shanghai, July 2014

The Fractal component model Systems and middleware engineering –Generic enough to be applied to any other domain –Fine grain (opposed to EJB or CCM), close to a class model –Lightweight (low overhead on top of objects) –Independent from programming languages –Homogeneous vision of all layers (OS, middleware, services, applications) Usable as a component framework to build applications –with “standard” Fractal components Usable as a component framework framework –building different kinds of components –with minimum introspection and simple aggregation (à la COM) –with binding and lifecycle controllers (à la OSGi) –with a two-level hierarchy and bindings (à la SCA) –with persistence and transaction controllers (à la EJB) –with attribute controllers (à la MBean) School -- ECNU, Shanghai, July 2014

What are (GCM/Fractal) Components? Bindings Business code Server interfaces Client interfaces Primitive component Composite component NF (server) interfaces -Hierarchical -Extensible -Reflexive: runtime component management -Separate functional / non-functional concerns

GCM Grid Component Model A Fractal Extension : Scopes and Objectives: Grid/Cloud Codes that Compose and Deploy (on distributed infrastructures) No programming, No Scripting, … Innovations: Abstract Deployment Multicast and GatherCast Controller (NF) Components Standardization By the ETSI TC-GRID ( )

GCM: asynchronous model Distributed components :  No shared memory  Communication = Remote Method Call  Physical infrastructure ≠ logical (virtual) architecture  Large scale Grid/Cloud computations:  Multicast and gathercast interfaces  Asynchrony of computation : Remote Calls are non-blocking Notion of Future Objects. School -- ECNU, Shanghai, July 2014

A Primitive GCM Component CI.foo(p) Primitive components communicating by asynchronous remote method invocations on interfaces (requests)  Components abstract away distribution and concurrency in GCM/ProActive components are mono-threaded  simplifies concurrency but can create deadlocks

Futures for Components f=CI.foo(p) ………. f.bar() Component are independent entities (threads are isolated in a component) + Asynchronous method invocations with results  Futures are necessary

Replies f=CI.foo(p) ……………… f.bar()

What is a Future? Future = Placeholder for an awaited result Creation of a future –How and when are futures created? Implicit creation = automatic upon asynchronous invocation (on a remote object) Explicit creation = there is a future construct Manipulation and access –How to manipulate the futures? Explicit access = get operation (+ future type) Implicit (transparent) access = any variable can contain a future 18

First-class Futures f=CI.foo(p) ……………… CI.foo(f) Only strict operations are blocking (access to a future) Communicating a future is not a strict operation

First-class Futures and Hierarchy Without first-class futures, one thread is systematically blocked in the composite component. f=f’

First-class Futures and Hierarchy … … … Almost systematic dead-lock in GCM/ProActive A lot of blocked threads otherwise

Reply Strategies In ASP / ProActive, the result is insensitive to the order of replies (shown for ASP-calculus) experiments with different strategies (lazy, eager)

Summary Primitive components contain the business code Primitive components act as the unit of distribution and concurrency (each thread is isolated in a component) Communication is performed on interfaces and follows component bindings Futures allow communication to be asynchronous requests Futures are transparent can lead to optimisations and are a convenient programming abstraction but …

What Can Create Deadlocks? A race condition: Detecting deadlocks can be difficult  behavioural specification and verification techniques What should be done to avoid such a deadlock? (add synchronisation)

Fractal/GCM : controllers Control –Non functional (technical) properties –Implemented in the membrane –Made of a set of controllers –E.g. security, transaction, persistence, start/stop, naming, autonomicity –Controllers accessible through a control interface –Controllers and membranes are open School -- ECNU, Shanghai, July 2014 Predefined : -Life-cycle -Binding controller -Attribute controller -Content controller

GCM: components for controllers “Componentize” the membrane: Build controllers in a structured way Reuse of controller components Applications: control components for self- optimization, self-healing, self-configuring, interceptors for encryption, authentication, … School -- ECNU, Shanghai, July 2014 Membrane and controllers: A way to improve Separation of concerns

GCM: NxM communication 1 to N = multicast / broadcast / scatter N to 1 bindings = gathercast Attach a behaviour (policy) to these interfaces School -- ECNU, Shanghai, July 2014 Group architecture and communication policies: Allows for (high performance) very large scale applications, With easy and portable architecture specification

AGENDA Vocabulary and context  specification, modeling, testing, verification…: Formal methods in the design flow of distributed/embedded systems Modeling Software Component Systems :  Fractal / GCM Component Framework  The VerCors platform: architecture (ADL) and behavior specification formalisms Model-checking GCM applications  The BFT case-study

GCN high level specifications: The VCE tool School -- ECNU, Shanghai, July 2014

Model-checking applications: The Vercors platform School -- ECNU, Shanghai, July 2014 Specification: Graphical editors Generation Of the Semantic model Model Checking (partial) Code generation

An Eclipse / Obeo environment School -- ECNU, Shanghai, July 2014

The graphical formalisms: (1) Architecture GCM full ADL, with full componentized membrane, and multicast/gathercast School -- ECNU, Shanghai, July 2014

The graphical formalisms: (2) Interfaces UML class diagram, for interface signatures, and primitive component implementation class School -- ECNU, Shanghai, July 2014

The graphical formalisms: (3) behaviors UML state machines, with a specific label language School -- ECNU, Shanghai, July 2014

Validity check, code & model generation Semantic validity rules: –Structural (components, bindings, interface roles) –Typing (interface compatibility) –Behavioral (variables/methods well-definedness) Guarantees generation of correct code: –ADL file (for GCM/ProActive component factory) –Behavior model (for model-checking) School -- ECNU, Shanghai, July 2014

Validity check, code & model generation School -- ECNU, Shanghai, July 2014

AGENDA Vocabulary and context  specification, modeling, testing, verification…: Formal methods in the design flow of distributed/embedded systems Modeling Software Component Systems :  Fractal / GCM Component Framework  The VerCors platform: architecture (ADL) and behavior specification formalisms Model-checking GCM applications  The BFT case-study

Byzantine systems: “bad” guys can have any possible behaviour, everybody can turn bad, but only up to a fixed % of the processes. Very large Bibliography: Algorithms Correctness proofs Byzantine Fault Tolerant Systems

Modelling a BFT application in GCM 1 composite component with 2 external services Read/Write. The service requests are delegated to the Master. Fig 3 from paper Note: 3f+1 slaves 1 multicast interface sending write/read/commit requests to all slaves. the salves reply asynchronously, the master only needs 2f+1 coherent answers to terminate School -- ECNU, Shanghai, July 2014 VCE diagram

1.The master is reliable: this simplifies the 3-phases commit protocol, and avoid the consensus research phase. 2.The underlying middleware ensures safe communications: faulty components only respond to their own requests, and communication order is preserved. 3.To tolerate f faults we use 3f+1 slaves, and require 2f+1 agreeing answers, as in the usual BFT algorithms. Our simplification hypothesis

Requirements (= logical properties) 1- Reachability(*): - The Read service can terminate  fid:nat among {0...2}. ∃ b:bool. true - Is the BFT hypothesis respected by the model ? true 2- Termination: – After receiving a Q_Write(f,x) request, it is (fairly) inevitable that the Write services terminates with a R_Write(f) answer, or an Error is raised. 3- Functional correctness: – After receiving a ?Q_Write(f1,x), and before the next ?Q_Write, a ?Q_Read requests raises a !R_Read(y) response, with y=x (*) Model Checking Language (MCL), Mateescu et al, FM’08 School -- ECNU, Shanghai, July 2014

Semantic Model: network of processes (hierarchical, parameterized) School -- ECNU, Shanghai, July 2014 Process hierarchy to be generated by VerCors R. Ameur-Boulifa, L. Henrio, E. Madelaine, A. Savu, « Behavioral Semantics for Distributed Components », Research report RR-8167, INRIA, dec

Eric MADELAINE43 Basic Processes : parameterized LTSs Labelled transition systems, with: Value passing Local variables Guards…. School -- ECNU, Shanghai, July 2014 ATG drawing (but could be UML state-machines as well)

Combining processes: generalized parallel operator BFT-Net : k  [1:n] with synchronisation vectors : => ?Write(x) => Q_Write(f,x)  k => R_Write(f,k) School -- ECNU, Shanghai, July 2014 EXP format (to be generated by VerCors)

VerCors: Platform Architecture Goal: fully automatic chain Current state of the platform: production of the CADP input formats only partially (~50%) available. School -- ECNU, Shanghai, July 2014

Generation of state-space Taming state-space explosion: Data abstraction (through abstract interpretation): integers => small intervals arrays … => reduce by symmetry arguments. Partitioning and minimizing by bisimulation + context specification Distributed verification engines, Only partially available (state-space generation, but no M.C.). 3 Tbytes of RAM ? School -- ECNU, Shanghai, July 2014

Build product Flac + Distributor + Minimize Master.exp MQueue.bcg Master Queue MQueue.fcr MQueue.bcg Master Body MBody.fcr … WriteProxy.bcg Write Proxy WriteProxy.fcr (Hide/Rename) Minimize Master.exp … State-space generation workflow School -- ECNU, Shanghai, July 2014

State-space generation workflow School -- ECNU, Shanghai, July 2014

Distributed State generation Abstract model: (for a fixed valuation of the parameters): f=1, (=> 4 slaves), |data|= 2, |proxies|=3*3, |client requests|=3 Master queue size = 2 ~100 cores, max 300 GB RAM System parts sizes (states/transitions): Queue Largest intermediate MasterGood SlaveGlobalTime 237/ /31075M/103M5936/61K34K/164K59’ Estimated brute force state spaces : ~ School -- ECNU, Shanghai, July 2014

Some Research Challenges 1.Tooling : hide model-checker internal languages, show results in user-level formalism. 2.Scale-up: better abstraction techniques for useful datatypes (e.g. arrays), better distributed Model-Checking engines, compositional techniques, minimization of the size of the semantic model 3.Verifying dynamic distributed systems (GCM + Reconfiguration): handle Life-cycle and Binding Controllers, encode sub-component updates, several orders of magnitude bigger. => In the long term, combine model-checking & theorem-proving School -- ECNU, Shanghai, July 2014 N. Gaspar, L. Henrio, E. Madelaine, « Formally Reasoning on a Reconfigurable Component- Based System --- A Case Study for the Industrial World », FACS’13, Nanchang, China, oct

Conclusion 1)Component frameworks: provide method, tools, middleware for programming large-scale applications 2)Vercors: an example of a modeling+verification framework for component-based applications 3)Model-checking distributed component systems: large use-cases – mehtods for mastering state-space explosion + Available master/PhD subjects at INRIA/Scale + International Master track at University of Nice Sophia-Antipolis School -- ECNU, Shanghai, July 2014

More References Fractal & GCM: [doc tutorials] GridsWork.ppthttp://www-sop.inria.fr/members/Eric.Madelaine/Teaching/Ubinet2010/2006-GCM- GridsWork.ppt F. Baude, D. Caromel, C. Dalmasso, M. Danelutto, V. Getov, L. Henrio, C. Perez: GCM: A Grid Extension to Fractal for Autonomous Distributed Components, in Annals of Telecommunications, Vol. 64, n o 1, jan pNet [def & semantics]: Overview: E. Madelaine, Specification, Model Generation, and Verification of Distributed Applications, sept. 2011, URL: Vercors: (download, examples) Case-studies: R. Ameur-Boulifa, R. Halalai, L. Henrio, E. Madelaine, Verifying Safety of Fault- Tolerant Distributed Components - Extended Version, RR INRIA #7717, sept 2011, URL: Nuno FACS’14 School -- ECNU, Shanghai, July 2014

Thank you 谢谢 Merci Papers, Use-cases, and Tools at : Course funded by Associated Team DAESD: INRIA-E.C.N.U. School -- ECNU, Shanghai, July 2014

Hands-on Session Use-case: Intelligent cars system –Presentation, Basic components & behavior VCE (VerCors Component Environment): –Installation, Tutorial, Fast start –Example projects Exercices: –components architecture, interfaces, types –component behavior as GCM State Machines School -- ECNU, Shanghai, July 2014

Installation VCE-v3 bundles available for win32, win64, linux platforms. Experimental ! Prerequisite: Java7 (jre or jdk) installed Documents: Installation instructions Tutorial Exercices Thanks a lot to Liu Dongqian and the other volunteer students. School -- ECNU, Shanghai, July 2014

Intelligent cars scenario (from Chen Yanwen PhD research) School -- ECNU, Shanghai, July 2014

System Architecture School -- ECNU, Shanghai, July 2014

Specific timed model transition language 1.This use-case was originally built for a timed version of the semantic formalism. 2.But in the exercises today, only consider the untimed fragment, by dropping the clocks and the time variables. E.g. in the CommIni component: C ?Cmd(Ins) t C  ?Cmd(Ins) 3.GCM : RPC style here versus message oriented (= no return value) School -- ECNU, Shanghai, July 2014

Exercice 1: Architecture 1.Build a VCE architecture diagram, for the Car0 component, with its 3 subcomponents: a.Only the architecture (components, interfaces, bindings) in this first step. b.Respect the interface names. 2.Add a service interface accepting messages from the car driver. Name it “Driver”. 3.Check the diagram validity. School -- ECNU, Shanghai, July 2014

Exercice 2: Channels 1.Channels here are primitive components with a specific behavior template: 2.Draw a primitive component with interfaces S1 and C1. Build the UML class diagram of these interfaces, and of the implementation class for the method “In” of the service interface S1. School -- ECNU, Shanghai, July 2014

Exercice 3: Channels behavior 1.A channel repeatedly receives “In” requests on its service interface. The “In” method receives a parameter, calls the “Out” method on the client interface, then returns. 2.Attach a state-machine specifying the behavior of the service method “In”. 3.Use xtext to create the label of the “C.Out” transition of this machine. School -- ECNU, Shanghai, July 2014 See Tutorial Section 2.9

Exercice 4: CommIni component School -- ECNU, Shanghai, July 2014

Exercice 4: CommIni component This is more complicated…: 1.CommIni has 2 service interfaces (bound from Initial and from ChannelAck). o When receiving “Cmd(Ins)” from Initial, it sends a number of “Notify” on client Itf ChannelNotify, then wait. o When receiving “Ack(k,r)” from ChannelAck, it stores the corresponding “r_k”. We suppose it receives them in order. o When all received, it computes the result and sends it on Itf “ToInitial” 2.The way to formalize this in GCM is with 2 service methods, plus a local “body” method describing the (statefull) behavior policy. 3.Build the class diagram for this impl. Class, then the State machines for the service methods and the body. School -- ECNU, Shanghai, July 2014

Multicast and gathercast, workflow style School -- ECNU, Shanghai, July 2014

Composite, multicast, matrix (travail à faire en cours) Build a composite component, with: One server interface, with an internal multicast interface 2 x 3 subcomponents representing matrix blocks, each linked to its left neighbour School -- ECNU, Shanghai, July 2014

Master/slave, RPC style School -- ECNU, Shanghai, July 2014

Master/slave, parameterized style School -- ECNU, Shanghai, July 2014

Master/slave, parameterized style School -- ECNU, Shanghai, July 2014

Matrix, parameterized style School -- ECNU, Shanghai, July 2014

Exercice Analyze this diagram (semantics, errors, …) School -- ECNU, Shanghai, July 2014