COMP30112: Concurrency Introduction to Course & Introduction to - - PowerPoint PPT Presentation

comp30112 concurrency
SMART_READER_LITE
LIVE PREVIEW

COMP30112: Concurrency Introduction to Course & Introduction to - - PowerPoint PPT Presentation

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I COMP30112: Concurrency Introduction to Course & Introduction to FSP Howard Barringer Room KB2.20: email: Howard.Barringer@manchester.ac.uk February 2009 Topic 1: Introduction


slide-1
SLIDE 1

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

COMP30112: Concurrency

Introduction to Course & Introduction to FSP

Howard Barringer

Room KB2.20: email: Howard.Barringer@manchester.ac.uk

February 2009

slide-2
SLIDE 2

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Acknowledgement

The course material is largely based on that of: Concurrency: State Models and Java Programs Profs Jeff Magee and Jeff Kramer

  • f Imperial College, Dept of Computing, London.
slide-3
SLIDE 3

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Acknowledgement

The course material is largely based on that of: Concurrency: State Models and Java Programs Profs Jeff Magee and Jeff Kramer

  • f Imperial College, Dept of Computing, London.

Many thanks to all concerned.

slide-4
SLIDE 4

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Contents

Topic 1: Introduction General Background On Concurrency Examples Implementation Topic 2: Modelling Processes with FSP - I Labelled Transition Systems FSP: Basic Elements Summary

slide-5
SLIDE 5

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Outline

Topic 1: Introduction General Background On Concurrency Examples Implementation Topic 2: Modelling Processes with FSP - I Labelled Transition Systems FSP: Basic Elements Summary

slide-6
SLIDE 6

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Course Structure and Topics

Lectures Topic 1 Introduction and Overview 5 FSP: Modelling Processes 5 Properties: Safety, liveness 2 Process Equality 2 Java Threads 6 Concurrency Patterns: Mutual Exclusion Monitors+Semaphores Producers/Consumers Readers/Writers GUIs Termination 1 Revision

slide-7
SLIDE 7

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

General Comments

  • Some concepts familiar from COMP20051 and COMP20081
  • We follow much of Magee and Kramer, but more on modelling
  • Java ≃ COMP20051
  • Java used to illustrate — BUT this is NOT a programming

course

slide-8
SLIDE 8

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Supporting and Background Material

Books

Jeff Magee and Jeff Kramer. Concurrency: State Models and Java Programs. 2nd Edition, Wiley, 2006.

  • L. Aceto, A Ing´
  • lfsd´
  • ttir, K. Larsen and J Srba. Reactive

Systems: Modelling, Specification and Verification. Cambridge University Press, 2007.

  • R. Milner. Communication and Concurrency. Prentice-Hall,

1989. C.A.R. Hoare. Communicating Sequential Processes. Prentice-Hall, 1985.

LTSA: Magee and Kramer’s modelling and analysis tool (associated with book) Exercises: offline and in lectures Lecture Slides: hardcopy and PDF Notes on FSP

slide-9
SLIDE 9

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Assessment

Two-hour examination

slide-10
SLIDE 10

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Outline

Topic 1: Introduction General Background On Concurrency Examples Implementation Topic 2: Modelling Processes with FSP - I Labelled Transition Systems FSP: Basic Elements Summary

slide-11
SLIDE 11

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

What is Concurrency?

A set of sequential programs executed in abstract parallelism

slide-12
SLIDE 12

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

What is Concurrency?

A set of sequential programs executed in abstract parallelism

  • thread [of control]
  • multi-threading
  • light-weight threads
slide-13
SLIDE 13

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

What is Concurrency?

A set of sequential programs executed in abstract parallelism

  • thread [of control]
  • multi-threading
  • light-weight threads
  • parallel processing
slide-14
SLIDE 14

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

What is Concurrency?

A set of sequential programs executed in abstract parallelism

  • thread [of control]
  • multi-threading
  • light-weight threads
  • parallel processing
  • multi-processing
  • multi-tasking
slide-15
SLIDE 15

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

What is Concurrency?

A set of sequential programs executed in abstract parallelism

  • thread [of control]
  • multi-threading
  • light-weight threads
  • parallel processing
  • multi-processing
  • multi-tasking
  • shared memory
  • protected work-space
