Overview. 1 Lecture 1: Introduction. 2 Lecture 2: Message Sequence Charts. Joost-Pieter Katoen Theoretical Foundations of the UML 1/32

Similar documents
Theoretical Foundations of the UML

Netcharts: Bridging the gap between HMSCs and executable specifications

Theoretical Foundations of the UML Lecture 18: Statecharts Semantics (1)

Safety and Liveness Properties

Labeled Transition Systems

On communicating automata with bounded channels

A Theory of Regular MSC Languages

1. (12 points) Give a table-driven parse table for the following grammar: 1) X ax 2) X P 3) P DT 4) T P 5) T ε 7) D 1

Information System Design IT60105

Design and Analysis of Distributed Interacting Systems

Causal Message Sequence Charts

TESTING is one of the most important parts of the

CIS 375 Intro to Discrete Mathematics Exam 3 (Section M004: Blue) 6 December Points Possible

Automaten und Formale Sprachen Automata and Formal Languages

Reasoning about Time and Reliability

Lecture 4. Algebra, continued Section 2: Lattices and Boolean algebras

CIS 375 Intro to Discrete Mathematics Exam 3 (Section M001: Green) 6 December Points Possible

2nd Exam. First Name: Second Name: Matriculation Number: Degree Programme (please mark): CS Bachelor CS Master CS Lehramt SSE Master Other:

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

Logical Time. 1. Introduction 2. Clock and Events 3. Logical (Lamport) Clocks 4. Vector Clocks 5. Efficient Implementation

Design of Distributed Systems Melinda Tóth, Zoltán Horváth

Fall 2014: PHYSICS 170 GENERAL PHYSICS I

Lecture 4 Event Systems

Property Checking of Safety- Critical Systems Mathematical Foundations and Concrete Algorithms

An Extension for MSC-2000 and its Application

Lecture 1: Lattice(I)

Theoretical Computer Science

Semantic Equivalences and the. Verification of Infinite-State Systems 1 c 2004 Richard Mayr

A theory of regular MSC languages

Formal Conformance Testing 2006

D-MATH Algebraic Geometry FS 2018 Prof. Emmanuel Kowalski. Solutions Sheet 1. Classical Varieties

A Discrete Duality Between Nonmonotonic Consequence Relations and Convex Geometries

Overview. Discrete Event Systems Verification of Finite Automata. What can finite automata be used for? What can finite automata be used for?

Refinement-Robust Fairness

COURSE CONTENT for Computer Science & Engineering [CSE]

Section Summary. Relations and Functions Properties of Relations. Combining Relations

Homework 8. Sections Notes on Matrix Multiplication

Outline for Today. Binary Relations. Equivalence Relations. Partial Orders. Quick Midterm Review

Reduced Ordered Binary Decision Diagrams

Relationships between elements of sets occur in many contexts. Every day we deal with

Seamless Model Driven Development and Tool Support for Embedded Software-Intensive Systems

Relations. We have seen several types of abstract, mathematical objects, including propositions, predicates, sets, and ordered pairs and tuples.

Partial model checking via abstract interpretation

Simulation of Discrete Event Systems

Methods for the specification and verification of business processes MPB (6 cfu, 295AA)

Towards a Denotational Semantics for Discrete-Event Systems

A Brief Introduction to Model Checking

Module Name Module Code

Simulation of Spiking Neural P Systems using Pnet Lab

Static Program Analysis

Pairing Transitive Closure and Reduction to Efficiently Reason about Partially Ordered Events

Automata and Languages

What You Must Remember When Processing Data Words

The State Explosion Problem

Modal Logic. UIT2206: The Importance of Being Formal. Martin Henz. March 19, 2014

GS03/4023: Validation and Verification Predicate Logic Jonathan P. Bowen Anthony Hall

Pairing Transitive Closure and Reduction to Efficiently Reason about Partially Ordered Events

INTRODUCTION TO NONMONOTONIC REASONING

Automata-based Verification - III

Compact Regions for Place/Transition Nets

