27
Process Algebra (2IF45) Assignments Dr. Suzana Andova

Process Algebra (2IF45) Assignments

Embed Size (px)

DESCRIPTION

Process Algebra (2IF45) Assignments. Dr. Suzana Andova. Groups (almost final). Group 5. Oerlemans, G.G.    0607213, Panhuijzen, I.W.F. 0570999, Poppelaars, J.J.G.  0518740 Joost van Twist J. 0617198 Group 6. - PowerPoint PPT Presentation

Citation preview

Page 1: Process Algebra (2IF45) Assignments

Process Algebra (2IF45)

Assignments

Dr. Suzana Andova

Page 2: Process Algebra (2IF45) Assignments

2

Groups (almost final)

Process Algebra (2IF45)

Group 1. Stijn Fleuren, Jori Selen, John van Heur, Jordi Timmermans

Group 2. Nicky Gerritsen 0595838,Kevin van der Pol 0620300,

Group 3.

Group4. Luis Avila 0754588Pablo Puente 0761739

Group 5. Oerlemans, G.G.    0607213, Panhuijzen, I.W.F. 0570999, Poppelaars, J.J.G.  0518740Joost van Twist J. 0617198

Group 6. Johan Hendriks, 0588920Bas van der Oest, 0588728Roy van Doormaal, 0668932Peter Klerks, 0593253

Group 7. Tal Yosefa Milea (0757073), Sjoerd te Pas (0663210), Twan Vermeulen (0732529), Ahmed Ibrahim (0718605)

NOTE: Not all groups and students are listed here

Page 3: Process Algebra (2IF45) Assignments

3

Details regarding the assignments

Process Algebra (2IF45)

1. Assignments are not compulsory. You may chose to do the assignments, thus making it part of your final grade. Or you could chose to go only to the written exam. Advantages to do the assignments are:

• a part of the written exams will be covered by the assignments. • you will get deeper insight in the material• you will prepare for the (your “relaxed”) written part of the exam as a side (positive) effect• it may be that the assignments will be more extensive questions than those given at the exam, but you can work in a team and discuss it and learn more. Also you will have more time to think about a solution. • possibility to earn bonus points

2. The final grade will be calculated 40% from the assignment grade + 60% from the written exam.

3. The assignment will consists out of 3 smaller assignments, 1st related to SOS and axioms, 2nd process specification, and 3rd probabilistic/stochastic specification

Page 4: Process Algebra (2IF45) Assignments

4

Details regarding the assignments

Process Algebra (2IF45)

4. Way of working: Students within a group have to organize the work themselves. Each student has to be actively involved, from the beginning till the end.

5. Finalization of an assignment's part: For each assignment a strict deadline will be defined. A group delivers the solution, which they later defend. Defense will include all students from the group.

6. Assignments schedule: 1st: March 2nd April3rd May

They are obtained the first week of the corresponding month, to be delivered at the end of the month.

7. Assessment: The assignment grade will be based on: the quality of the delivered solution, the defense and peer-to-peer assessment of team members. Thus each student gets own grade.

Page 5: Process Algebra (2IF45) Assignments

5

Details regarding the assignments

Process Algebra (2IF45)

8. Questions?

Page 6: Process Algebra (2IF45) Assignments

Process Algebra (2IF45)

Recursion

Dr. Suzana Andova

Page 7: Process Algebra (2IF45) Assignments

7

LTSs Language Process terms

Process Algebra (2IF45)

term

term1 term2

a

Deduction rules Terms built from constants, operators and variables

term

LTS

Set of Axioms (basic equalities)

Derivation gives more (derived) equalities

Language (signature)

Set of constants and operators

term

Process Terms (Specification)

term

Page 8: Process Algebra (2IF45) Assignments

8 Process Algebra (2IF45)

Bisimulation Term Equalities

term

term1 term2

a

Deduction rules Terms built from constants, operators and variables

term

LTSs. Equivalence relation

Set of Axioms (basic equalities) term1 = term2

Derivation gives more (derived) equalities

Axiom ├ term3= term4

Language (signature)

Set of constants and operators

term

LTSs Language Process terms

Process Terms (Specification)

term

Page 9: Process Algebra (2IF45) Assignments

9

LTSs Language Process terms

Process Algebra (2IF45)

term

term1 term2

a

Deduction rules Terms built from constants, operators and variables

Set of Axioms (basic equalities)

Derivation gives more (derived) equalities

Language (signature)

Set of constants and operators

?coin.(!coffee.1 + !tea.0)

?coin.(!coffee.1 + !tea.0)

LTS

!tea !coffee

