Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Tutorial 3

Exercise 1
Give the reductions corresponding to the execution of the following processes:
1. send(5).0 | recv(x).0

2. send(5).0 | recv(x).send(x).0
3. n[send(5).0 | recv(x).0]
4. m[send(5).0 | recv(x).send(x).0]
5. n[m :: send(5).0] | m[n :: recv(x).0]

6. n[:: send(5).0] | m[n :: recv(x).0]


7. n[m :: send(5).0] | m[:: recv(x).0]
8. n[:: send(5).0] | m[:: recv(x).0]
9. n[:: send(5).in m.0] | m[:: recv(x).del n.0]

10. n[ @ send(5).0 | in m.0] | m[ # recv(x).del n.0] | del m.0

Exercise 2
1. The following process sends a hello message and receives an acknowledgement:

send(hello).recv(x).0 | P

Give the specification of P .


2. An ambient m sends an hello message to another ambient n and receives an acknowledgement from n.
Give the specification of the ambients m and n.
3. Explain the behaviour of the following process

m[in n.out.0] | n[in m.out.0]

Exercise 3
Description
• m and n are sibling ambients.
• u is child ambient to n.
• w is child ambient to m.

• u sends a message hi to w.

1
Questions
1. Specify n, m, u, and w for this communication to take place.
2. Simulate your program and show the communication graph.

3. Modify the program to allow w to send an acknowledgement thanks to u upon receiving the message.
4. Simulate your program and show the communication graph.

Exercise 4
Description
• n is the parent ambient of m.
• m is the parent ambient of u,.

• n sends a message hi to u and receives an acknowledgement from u.


Questions
1. Specify n, m, u, and w for this communication to take place.
2. Simulate your program and show the communication graph.

Exercise 5
Description
• m, n, and u are sibling ambients.

• w is a child ambient of m.
• w can move from m to n and then to u.
Questions

1. Specify n, m, u, and w.
2. Simulate your program and show the behaviour graph.

Exercise 6
Description
• m is parent to the ambient n.
• n is parent to u.
• u is parent to w.

• w can move into m.


Questions
1. Specify n, m, u, and w.

2. Simulate your program and show the behaviour graph.

2
Exercise 7
Description
• m is sibling to the ambient n.
• u is child to n.

• w is child to u.
• w can move into m.
Questions
1. Specify n, m, u, and w.

2. Simulate your program and show the behaviour graph.

Exercise 8
• Specify in ccaPL a server that receives a service request, invokes the requested service, and sends the
output to the requester. Services can be modelled as process abstractions.
• Simulate your program and show the execution output.

Exercise 9
Description
A network hub is a multiport device that forwards the signal it receives on one port, out all other ports
except the incoming port.
Questions

1. Specify in ccaPL a network hub that has 4 ports connected to 4 devices.


2. Simulate your program and show the communication graph.

3
Exercise 10
Description
A network switch is a multiport device that forwards the signal it receives on one port, out the destination
port.
Questions

1. Specify in ccaPL a network switch that has 4 ports connected to 4 devices.


2. Simulate your program and show the communication graph.

You might also like