Lattice Theory Lecture 4. Non-distributive lattices

Semantics and Verification

Distributed Implementation of Message Sequence Charts

Angelina College Science and Mathematics Chemistry 1305 Introductory Chemistry General Syllabus

Using Patterns and Composite Propositions to Automate the Generation of LTL Specifications

Lecture Notes: Selected Topics in Discrete Structures. Ulf Nilsson

Models of Concurrency

EQUIVALENCE RELATIONS (NOTES FOR STUDENTS) 1. RELATIONS

Realizability and Verification of MSC Graphs

COMP 182 Algorithmic Thinking. Relations. Luay Nakhleh Computer Science Rice University

SYLLABUS SEFS 540 / ESRM 490 B Optimization Techniques for Natural Resources Spring 2017

CDS 270 (Fall 09) - Lecture Notes for Assignment 8.

Using Patterns and Composite Propositions to Automate the Generation of Complex LTL Specifications

Automata-based Verification - III

Algorithm Design and Analysis

What are relations? f: A B

Causality in Concurrent Systems

Automata & languages. A primer on the Theory of Computation. Laurent Vanbever. ETH Zürich (D-ITET) September,

18.312: Algebraic Combinatorics Lionel Levine. Lecture 11

EE 144/244: Fundamental Algorithms for System Modeling, Analysis, and Optimization Fall 2016

Reasoning under Uncertainty: Intro to Probability

Linear Temporal Logic and Büchi Automata

Automata on linear orderings

The Underlying Semantics of Transition Systems

Differential Geometry for Image Processing

Space-Time Viewpoints for Concurrent Processes Represented by Relational Structures

Discrete Mathematics. 2. Relations

KLEENE LOGIC AND INFERENCE

1.2 Posets and Zorn s Lemma

MAD. Models & Algorithms for Distributed systems -- 2/5 -- download slides at

Unless otherwise specified, V denotes an arbitrary finite-dimensional vector space.

Testing Safety-critical Discrete- State Systems Mathematical Foundations and Concrete Algorithms

Packet #5: Binary Relations. Applied Discrete Mathematics

Do not open this exam until you are told to begin. You will have 75 minutes for the exam.

Home Page. Title Page. Page 1 of 35. Go Back. Full Screen. Close. Quit

Methods for Software Verification. Andrea Corradini Gian Luigi Ferrari. Second Semester 6 CFU

Introduction to Temporal Logic. The purpose of temporal logics is to specify properties of dynamic systems. These can be either

Timo Latvala. March 7, 2004

Combining Propositional Dynamic Logic with Formal Concept Analysis

Lecture 16: Computation Tree Logic (CTL)

Transcription:

Overview 1 Lecture 1: Introduction 2 Lecture 2: Message Sequence Charts Joost-Pieter Katoen Theoretical Foundations of the UML 1/32

Theoretical Foundations of the UML Lecture 1: Introduction Joost-Pieter Katoen Lehrstuhl für Informatik 2 Software Modeling and Verification Group moves.rwth-aachen.de/teaching/ss-16/theoretical-foundations-of-the-uml/ 13. April 2016 Joost-Pieter Katoen Theoretical Foundations of the UML 2/32

Target audience You are studying: Master Computer Science, or Master Systems Software Engineering, or Bachelor Computer Science, or... Usage as: elective course Theoretical Computer Science not a Wahlpflicht course for bachelor students specialization MOVES (Modeling and Verification of Software) complementary to Model-based Software Development (Rumpe) Joost-Pieter Katoen Theoretical Foundations of the UML 3/32

Target audience (contd.) In general: interest in system software engineering interest in formal methods for software interest in semantics and verification application of mathematical reasoning Prerequisites: mathematical logic formal language and automata theory algorithms and data structures computability and complexity theory Joost-Pieter Katoen Theoretical Foundations of the UML 4/32

