Modelling and Verification Lecture 1 Lecturer: Luca Aceto - - PowerPoint PPT Presentation

modelling and verification
SMART_READER_LITE
LIVE PREVIEW

Modelling and Verification Lecture 1 Lecturer: Luca Aceto - - PowerPoint PPT Presentation

Organization of the Course Introduction Formal Models for Reactive Systems Introduction to CCS Modelling and Verification Lecture 1 Lecturer: Luca Aceto luca@ru.is or luca.aceto@gmail.com Lecture 1 Modelling and Verification Organization


slide-1
SLIDE 1

Organization of the Course Introduction Formal Models for Reactive Systems Introduction to CCS

Modelling and Verification

Lecture 1 Lecturer: Luca Aceto luca@ru.is or luca.aceto@gmail.com

Lecture 1 Modelling and Verification

slide-2
SLIDE 2

Organization of the Course Introduction Formal Models for Reactive Systems Introduction to CCS Overview Lectures and Tutorials/Exercise Sessions Exam and Literature

Focus of the Course

Study of mathematical models for the formal description and analysis of programs. Study of formal languages for the specification of program behaviour. Particular focus on parallel and reactive systems. Verification tools and implementation techniques underlying them.

Lecture 1 Modelling and Verification

slide-3
SLIDE 3

Organization of the Course Introduction Formal Models for Reactive Systems Introduction to CCS Overview Lectures and Tutorials/Exercise Sessions Exam and Literature

Overview of my part of the Course

Transition systems and CCS. Strong and weak bisimilarity, bisimulation games. Hennessy-Milner logic and bisimulation. Tarski’s fixed-point theorem. Hennessy-Milner logic with recursively defined formulae. Timed automata and their semantics (Luca Tesei). Binary decision diagrams and their use in verification (possibly). Two mini projects.

Lecture 1 Modelling and Verification

slide-4
SLIDE 4

Organization of the Course Introduction Formal Models for Reactive Systems Introduction to CCS Overview Lectures and Tutorials/Exercise Sessions Exam and Literature

Mini Projects

Putting the theory and tools into practice! Two Possibilities (to be taken with a pinch of salt) Verification of a communication protocol in CWB. Verification of an algorithm for mutual exclusion in UPPAAL. (Luca Tesi)

Lecture 1 Modelling and Verification

slide-5
SLIDE 5

Organization of the Course Introduction Formal Models for Reactive Systems Introduction to CCS Overview Lectures and Tutorials/Exercise Sessions Exam and Literature

Lectures

There will be lectures for about 7–8 weeks. Ask/answer questions. Be active! Take your own notes. Slides will be available before each lecture. Read the recommended literature as soon as possible after the lecture.

Lecture 1 Modelling and Verification

slide-6
SLIDE 6

Organization of the Course Introduction Formal Models for Reactive Systems Introduction to CCS Overview Lectures and Tutorials/Exercise Sessions Exam and Literature

Exercise Sessions

Three hours per week. When? Tuesday afternoons 15:00–18:00 Peer learning. Work in groups of 2 or 3 people. Print out the exercise list, bring literature and your notes. Be responsible for your own learning! Post and answer questions on the course blog. Post solutions to selected exercises and provide comments on the course blog. (5% of the mark for the course!)

Lecture 1 Modelling and Verification

slide-7
SLIDE 7

Organization of the Course Introduction Formal Models for Reactive Systems Introduction to CCS Overview Lectures and Tutorials/Exercise Sessions Exam and Literature

Exam and Literature

Exam = Celebration! Take me home, country roads. . . Literature Reactive Systems: Modelling, Specification and Verification (Cambridge University Press, July 2007) by Anna Ingolfsdottir, Kim G. Larsen, Jiri Srba and myself. Best Reader Competition with award!

Lecture 1 Modelling and Verification

slide-8
SLIDE 8

Organization of the Course Introduction Formal Models for Reactive Systems Introduction to CCS Overview Lectures and Tutorials/Exercise Sessions Exam and Literature

Hints

Check regularly the course web-page. Offer feedback to the lecturer. Attend, and actively participate in, the exercise sessions. Take your own notes. “I hear and I forget. I see and I remember. I do and I understand.” (Confucius, 551 BC–479 BC)

Lecture 1 Modelling and Verification

slide-9
SLIDE 9

Organization of the Course Introduction Formal Models for Reactive Systems Introduction to CCS Aims of the Course Reactive Systems Why Do We Need a Theory?