slide-16
SLIDE 16

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

What is Concurrency?

A set of sequential programs executed in abstract parallelism

  • thread [of control]
  • multi-threading
  • light-weight threads
  • parallel processing
  • multi-processing
  • multi-tasking
  • shared memory
  • protected work-space
  • message-passing

(synchronous or asynchronous)

slide-17
SLIDE 17

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Why use Concurrency?

slide-18
SLIDE 18

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Why use Concurrency?

  • many processes often closely models application
slide-19
SLIDE 19

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Why use Concurrency?

  • many processes often closely models application
  • sometimes closely fits intuition, a good abstraction
slide-20
SLIDE 20

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Why use Concurrency?

  • many processes often closely models application
  • sometimes closely fits intuition, a good abstraction
  • performance issues
slide-21
SLIDE 21

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Why use Concurrency?

  • many processes often closely models application
  • sometimes closely fits intuition, a good abstraction
  • performance issues
  • increased responsiveness and throughput (esp. GUIs)
slide-22
SLIDE 22

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Why is concurrency hard?

slide-23
SLIDE 23

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Why is concurrency hard?

  • algorithm development
slide-24
SLIDE 24

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Why is concurrency hard?

  • algorithm development
  • efficiency and performance
slide-25
SLIDE 25

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Why is concurrency hard?

  • algorithm development
  • efficiency and performance
  • simulation and testing: NON DETERMINISM
slide-26
SLIDE 26

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Why is concurrency hard?

  • algorithm development
  • efficiency and performance
  • simulation and testing: NON DETERMINISM
  • analysis of properties: deadlock, livelock, fairness, liveness,

etc.

slide-27
SLIDE 27

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Why is concurrency hard?

  • algorithm development
  • efficiency and performance
  • simulation and testing: NON DETERMINISM
  • analysis of properties: deadlock, livelock, fairness, liveness,

etc. We will consider: Modelling, Analysis and Implementation (in Java)

slide-28
SLIDE 28

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Outline

Topic 1: Introduction General Background On Concurrency Examples Implementation Topic 2: Modelling Processes with FSP - I Labelled Transition Systems FSP: Basic Elements Summary

slide-29
SLIDE 29

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Example: Mutual Exclusion

Design a basic control protocol to ensure two processes never execute some “critical” region of program together. Is it OK?

slide-30
SLIDE 30

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Example: The Firing Squad Synchronisation Problem

  • On the command “FIRE”, the chain of control units must

mutually synchronise to fire each gun simultaneously.

  • The control units must be identical and work for any size

chain of artillery.

slide-31
SLIDE 31

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Example: The Firing Squad Synchronisation Problem

  • On the command “FIRE”, the chain of control units must

mutually synchronise to fire each gun simultaneously.

  • The control units must be identical and work for any size

chain of artillery.

slide-32
SLIDE 32

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Example: The Firing Squad Synchronisation Problem

  • On the command “FIRE”, the chain of control units must

mutually synchronise to fire each gun simultaneously.

  • The control units must be identical and work for any size

chain of artillery.

slide-33
SLIDE 33

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Modelling Concurrency

slide-34
SLIDE 34

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Modelling Concurrency

  • a ‘simplified’ representation of the real world?
slide-35
SLIDE 35

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Modelling Concurrency

  • a ‘simplified’ representation of the real world?
  • modelling before implementing
slide-36
SLIDE 36

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Modelling Concurrency

  • a ‘simplified’ representation of the real world?
  • modelling before implementing
  • model captures interesting aspects: concurrency
  • animation
  • analysis
slide-37
SLIDE 37

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Modelling Concurrency

  • a ‘simplified’ representation of the real world?
  • modelling before implementing
  • model captures interesting aspects: concurrency
  • animation
  • analysis
  • Model Description Language: FSP (Finite State Processes)
  • Models: LTS (Labelled Transition Systems)
slide-38
SLIDE 38

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Example: Cruise Control System

  • Does it do what we expect? Is it safe?
slide-39
SLIDE 39

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

FSP: Animation

INPUTSPEED = ( engineOn -> CHECKSPEED ), CHECKSPEED = ( speed -> CHECKSPEED | engineOff -> INPUTSPEED ).

slide-40
SLIDE 40

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Structure Diagrams