Organization Schedule: Day Time Room Lecture Tue 12:15-13:45 9U09 Thu 08:30-10:15 5056 Exercises Thu 14:15-15:45 9U09 about 20 lectures in total; Keep track of website for precise dates! People involved: Lecturer EMail Lectures Joost-Pieter Katoen katoen@cs.rwth-aachen.de Exercises Hao Wu hao.wu@cs.rwth-aachen.de Benjamin Kaminksi benjamin.kaminski@cs.rwth-aachen.de Joost-Pieter Katoen Theoretical Foundations of the UML 5/32

Organization (contd.) Assignments: (almost) weekly assignments available from course web-site first assignment: Thursday April 21 hand in solution at start next exercise class groups of maximally two students first exercise class: Thursday April 28 Joost-Pieter Katoen Theoretical Foundations of the UML 6/32

Organization (contd.) Examination: (6 ECTS credit points) written exam: July XY, 2016 (tba) written re-exam: September WZ, 2016 (tba) Admission: at least 40% of exercise points Joost-Pieter Katoen Theoretical Foundations of the UML 7/32

Motivation Scope: Goal: formal description + analysis of (concurr.) software systems Focus: the Unified Modeling Language More specifically: Sequence Diagrams (used for requirements analysis) Propositional Dynamic Logic Communicating Finite State Automata Statecharts (behavioral description of systems) Aims: clarify and make precise the semantics of some UML fragments formal reasoning about basic properties of UML models convince you that UML models are much harder than you think Joost-Pieter Katoen Theoretical Foundations of the UML 8/32

What this course is NOT about: What is it **not** about? the use of the UML in the software development cycle see the complementary course by Prof. Rumpe other notations of the UML (e.g., class diagrams, activity diagrams) what is precisely in the UML, and what is not liberal interpretation of which constructs belong to the UML applying the UML to concrete SW development case studies empirical results on the usage of UML drawing pictures... Joost-Pieter Katoen Theoretical Foundations of the UML 9/32

Overview 1 Lecture 1: Introduction 2 Lecture 2: Message Sequence Charts Joost-Pieter Katoen Theoretical Foundations of the UML 10/32

Theoretical Foundations of the UML Lecture 2: Message Sequence Charts Joost-Pieter Katoen Lehrstuhl für Informatik 2 Software Modeling and Verification Group moves.rwth-aachen.de/teaching/ss-16/theoretical-foundations-of-the-uml/ 13. April 2016 Joost-Pieter Katoen Theoretical Foundations of the UML 11/32

History 70s - 80s: often used informally 1992: first version of MSCs standardized by CCITT (currently ITU) Z.120 1992-1996: many extensions, e.g., high-level + formal semantics (using process algebras) 1996: MSC 96 standard 2000: MSC 2000, time, data, o-o features 2005: MSC 2004... Joost-Pieter Katoen Theoretical Foundations of the UML 12/32

Variants of MSCs UML sequence diagrams (instantiations of) use cases triggered MSCs netcharts (= Petri net + MSC) STAIRS Live sequence charts... Joost-Pieter Katoen Theoretical Foundations of the UML 13/32

Characteristics scenario-based language visual representation easy to comprehend generalization possible towards automata (states are MSCs) widely used in industrial practice Joost-Pieter Katoen Theoretical Foundations of the UML 14/32

Applications requirements specification (positive, negative scenarios, e.g., CREWS) system design and software engineering visualization of test cases (graphical extension to TTCN) feature interaction detection workflow management systems... Joost-Pieter Katoen Theoretical Foundations of the UML 15/32

Example p 1 p 2 p 3 a b c d e These pictures are formalized using partial orders. Joost-Pieter Katoen Theoretical Foundations of the UML 16/32

Partial orders Definition Let E be a set of events. A partial order over E is a relation E E such that: 1 is reflexive, i.e., e E.e e, 2 is transitive, i.e., e e e e implies e e, and 3 is anti-symmetric, i.e., e,e.(e e e e) e = e. The pair (E, ) is called a partially ordered set (poset, for short). Definition Let (E, ) be a poset and let e,e E. e and e are comparable if e e or e e. Otherwise, they are incomparable. is a non-strict partial order as it is reflexive. A strict partial order is a relation that is irreflexive, transitive and asymmetric (i.e., if e e then not e e). Joost-Pieter Katoen Theoretical Foundations of the UML 17/32