?coin

Page 10: Process Algebra (2IF45) Assignments

10

LTSs Language Process terms

Process Algebra (2IF45)

term

term1 term2

a

Deduction rules

Set of Axioms (basic equalities)

Derivation gives more (derived) equalities

Language (signature)

Set of constants and operators

!coin.?coffee.1

Terms built from constants, operators and variables

LTS

!coin

User

?coffee

Page 11: Process Algebra (2IF45) Assignments

11

LTSs Language Process terms

Process Algebra (2IF45)

term

term1 term2

a

Deduction rules

term

LTS

Set of Axioms (basic equalities)

Derivation gives more (derived) equalities

Language (signature)

Set of constants and operators

Process Terms

Terms built from constants, operators and variables

Page 12: Process Algebra (2IF45) Assignments

12

LTSs Language Process terms

Process Algebra (2IF45)

term

term1 term2

a

Deduction rules Terms built from constants, operators and variables

Set of Axioms (basic equalities)

Derivation gives more (derived) equalities

Language (signature)

Set of constants and operators

?coin.(!coffee.x + !tea.0)

LTS

x

!tea !coffee

?coin

What is x?• 1• is !coffee.!coffee.1• !coffee.y

• ……

Page 13: Process Algebra (2IF45) Assignments

13

LTSs Language Process terms

Process Algebra (2IF45)

term

term1 term2

a

Deduction rules

LTS

Set of Axioms (basic equalities)

Derivation gives more (derived) equalities

Language (signature)

Set of constants and operators

term?

!tea ?coin !coffee

“?coin.(!coffee +!tea).

?coin.(!coffee +!tea) .?coin.(!coffee +!tea)….”

Terms built from constants, operators and variables

Page 14: Process Algebra (2IF45) Assignments

14

LTSs Language Process terms

Process Algebra (2IF45)

LTS

?coin.(!coffee.x + !tea.0)

x

!tea !coffee

?coin

What is X?• 1• is !coffee.!coffee.1• !coffee.y

• ……

How do we solve this?

Page 15: Process Algebra (2IF45) Assignments

15

LTSs Language Process terms

Process Algebra (2IF45)

LTS

?

!tea ?coin !coffee

?coin.(!coffee +!tea).

?coin.(!coffee +!tea) .?coin.(!coffee +!tea)….

How do we solve this?Does the solution on the previous slide solves this question as well?

Page 16: Process Algebra (2IF45) Assignments

16 Process Algebra (2IF45)

Recursive (Process) Variables, Recursive Equations, Recursive Specification

Example1.

?coin.(!coffee.X+ !tea.0)X = !coffee.!coffee.1

Example2.

Y = ?coin.(!coffee.Y +!tea.Y)

•Recursive specifications increase the specification power of equational theories. •By means of recursive specifications infinite processes can be specified.

Page 17: Process Algebra (2IF45) Assignments

17 Process Algebra (2IF45)

Terms built from constants, operators and variables

Set of Axioms (basic equalities) term1 = term2

Derivation

Axioms, E ├ term_A= term_B,

where term_A and term_B may contain recursive variables from E

Language (signature)

Set of constants and operators

Recursive Equations X1 = …., X2 = ….., …. Recursive Specification E = {X1 = …., X2 = ….., …}

Recursive Equations and Rec. Specification in Equational Theory

Page 18: Process Algebra (2IF45) Assignments

18 Process Algebra (2IF45)

Terms built from constants, operators and variables

Set of Axioms (basic equalities) term1 = term2

Derivation

Axioms, E ├ term_A= term_B,

where term_A and term_B may contain recursive variables from E

Language (signature)

Set of constants and operators

Recursive Equations X1 = …., X2 = ….., …. Recursive Specification E = {X1 = …., X2 = ….., …}

Recursive Equations and Rec. Specification in Equational Theory

Example. E = { X = a.Y + c.0,Y = b.X}

BPA(A), E ├ X = a.Y +c.0 = a.(b.X) +c.0 = a.(b.(a.Y + c.))) + c.0

Page 19: Process Algebra (2IF45) Assignments

19 Process Algebra (2IF45)

Generating LTSs for recursive specifications

Example. E = { X = a.Y + c.0,Y = b.X} with X being root variable.

X

a

Y 0

c b

Example. E2 = { X = a.(a.(X+1)) +1 } with X being root variable.

X

a

a.(X+1)

a a

X+1

Page 20: Process Algebra (2IF45) Assignments

20 Process Algebra (2IF45)

Generating LTSs for recursive specifications

Example. E = { X = X + a.0} with X being root variable.