Aims of the Course

Present a general theory of reactive systems and its applications. The theory supports: Design. Specification. Verification (possibly automatic and compositional). Aims

1 Give the students practice in modelling parallel systems in a

formal framework.

2 Give the students skills in analyzing behaviours of reactive

systems.

3 Introduce algorithms and tools based on the modelling

formalisms.

Lecture 1 Modelling and Verification

slide-10
SLIDE 10

Organization of the Course Introduction Formal Models for Reactive Systems Introduction to CCS Aims of the Course Reactive Systems Why Do We Need a Theory?

Aims of the Course

Present a general theory of reactive systems and its applications. The theory supports: Design. Specification. Verification (possibly automatic and compositional). Aims

1 Give the students practice in modelling parallel systems in a

formal framework.

2 Give the students skills in analyzing behaviours of reactive

systems.

3 Introduce algorithms and tools based on the modelling

formalisms.

Lecture 1 Modelling and Verification

slide-11
SLIDE 11

Organization of the Course Introduction Formal Models for Reactive Systems Introduction to CCS Aims of the Course Reactive Systems Why Do We Need a Theory?

Aims of the Course

Present a general theory of reactive systems and its applications. The theory supports: Design. Specification. Verification (possibly automatic and compositional). Aims

1 Give the students practice in modelling parallel systems in a

formal framework.

2 Give the students skills in analyzing behaviours of reactive

systems.

3 Introduce algorithms and tools based on the modelling

formalisms.

Lecture 1 Modelling and Verification

slide-12
SLIDE 12

Organization of the Course Introduction Formal Models for Reactive Systems Introduction to CCS Aims of the Course Reactive Systems Why Do We Need a Theory?

Aims of the Course

Present a general theory of reactive systems and its applications. The theory supports: Design. Specification. Verification (possibly automatic and compositional). Aims

1 Give the students practice in modelling parallel systems in a

formal framework.

2 Give the students skills in analyzing behaviours of reactive

systems.

3 Introduce algorithms and tools based on the modelling

formalisms.

Lecture 1 Modelling and Verification

slide-13
SLIDE 13

Organization of the Course Introduction Formal Models for Reactive Systems Introduction to CCS Aims of the Course Reactive Systems Why Do We Need a Theory?

Classical View

Characterization of a Classical Program Program transforms an input into an output. Denotational semantics: a meaning of a program is a partial function states ֒ → states Nontermination is bad! In case of termination, the result is unique. Is this all we need?

Lecture 1 Modelling and Verification

slide-14
SLIDE 14

Organization of the Course Introduction Formal Models for Reactive Systems Introduction to CCS Aims of the Course Reactive Systems Why Do We Need a Theory?

Classical View

Characterization of a Classical Program Program transforms an input into an output. Denotational semantics: a meaning of a program is a partial function states ֒ → states Nontermination is bad! In case of termination, the result is unique. Is this all we need?

Lecture 1 Modelling and Verification

slide-15
SLIDE 15

Organization of the Course Introduction Formal Models for Reactive Systems Introduction to CCS Aims of the Course Reactive Systems Why Do We Need a Theory?

Reactive systems

What about: Operating systems? Communication protocols? Control programs? Mobile phones? Vending machines?

Lecture 1 Modelling and Verification

slide-16
SLIDE 16

Organization of the Course Introduction Formal Models for Reactive Systems Introduction to CCS Aims of the Course Reactive Systems Why Do We Need a Theory?

Reactive systems

Characterization of a Reactive System Reactive System = system that computes by reacting to stimuli from its environment. Key Issues: communication and interaction parallelism Nontermination is good! The result (if any) does not have to be unique.

Lecture 1 Modelling and Verification

slide-17
SLIDE 17

Organization of the Course Introduction Formal Models for Reactive Systems Introduction to CCS Aims of the Course Reactive Systems Why Do We Need a Theory?

Reactive systems

Characterization of a Reactive System Reactive System = system that computes by reacting to stimuli from its environment. Key Issues: communication and interaction parallelism Nontermination is good! The result (if any) does not have to be unique.

Lecture 1 Modelling and Verification

slide-18
SLIDE 18

Organization of the Course Introduction Formal Models for Reactive Systems Introduction to CCS Aims of the Course Reactive Systems Why Do We Need a Theory?

Analysis of Reactive Systems

Questions How can we develop (design) a system that ”works”? How do we analyze (verify) such a system? Fact of Life Even short parallel programs may be hard to analyze.