Hasse diagram Definition Let (E, ) be a poset. The Hasse diagram (E, ) of (E, ) is defined by: e e iff e e and ( e e,e.e e e e ) Hasse diagrams can be used to visualize posets with finitely many elements in a succinct way. Joost-Pieter Katoen Theoretical Foundations of the UML 18/32

Linearizations Definition Let (E, ) be a poset. A linearization of (E, ) is a total order E E such that e e implies e e A linearization is a topological sort of the Hasse diagram of (E, ). Note that every partial order has at least one linearization. Joost-Pieter Katoen Theoretical Foundations of the UML 19/32

Example Example Let E = {e 1,...,e 6 }, = { (e 1,e 2 ),(e 1,e 3 ),(e 3,e 4 ),(e 4,e 5 ),(e 5,e 6 ),(e 1,e 4 ), (e 3,e 5 ),(e 1,e 5 ),(e 1,e 6 ),(e 3,e 6 ),(e 4,e 6 ) } r where R r denotes the reflexive closure of R Hasse diagram: e 1 e 2 e 3 e 4 e 5 e 6 Linearizations: e 1 e 2 e 3 e 4 e 5 e 6, e 1 e 3 e 2 e 4 e 5 e 6, e 1 e 3 e 4 e 2 e 5 e 6, e 1 e 3 e 4 e 5 e 2 e 6, e 1 e 3 e 4 e 5 e 6 e 2 No linearizations: e 2 e 1 e 3..., and e 1 e 4 e 3... Joost-Pieter Katoen Theoretical Foundations of the UML 20/32

Processes and actions Definition Let P: finite set of (sequential) processes C: finite set of message contents (a,b,c,... C) Definition Communication action: p,q P, p q, a C!(p,q,a) process p sends message a to process q?(p,q,a) process p receives message a sent by process q Let Act denote the set of communication actions Joost-Pieter Katoen Theoretical Foundations of the UML 21/32