SENSOR SCAN CRUISE CONTROLLER SPEED CONTROL INPUT SPEED THROTTLE CONTROL

speed Sensors setThrottle Engine Prompts

set Sensors = {engineOn,engineOff,on,off, resume, brake, accelerator} set Engine = {engineOn,engineOff} set Prompts = {clearSpeed,recordSpeed, enableControl,disableControl}

slide-41
SLIDE 41

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Outline

Topic 1: Introduction General Background On Concurrency Examples Implementation Topic 2: Modelling Processes with FSP - I Labelled Transition Systems FSP: Basic Elements Summary

slide-42
SLIDE 42

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Implementation in Java

  • Thread class; Runnable interface
  • starting, stopping, suspending threads
  • mutual exclusion: synchronized methods and code blocks
  • monitors, condition synchronization
  • wait, notify, notifyAll
  • sleep, interrupt
  • suspend, resume, stop
  • properties: safety, liveness
slide-43
SLIDE 43

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Outline

Topic 1: Introduction General Background On Concurrency Examples Implementation Topic 2: Modelling Processes with FSP - I Labelled Transition Systems FSP: Basic Elements Summary

slide-44
SLIDE 44

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Labelled Transition Systems

What is an LTS?: LTS = (S, A, σ, s0) where S : set of states S A : alphabet A ⊆ Act σ : transition relation σ ⊆ (S × A × S) s0 initial state s0 ∈ S Act is our set of atomic transition labels, or actions.

slide-45
SLIDE 45

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

First Exercise

DAY1: A Day In the Life Of:

  • Get up — action: up,
  • then have a cup of tea — action: tea
  • then work — action: work

⋆ LTS for DAY1? ⋆

slide-46
SLIDE 46

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

First Exercise

DAY1: A Day In the Life Of:

  • Get up — action: up,
  • then have a cup of tea — action: tea
  • then work — action: work

⋆ LTS for DAY1? ⋆

  • DAY2: Now repeat the Day

⋆ LTS for DAY2? ⋆

slide-47
SLIDE 47

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

First Exercise

DAY1: A Day In the Life Of:

  • Get up — action: up,
  • then have a cup of tea — action: tea
  • then work — action: work

⋆ LTS for DAY1? ⋆

  • DAY2: Now repeat the Day

⋆ LTS for DAY2? ⋆

  • DAY3: Now be able to choose coffee — action: coffee —

instead of tea ⋆ LTS for DAY3? ⋆

slide-48
SLIDE 48

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

FSP: A Textual Representation for LTS

FSP - Finite State Processes What FSP Constructs Are Required??

  • sequence
slide-49
SLIDE 49

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

FSP: A Textual Representation for LTS

FSP - Finite State Processes What FSP Constructs Are Required??

  • sequence
  • STOP
slide-50
SLIDE 50

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

FSP: A Textual Representation for LTS

FSP - Finite State Processes What FSP Constructs Are Required??

  • sequence
  • STOP
  • process definition, with recursion
slide-51
SLIDE 51

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

FSP: A Textual Representation for LTS

FSP - Finite State Processes What FSP Constructs Are Required??

  • sequence
  • STOP
  • process definition, with recursion
  • choice
slide-52
SLIDE 52

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Outline

Topic 1: Introduction General Background On Concurrency Examples Implementation Topic 2: Modelling Processes with FSP - I Labelled Transition Systems FSP: Basic Elements Summary

slide-53
SLIDE 53

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Action Prefix

If x is an action and P is a process then (x->P) describes a process that initially engages in the action x and then behaves exactly as described by P. (once->STOP). Convention:

  • actions begin with a lower case letter
  • PROCESS NAMES begin with an upper case letter
  • STOP is a specially pre-defined FSP process name.
slide-54
SLIDE 54

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Action Prefix

If x is an action and P is a process then (x->P) describes a process that initially engages in the action x and then behaves exactly as described by P. (once->STOP). Convention:

  • actions begin with a lower case letter
  • PROCESS NAMES begin with an upper case letter
  • STOP is a specially pre-defined FSP process name.

⋆ FSP for DAY1? ⋆

slide-55
SLIDE 55

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Process Definition

Basic form: ProcId = process expression The meaning of ProcId will be given by the meaning of process expression. ProcId should start with an upper-case letter. (more complex forms possible — see later. . . )