Lecture 1 Modelling and Verification

slide-19
SLIDE 19

Organization of the Course Introduction Formal Models for Reactive Systems Introduction to CCS Aims of the Course Reactive Systems Why Do We Need a Theory?

The Need for a Theory

Conclusion We need formal/systematic methods (tools), otherwise ... Intel’s Pentium-II bug in floating-point division unit Ariane-5 crash due to a conversion of 64-bit real to 16-bit integer Mars Pathfinder ...

Lecture 1 Modelling and Verification

slide-20
SLIDE 20

Organization of the Course Introduction Formal Models for Reactive Systems Introduction to CCS Aims of the Course Reactive Systems Why Do We Need a Theory?

Classical vs. Reactive Computing

Classical Reactive/Parallel interaction no yes nontermination undesirable

  • ften desirable

unique result yes no semantics states ֒ → states ?

Lecture 1 Modelling and Verification

slide-21
SLIDE 21

Organization of the Course Introduction Formal Models for Reactive Systems Introduction to CCS Motivation Labelled Transition Systems Notation

How to Model Reactive Systems

Question What is the most basic view of a reactive system (process)?

Lecture 1 Modelling and Verification

slide-22
SLIDE 22

Organization of the Course Introduction Formal Models for Reactive Systems Introduction to CCS Motivation Labelled Transition Systems Notation

How to Model Reactive Systems

Question What is the most basic view of a reactive system (process)? Answer A process performs an action and becomes another process.

Lecture 1 Modelling and Verification

slide-23
SLIDE 23

Organization of the Course Introduction Formal Models for Reactive Systems Introduction to CCS Motivation Labelled Transition Systems Notation

Labelled Transition Systems

Definition A labelled transition system (LTS) is a triple (Proc, Act, {

a

− →| a ∈ Act}) where Proc is a set of states (or processes), Act is a set of labels (or actions), and

a

− → ⊆ Proc × Proc is a binary relation on states called the transition relation, for each a ∈ Act. We will use the infix notation s

a

− → s′ meaning that (s, s′) ∈

a

− →. Sometimes we distinguish an initial (or start) state.

Lecture 1 Modelling and Verification

slide-24
SLIDE 24

Organization of the Course Introduction Formal Models for Reactive Systems Introduction to CCS Motivation Labelled Transition Systems Notation

Keyword: Interaction!

LTSes describe process behaviour, and explicitly focus on interaction. The Motto (after Tony Hoare and Robin Milner) Everything is (or can be viewed as) a process! Buffers, shared memory, Linda tuple spaces, senders, receivers, . . . are all agents/processes.

Lecture 1 Modelling and Verification

slide-25
SLIDE 25

Organization of the Course Introduction Formal Models for Reactive Systems Introduction to CCS Motivation Labelled Transition Systems Notation

Labelled Transition Systems – Notation

Let (Proc, Act, {

a

− →| a ∈ Act}) be an LTS. We extend

a

− → to the elements of Act∗. − →=

a∈Act a

− → − →∗ is the reflexive and transitive closure of − →. (Do you know what this means?) s

a

− → and s a − →. Reachable states.

Lecture 1 Modelling and Verification

slide-26
SLIDE 26

Organization of the Course Introduction Formal Models for Reactive Systems Introduction to CCS Calculus of Communicating Systems Process Algebra CCS Intuitively

How to Describe LTSes?

Syntax unknown entity − → Semantics known entity programming language − → what (denotational) or how (operational) it computes ??? − → Labelled Transition Systems CCS (Milner 1980)

Lecture 1 Modelling and Verification

slide-27
SLIDE 27

Organization of the Course Introduction Formal Models for Reactive Systems Introduction to CCS Calculus of Communicating Systems Process Algebra CCS Intuitively

How to Describe LTSes?

Syntax unknown entity − → Semantics known entity programming language − → what (denotational) or how (operational) it computes ??? − → Labelled Transition Systems CCS (Milner 1980)

Lecture 1 Modelling and Verification

slide-28
SLIDE 28

Organization of the Course Introduction Formal Models for Reactive Systems Introduction to CCS Calculus of Communicating Systems Process Algebra CCS Intuitively

How to Describe LTSes?

Syntax unknown entity − → Semantics known entity programming language − → what (denotational) or how (operational) it computes ??? − → Labelled Transition Systems CCS (Milner 1980)

Lecture 1 Modelling and Verification

