Week 9: Concurrent Computation Models

0.0(0)
studied byStudied by 0 people
full-widthCall with Kai
GameKnowt Play
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/39

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

40 Terms

1
New cards

4 properties of concurrent computation

- Non-termination (output may not be the focus of the program)

- Parallelism

- Interference

- Non-determinism

2
New cards

How is equivalence of 2 sequential programs defined?

2 sequential programs are equivalent if, and only if, for all inputs, the give all the same outputs

3
New cards

Why is it difficult to compare equivalence of concurrent programs?

Non-determinism and non-termination means we can't just compare the language of the programs

4
New cards

How can we compare behaviour of concurrent systems?

With the Calculus of Communicating Systems (CCS)!

5
New cards

What is Calculus of Communicating Systems (CCS)?

- An abstract model used to model concurrent systems

- Created by Robin Milner

6
New cards

What is a concurrent system?

A collection of processes

7
New cards

What is a process?

An independent agent that may

- perform internal activities in isolation, or

- interact with the environment to perform shared activities

8
New cards

What are the elements of the CCS?

- Actions (denoted a, b)

- Sequential composition (denoted a.b)

- Non-deterministic choice (denoted +)

- Terminal process (denoted 0)

9
New cards

CCS: Terminal process (0)

A terminated/inactive/deadlocked process

10
New cards

CCS: Action

A set of labels for actions A = N u N' u {τ} where N = set of all input actions, N' = set of all output actions, τ = internal action

11
New cards

CCS: Action prefixing

- Represents a sequence of actions

- For a process P and action a, a.P denotes a system ready to perform action and then it will behave as P

12
New cards

What does the notation a.P ->a P mean, for some action a and process P?

System a.P takes the action a, after which, it will behave as process P

13
New cards

CCS: Non-deterministic choice (+)

- For processes P and Q, P+Q denotes a choice between P and Q

- The system P+Q will either behave as P and discard Q, or behave as Q and discard P

14
New cards

CCS: Constants and recursion

- Constants defined with ::=

- Can be recursive e.g. C ::= tick.tock.C

15
New cards

What is a program?

A collection of process constants

16
New cards

How is concurrent behaviour modelled in CCS?

With parallel composition

17
New cards

CCS: Parallel composition

- For processes P and Q, write P|Q to denote that P and Q can run in parallel to one another

- Each process may proceed independently

- If a.P and a'.Q, P and Q may interact internally with ->τ

18
New cards

What is a CCS restriction?

Avoid unwanted process interaction with restricting action/co-action pairs

19
New cards

How is a CCS restriction denoted?

'v'

20
New cards

For a process P and action a, what does va.P mean?

- P cannot take the input action a or its output action a' from any external processes

- P can take a or a' internally

21
New cards

How can we represent CCS graphically?

With a Labelled Transition System (LTS)

22
New cards

How can LTS be denoted?

As a triple (P, A, {->a for all a in A})

23
New cards

For an LTS system denoted (P, A, {->a for all a in A}), what does the P represent?

P = set of processes

24
New cards

For an LTS system denoted (P, A, {->a for all a in A}), what does the A represent?

A = set of actions

25
New cards

For an LTS system denoted (P, A, {->a for all a in A}), what does the {->a for all a in A} represent?

{->a for all a in A} = the transition relation mapping processes to other processes

26
New cards

What are the nodes in an LTS?

Processes

27
New cards

What are the labels in an LTS?

Actions

28
New cards

What are the edges in an LTS?

A subset of PxP

29
New cards

How do we represent action prefixing (a.P ->a P) in an LTS?

Two nodes for a.P and P, and a directed edge from a.P to P labelled a

30
New cards

How do we represent non-deterministic choice (a.P + b.Q) in an LTS?

- A node for a.P + b.Q

- One directed edge from a.P + b.Q to P labelled a

- One directed edge from a.P + b.Q to Q labelled Q

31
New cards

How do we represent recursion (X ::= a.X) in an LTS?

One node for X, with a reflexive edge going back into itself labelled a

32
New cards

How do we represent parallel composition (a.P | b.Q) in an LTS?

- Start from node a.P | b.Q

- One directed edge from a.P | b.Q to node P | b.Q labelled a

- One directed edge from a.P | b.Q to node a.P | Q labelled b

- One directed edge from P | b.Q to P | Q labelled b

- One directed edge from a.P | Q to P | Q labelled a

33
New cards

How do we represent interaction of a and a' for parallel composition (a.P | a'.Q) in an LTS?

- Start from node a.P | a'.Q

- Same as for normal parallel composition with one extra directed edge from a.P | a'.Q to P | Q labelled τ

34
New cards

How do we represent a terminal process (0) in an LTS?

A single node for 0

35
New cards

How do we represent restriction (va. (a.P)) in an LTS?

A single node for va. (a.P)

36
New cards

How do we represent an internal interaction with a restriction in an LTS?

- One node for va. (a.A | a'.B)

- One directed edge from va. (a.A | a'.B) to va. (A | B)

37
New cards

How can we define equivalence of two concurrent processes?

Two concurrent processes are equivalent if and only if an external observer cannot tell their behaviour apart

38
New cards

What is another word for equivalence of two concurrent processes?

Bisimularity

39
New cards

What is a strong bisimulation (in mathematical terms)?

For two LTSes, a binary relation S that is a subset of PxP is a strong bisimulation if and only if whenever (P,Q) is in S, then for each action (excluding internal actions),

1. If P ->a P', then Q ->a Q' for some Q' such that (P',Q') is in S

2. If Q ->a Q', then P ->a P' for some P' such that (P',Q') is in S

40
New cards

What is a strong bisimulation (in layman's terms)?

Process equivalence should be based on observation: if process P is equivalent to process Q, then we should be able to perform the same actions with P and Q and obtain results that are equivalent.