slide-56
SLIDE 56

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Process Definition

Basic form: ProcId = process expression The meaning of ProcId will be given by the meaning of process expression. ProcId should start with an upper-case letter. (more complex forms possible — see later. . . ) ⋆ FSP for DAY2? ⋆

slide-57
SLIDE 57

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Choice

  • If x and y are actions then (x->P | y->Q) describes a process

which initially engages in either of the actions x or y.

  • After that the subsequent behaviour is described by
  • P if the first action was x,
  • Q if the first action was y.
slide-58
SLIDE 58

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Choice

  • If x and y are actions then (x->P | y->Q) describes a process

which initially engages in either of the actions x or y.

  • After that the subsequent behaviour is described by
  • P if the first action was x,
  • Q if the first action was y.

⋆ FSP for DAY3? ⋆

slide-59
SLIDE 59

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Example: Various Switches

Repetitive behaviour uses recursion: SWITCH = OFF, OFF = (on->ON), ON = (off->OFF).

slide-60
SLIDE 60

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Example: Various Switches

Repetitive behaviour uses recursion: SWITCH = OFF, OFF = (on->ON), ON = (off->OFF). Substituting to get a more concise definition: SWITCH = OFF, OFF = (on->off->OFF).

slide-61
SLIDE 61

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Example: Various Switches

Repetitive behaviour uses recursion: SWITCH = OFF, OFF = (on->ON), ON = (off->OFF). Substituting to get a more concise definition: SWITCH = OFF, OFF = (on->off->OFF). And again: SWITCH = (on->off->SWITCH).

slide-62
SLIDE 62

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Example: Various Switches

Repetitive behaviour uses recursion: SWITCH = OFF, OFF = (on->ON), ON = (off->OFF). Substituting to get a more concise definition: SWITCH = OFF, OFF = (on->off->OFF). And again: SWITCH = (on->off->SWITCH). ⋆ Are these FSP SWITCH definitions the same? ⋆

slide-63
SLIDE 63

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Example: Traffic Light

FSP model of a traffic light: TRAFFICLIGHT = (red->amber->green

  • >amber->TRAFFICLIGHT).
slide-64
SLIDE 64

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Example: Traffic Light

FSP model of a traffic light: TRAFFICLIGHT = (red->amber->green

  • >amber->TRAFFICLIGHT).

⋆ LTS generated using LTSA? ⋆

slide-65
SLIDE 65

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Example: Traffic Light

FSP model of a traffic light: TRAFFICLIGHT = (red->amber->green

  • >amber->TRAFFICLIGHT).

⋆ LTS generated using LTSA? ⋆ ⋆ Trace? ⋆

slide-66
SLIDE 66

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Example: Traffic Light

FSP model of a traffic light: TRAFFICLIGHT = (red->amber->green

  • >amber->TRAFFICLIGHT).

⋆ LTS generated using LTSA? ⋆ ⋆ Trace? ⋆ red->amber->green->amber->red ->amber->green-> · · ·

slide-67
SLIDE 67

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Example: Vending Machine

FSP model of a drinks machine: DRINKS = (red->coffee->DRINKS | blue->tea->DRINKS ).

slide-68
SLIDE 68

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Example: Vending Machine

FSP model of a drinks machine: DRINKS = (red->coffee->DRINKS | blue->tea->DRINKS ). ⋆ LTS generated using LTSA? ⋆

slide-69
SLIDE 69

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Example: Vending Machine

FSP model of a drinks machine: DRINKS = (red->coffee->DRINKS | blue->tea->DRINKS ). ⋆ LTS generated using LTSA? ⋆ ⋆ Possible traces? ⋆

slide-70
SLIDE 70

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Non-Deterministic Choice

Process (x->P | x->Q) describes a process which engages in x and then behaves as either P or Q. COIN = (toss->HEADS | toss->TAILS), HEADS = (heads->COIN), TAILS = (tails->COIN). Tossing a coin

slide-71
SLIDE 71

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Non-Deterministic Choice

Process (x->P | x->Q) describes a process which engages in x and then behaves as either P or Q. COIN = (toss->HEADS | toss->TAILS), HEADS = (heads->COIN), TAILS = (tails->COIN). Tossing a coin ⋆ Possible traces? ⋆