slide-29
SLIDE 29

Organization of the Course Introduction Formal Models for Reactive Systems Introduction to CCS Calculus of Communicating Systems Process Algebra CCS Intuitively

How to Describe LTSes?

Syntax unknown entity − → Semantics known entity programming language − → what (denotational) or how (operational) it computes ??? − → Labelled Transition Systems CCS (Milner 1980)

Lecture 1 Modelling and Verification

slide-30
SLIDE 30

Organization of the Course Introduction Formal Models for Reactive Systems Introduction to CCS Calculus of Communicating Systems Process Algebra CCS Intuitively

Calculus of Communicating Systems

CCS Process algebra called “Calculus of Communicating Systems”. Insight of Robin Milner (1980, developed from earlier work) Concurrent (parallel) processes have an algebraic structure. P1 op P2 ⇒ P1 op P2

Lecture 1 Modelling and Verification

slide-31
SLIDE 31

Organization of the Course Introduction Formal Models for Reactive Systems Introduction to CCS Calculus of Communicating Systems Process Algebra CCS Intuitively

Process Algebra

Basic Principle

1 Define a few atomic processes (modelling the simplest process

behaviour).

2 Define new composition operations (building more complex

process behaviour from simpler ones). Example

1 atomic instruction: assignment (e.g. x:=2 and x:=x+2) 2 new operators:

sequential composition (P1; P2) parallel composition (P1 | | P2)

Now e.g. (x:=1 | | x:=2); x:=x+2; (x:=x-1 | | x:=x+5) is a process.

Lecture 1 Modelling and Verification

slide-32
SLIDE 32

Organization of the Course Introduction Formal Models for Reactive Systems Introduction to CCS Calculus of Communicating Systems Process Algebra CCS Intuitively

Process Algebra

Basic Principle

1 Define a few atomic processes (modelling the simplest process

behaviour).

2 Define new composition operations (building more complex

process behaviour from simpler ones). Example

1 atomic instruction: assignment (e.g. x:=2 and x:=x+2) 2 new operators:

sequential composition (P1; P2) parallel composition (P1 | | P2)

Now e.g. (x:=1 | | x:=2); x:=x+2; (x:=x-1 | | x:=x+5) is a process.

Lecture 1 Modelling and Verification

slide-33
SLIDE 33

Organization of the Course Introduction Formal Models for Reactive Systems Introduction to CCS Calculus of Communicating Systems Process Algebra CCS Intuitively

A CCS Process: Black-Box View

What is a CCS Process to its Environment? A CCS process is a computing agent that may communicate with its environment via its interface. Interface = Collection of communication ports/channels, together with an indication of whether they are used for input or output. Example: A Computer Scientist Process interface: coffee (input port) coin, pub (output ports) Question: How do we describe the behaviour of the “black-box”?

Lecture 1 Modelling and Verification

slide-34
SLIDE 34

Organization of the Course Introduction Formal Models for Reactive Systems Introduction to CCS Calculus of Communicating Systems Process Algebra CCS Intuitively

A CCS Process: Black-Box View

What is a CCS Process to its Environment? A CCS process is a computing agent that may communicate with its environment via its interface. Interface = Collection of communication ports/channels, together with an indication of whether they are used for input or output. Example: A Computer Scientist Process interface: coffee (input port) coin, pub (output ports) Question: How do we describe the behaviour of the “black-box”?

Lecture 1 Modelling and Verification

slide-35
SLIDE 35

Organization of the Course Introduction Formal Models for Reactive Systems Introduction to CCS Calculus of Communicating Systems Process Algebra CCS Intuitively

CCS Basics (Sequential Fragment)

Nil (or 0) process (the only atomic process) action prefixing (a.P) names and recursive definitions (def =) nondeterministic choice (+) This is Enough to Describe Sequential Processes Any finite LTS can be described (up to isomorphism) by using the

  • perations above.

Lecture 1 Modelling and Verification

slide-36
SLIDE 36

Organization of the Course Introduction Formal Models for Reactive Systems Introduction to CCS Calculus of Communicating Systems Process Algebra CCS Intuitively

CCS Basics (Sequential Fragment)

Nil (or 0) process (the only atomic process) action prefixing (a.P) names and recursive definitions (def =) nondeterministic choice (+) This is Enough to Describe Sequential Processes Any finite LTS can be described (up to isomorphism) by using the

  • perations above.

Lecture 1 Modelling and Verification