Message Sequence Chart (MSC) (1) Definition An MSC M = (P,E,C,l,m, ) with: P, a finite set of processes {p 1,p 2,...,p n } with n > 1 E, a finite set of events E = E p = E? E! p P C, a finite set of message contents l : E Act, a labelling function defined by: {!(p,q,a) if e Ep E! l(e) =,for p q P, a C?(p,q,a) if e E p E? Joost-Pieter Katoen Theoretical Foundations of the UML 22/32

Message Sequence Chart (MSC) (2) Definition m : E! E? a bijection ( matching function ), satisfying: m(e) = e l(e) =!(p,q,a) implies l(e ) =?(q,p,a) (p q, a C) E E is a partial order ( visual order ) defined by: = ( {(e,m(e)) e E! } p P < p }{{} < p is a total order = top-tobottom order on process p }{{} communication order < c where for relation R, R denotes its reflexive and transitive closure. ) Joost-Pieter Katoen Theoretical Foundations of the UML 23/32

Example (1) MSC M: p 1 p 2 e 1 e 4 a b e 2 e 3 M = (P,E,C,l,m, ) with: P = {p 1,p 2 } E p1 = {e 1,e 4 } E = {e 1,e 2,e 3,e 4 } E p2 = {e 2,e 3 } C = {a,b} E! = {e 1,e 3 }, E? = {e 2,e 4 } l(e 1 ) =!(p 1,p 2,a) m(e 1 ) = e 2 l(e 2 ) =?(p 2,p 1,a) l(e 3 ) =!(p 2,p 1,b) m(e 3 ) = e 4 l(e 4 ) =?(p 1,p 2,b) Ordering at processes: e 1 < p1 e 4 and e 2 < p2 e 3 Hasse diagram of (E, ): Linearizations? e 1 e 2 e 3 e 4 Joost-Pieter Katoen Theoretical Foundations of the UML 24/32

Example (2) MSC M : p 1 p 2 e 1 e 4 a b e 3 e 2 M = (P,E,C,l,m, }{{} ) with: as above < c: e 1 e 3 e 2 e 4 : e 1 e 2 < p 1 : < p 2 : e 1 e 3 e 4 e 2 e 3 e 4 Joost-Pieter Katoen Theoretical Foundations of the UML 25/32

This is not an MSC p 1 p 2 a b Joost-Pieter Katoen Theoretical Foundations of the UML 26/32

FIFO property MSC M = (P, E, C, l, m, ) has the First-In-First-Out (FIFO) property whenever: for all e,e E! we have e e l(e) =!(p,q,a) l(e ) =!(p,q,b) implies m(e) m(e ) i.e., no message overtaking allowed p 1 p 2 e a b m(e) e m(e ) p 1 p 2 e a b m(e ) e m(e) FIFO non-fifo l(e) =!(p 1,p 2,a) l(e ) =!(p 1,p 2,b) e e m(e) m(e ) Note: We assume an MSC to possess the FIFO property, unless stated otherwise! Joost-Pieter Katoen Theoretical Foundations of the UML 27/32

Linearizations Definition Let Lin(M) = denote the set of linearizations of MSC M. MSCs and its linearizations are interchangeable There is a one-to-one correspondence between an MSC and its set of linearizations. Thus: Lin(M) uniquely characterizes the MSC M. From MSCs to its set of linearizations is straightforward. The reverse direction is discussed in the following. First: well-formedness. Joost-Pieter Katoen Theoretical Foundations of the UML 28/32

Well-formedness Let Ch := {(p,q) p q, p,q P} be the set of channels over P. We call w = a 1...a n Act proper if 1 every receive in w is preceded by a corresponding send, i.e.: (p,q) Ch and prefix u of w, we have: m C u!(p,q,m) }{{} # sends from p to q m C u?(q,p,m) }{{} # receipts by q from p where u a denotes the number of occurrences of action a in u 2 the FIFO policy is respected, i.e.: 1 i < j n, (p,q) Ch, and a i =!(p,q,m 1 ), a j =?(q,p,m 2 ): a 1...a i 1!(p,q,m) = a 1...a j 1?(q,p,m) implies m 1 = m 2 m C m C A proper word w is well-formed if m C w!(p,q,m) = m C w?(q,p,m) Joost-Pieter Katoen Theoretical Foundations of the UML 29/32

Properties of well-formedness Proposition For every MSC M and every w Lin(M), w is well-formed. Lin(M) denotes a set of words (and not linearizations) the word of linearization e 1...e n equals l(e 1 )...l(e n ) Joost-Pieter Katoen Theoretical Foundations of the UML 30/32

From linearizations to posets Associate to w = a 1...a n Act an Act-labelled poset M(w) = (E,,l) such that: E = {1,...,n} are the positions in w labelled with l(i) = a i Example = ( p P p msg ) where i p j if and only if i < j for every i,j E p i msg j if for some (p,q) Ch and m C we have: l(i) =!(p,q,m) and l(j) =?(q,p,m) and a 1...a i 1!(p,q,m) = a 1...a j 1?(q,p,m) m C m C construct M(w) for w =!(r,q,m)!(p,q,m 1)!(p,q,m 2)?(q,p,m 1)?(q,p,m 2)?(q,r,m) Joost-Pieter Katoen Theoretical Foundations of the UML 31/32

Properties Relating well-formed words to MSCs For every well-formed w Act, M(w) is an MSC. Definition (E,,l) and (E,,l ) are isomorphic if there exists a bijection f : E E such that e e iff f(e) f(e ) and l(e) = l (f(e)). Linearizations yield isomorphic MSCs For every well-formed w Act and w Lin(M(w)): M(w) and M(w ) are isomorphic. Joost-Pieter Katoen Theoretical Foundations of the UML 32/32