Page 21: Process Algebra (2IF45) Assignments

21 Process Algebra (2IF45)

Generating LTSs for recursive specifications

Example. E = { X = X + a.0} with X being root variable.

What transitions can X execute? X can perform a transition iff X can perform a transition

If we substitute a.0 for X

0

a

0

a

0

a

If we substitute b.0 for X

0

b

0

b

0

a

Page 22: Process Algebra (2IF45) Assignments

22 Process Algebra (2IF45)

Guarded recursive specification

What do we need take care?

That the recursive specification generates a unique LTS, in other words, it has a unique solution

How do we guarantee it?

We make sure that our specification is guarded.

Page 23: Process Algebra (2IF45) Assignments

23 Process Algebra (2IF45)

Guarded recursive specification

What do we still miss?

Consider three specifications:E = {X = a.Y, Y = a.X} and F = {Z = a.a.Z} G = {Un = a.Un+1, n 0}

X

a

Y

a

Z

a

a.Z

a

U0 U1 U2

a a a…

Can we derive

BPA(A), E, F, G ├ X = Z or BPA(A), E, F, G ├ X = U0 or

BPA(A), E, F, G ├ Z = U0

Page 24: Process Algebra (2IF45) Assignments

24 Process Algebra (2IF45)

Deriving equalities of recursive variables

Consider three specifications:E = {X = a.Y, Y = a.X} and F = {Z = a.a.Z} G = {Un = a.Un+1, n 0}

1. BPA(A), E, F, G ├ X = a.a.X which is exactly the form of Z 2. BPA(A), E, F, G ├ X = U0 cannot be derived directly. We introduce new variables X0, X1, … which are defined using X, as:

X0 = X, X1= a.X, X2 = a.a.X, …, Xn = an X, ….,

Now, we want to show that Xn can be rewritten in the form of Un for any n 0!BPA(A), E, F, G ├ X0 = X = a.a.X = a.X1

BPA(A), E, F, G ├ X1 = a.X = a.a.a.X = a.X2

and in general BPA(A), E, F, G ├ Xn = an X = an a.a.X = a.Xn+1

We conclude that Xn is in the same form as Un for any n 0

Page 25: Process Algebra (2IF45) Assignments

25

Recursive principles for Deriving equalities of recursive variables

1. Every guarded recursive specification has a solution, this is called Restricted Recursive Definition Principle (RDP-)

2. Every guarded recursive specification has a unique solution, this is called Recursive Specification Principle (RSP)

1. BPA(A), E, F, G ├ X = a.a.X which is exactly the form of Z. Directly from the RSP and RDP- we can conclude

BPA(A), E, F, G, RDP-, RSP ├ X = Z 2. BPA(A), E, F, G ├ X = U0 cannot be derived directly. We introduce new

variables X0, X1, … which are defined using X, as:X0 = X, X1= a.X, X2 = a.a.X, …, Xn = an X, ….,

Now, we want to show that Xn can be rewritten in the form of Un for any n 0!BPA(A), E, F, G ├ X0 = X = a.a.X = a.X1

BPA(A), E, F, G ├ X1 = a.X = a.a.a.X = a.X2

and in general BPA(A), E, F, G ├ Xn = an X = an a.a.X = a.Xn+1

We conclude that Xn is in the same form as Un for any n 0. Directly from the RSP and RDP- we can conclude

BPA(A), E, F, G, RDP-, RSP ├ X0 = U0

and also BPA(A), E, F, G, RDP-, RSP ├ X = X0 = U0

Page 26: Process Algebra (2IF45) Assignments

26

Specifying a Stack

Consider a finite set of data elements D = {d1, d2, …, dn} for some n natural number. Define a recursive specification that describes a stack with unlimited capacity. Elements from D can be added or removed from the stack from the top of the stack.

Steps: 1. First, define the set of atomic actions.

2. As a short hand notation you can use universal sum dD

3. Reason how many recursive variables you may need. 4. Specify the behaviour of the stack process.

Page 27: Process Algebra (2IF45) Assignments

27

Specifying a Stack

Consider a finite set of data elements D = {d1, d2, …, dn} for some n natural number. Define a recursive specification that describes a stack with unlimited capacity. Elements from D can be added or removed from the stack from the top of the stack.

Steps: 1. First, define the set of atomic actions.

2. As a short hand notation you can use universal sum dD

3. Reason how many recursive variables you may need. 4. Specify the behaviour of the stack process.

Stack1 = S

S = dD push(d).Sd, for any d D

Sd = eD push(e).Sed + dD pop(d).S, for any d D and D*