slide-72
SLIDE 72

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Indexed Processes and Actions

Single slot buffer that inputs a value in the range 0 to 3 and then

  • utputs a value:

BUFF = (in[i : 0..3]->out[i]->BUFF). equivalent to

slide-73
SLIDE 73

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Indexed Processes and Actions

Single slot buffer that inputs a value in the range 0 to 3 and then

  • utputs a value:

BUFF = (in[i : 0..3]->out[i]->BUFF). equivalent to BUFF = (in[0]->out[0]->BUFF |in[1]->out[1]->BUFF |in[2]->out[2]->BUFF |in[3]->out[3]->BUFF ).

slide-74
SLIDE 74

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

  • r using a constant and indexed process BUFF[i]:

const N = 3 BUFF = (in[i : 0..N]->BUFF[i]), BUFF[i : 0..N] = (out[i]->BUFF).

  • r using a process parameter with default value:

BUFF(N = 3) = (in[i : 0..N]->out[i]->BUFF).

slide-75
SLIDE 75

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Guarded Actions

The choice (when B x->P | y->Q) describes a process that is like (x->P | y->Q) except that the action x can only be chosen when the guard B is true.

slide-76
SLIDE 76

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Example: A Counter

COUNT(N = 3) = COUNT[0], COUNT[i : 0..N] = (when (i < N) inc->COUNT[i + 1] |when (i > 0) dec->COUNT[i − 1] ).

slide-77
SLIDE 77

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Example: A Countdown Timer

A countdown timer which beeps after N ticks, or can be stopped. COUNTDOWN(N = 3) = (start->COUNTDOWN[N]), COUNTDOWN[i : 0..N] = (when (i > 0) tick

  • >COUNTDOWN[i − 1]

|when (i == 0) beep->STOP |stop->STOP ).

slide-78
SLIDE 78

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Example: A Countdown Timer

A countdown timer which beeps after N ticks, or can be stopped. COUNTDOWN(N = 3) = (start->COUNTDOWN[N]), COUNTDOWN[i : 0..N] = (when (i > 0) tick

  • >COUNTDOWN[i − 1]

|when (i == 0) beep->STOP |stop->STOP ). ⋆ LTS? ⋆

slide-79
SLIDE 79

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Example: What is this?

⋆ What is the following FSP process equivalent to? ⋆ const False = 0 P = (when (False) doanything -> P).

slide-80
SLIDE 80

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Constant and Range Declarations

index expressions to model a calculation: const N = 1 range T = 0..N range R = 0..2*N SUM = (in[a:T][b:T] -> TOTAL[a+b]), TOTAL[s:R] = (out[s] -> SUM).

slide-81
SLIDE 81

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Constant and Range Declarations

index expressions to model a calculation: const N = 1 range T = 0..N range R = 0..2*N SUM = (in[a:T][b:T] -> TOTAL[a+b]), TOTAL[s:R] = (out[s] -> SUM). ⋆ Write SUM using basic FSP? ⋆

slide-82
SLIDE 82

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Process Alphabets

  • The alphabet of a process is the set of actions in which it is

allowed to engage.

  • This is usually determined implicitly as the actions in which it

can engage.

  • But the implicit alphabet can be extended:

WRITER = (write[1]->write[3]->WRITER) +{write[0..3]}. The alphabet of WRITER is the set {write[0..3]}; i.e. the set {write[0], write[1], write[2], write[3]}.

slide-83
SLIDE 83

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Outline

Topic 1: Introduction General Background On Concurrency Examples Implementation Topic 2: Modelling Processes with FSP - I Labelled Transition Systems FSP: Basic Elements Summary

slide-84
SLIDE 84

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

FSP: Summary

Forms of process expression Examples prefix action (coffee->DRINKS) guarded action (when (i == 0) beep->STOP) deterministic choice (red->COFFEE | blue->TEA) non-deterministic choice (toss->HEADS | toss->TAILS) dependent process (out[i]->BUFF) indexed choice (in[i : 0..3]->BUFF[i]) process name DRINKS, BUFF[i]

slide-85
SLIDE 85

Topic 1: Introduction Topic 2: Modelling Processes with FSP - I

Process equation: process name = process expression Process definition:                        declarations main process equation, local process equation, . . . local process equation, local process equation.