0% found this document useful (0 votes)
2 views5 pages

Com 3190

The document is an exam paper for the Theory of Distributed Systems course from the Department of Computer Science for the Spring Semester 2013-2014. It consists of four main questions covering topics such as CCS processes, bisimulation, π-calculus modeling for a hotel reservation system, and data types in π-calculus. Students are required to answer three questions, with each question containing multiple parts that assess their understanding of the subject matter.

Uploaded by

patelmitul2002
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views5 pages

Com 3190

The document is an exam paper for the Theory of Distributed Systems course from the Department of Computer Science for the Spring Semester 2013-2014. It consists of four main questions covering topics such as CCS processes, bisimulation, π-calculus modeling for a hotel reservation system, and data types in π-calculus. Students are required to answer three questions, with each question containing multiple parts that assess their understanding of the subject matter.

Uploaded by

patelmitul2002
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

COM3190

Data Provided: None

PLEASE LEAVE THIS EXAM PAPER ON YOUR DESK.


DO NOT REMOVE IT FROM THE HALL.

DEPARTMENT OF COMPUTER SCIENCE Spring Semester 2013-2014

THEORY OF DISTRIBUTED SYSTEMS 2 hours

Answer THREE questions.


All questions carry equal weight. Figures in square brackets indicate the per-
centage of available marks allocated to each part of a question.

Registration number from U-Card (9 digits) — to be completed by student

COM3190 1 TURN OVER


COM3190

1. This question concerns CCS and the properties of simulation.

a) Suppose P and Q are two CCS processes. Define the following terms formally:

(i) P simulates Q [5%]


(ii) There is a bisimulation between P and Q [5%]
(iii) There is a weak bisimulation between P and Q [5%]

b) Show, by example, that bisimulation is different from weak bisimulation. [15%]

c) Consider the processes:


Q = b.0 + b.d.0 + c.d.0
R = c.0 + b.d.0 + c.d.0

(i) Draw the transition graphs of Q and R. [15%]


(ii) Show that a.R simulates a.Q by writing down a simulation S1 such that
(a.Q)S1 (a.R). [15%]
(iii) Show that a.Q simulates a.R by writing down a simulation S2 such that
(a.R)S2 (a.Q). [15%]
(iv) Is it the case that S1 is the inverse of S2 ? [5%]
(v) Show that a.Q and a.R are not in a bisimulation by proving that if S is any
simulation such that (a.Q)S(a.R) then S −1 cannot be a simulation. [20%]

COM3190 2 CONTINUED
COM3190

2. This question concerns bisimulation and process behaviours in CCS.

a) Suppose P is defined recursively by

P = a1 .P | a2 .P | . . . | an .P

for some positive integer n, where ai 6= aj for each i 6= j.

(i) Show by induction that every process Q, into which P can evolve, can be
written in the form

Q = (a1 .P )m1 | (a2 .P )m2 | . . . | (an .P )mn

for suitable positive integers m1 , . . . , mn , and where for any process X, X m


denotes the process obtained by running m copies of X concurrently.
[30%]
(ii) Deduce that Q1 ∼ Q2 (Q1 bisimulates Q2 ) for every Q1 and Q2 into which P
can evolve (in zero or more steps). [10%]

b) Consider the processes A and C, defined by

A = in(x).in(y).out(x).out(y).A

C = in(x).out(x).C
Describe in English the behaviours of A and C. How do they differ? Re-write A as
four equations. [30%]

c) Define a process that models a stack. One way to do this is to define a stack using
two definitions
Stack(e) = . . .
Stack(v : s) = . . .
where s stands for an arbitrary sequence, e the empty sequence and : sequence con-
catenation. [30%]

COM3190 3 TURN OVER


COM3190

3. This question asks you to model a hotel reservation system using the π-calculus.

a) Explain, with simple example derivations, how the π-calculus allows the modelling of
mobile processes. Your answer should include a brief discussion of scope extrusion.
[30%]

b) A large hotel chain asks a programmer to build them an online booking system. The
programmer realises that several identical server processes will be required, all running
in parallel, to cope with the expected demand, and decides to test the design using a
simplified π-calculus model before writing any code.
In the simplified model, all of the servers share the same address (i.e. they all receive
bookings along the same request channel, r). This is to ensure that the customer
(Cust) doesn’t need to know in advance which server they’re talking to. Customers
supply just three pieces of information: their name (n), the city (c) they want to stay
in, and the date (d) they want to stay. A server (Server) receives this information,
and then uses it to update the company’s central database.
To test the model, the programmer invents a customer called mike who wants to
stay in the shef hotel today, and another customer called bill who wants to stay in
london on monday. The programmer is also keen to check that the system will work
under extreme conditions, so builds in the extra constraint that, due to bandwidth
restrictions, only one piece of information can be transmitted along any given channel
at a time. The programmer therefore defines

System = Server | . . . | Server


| Cust(mike, shef, today) | Cust(bill, london, monday)
Server = r(n).r(c).r(d).U pdateDB(ncd)
Cust(ncd) = r hni . r hci . r hdi .Cust′

where U pdateDB and Cust′ are processes whose behaviours aren’t relevant to this
question.
Demonstrate, by showing a possible evolution of System’s behaviour, that these
equations do not satisfy the requirements stated above. [20%]

c) The hotel chain decides to revise the protocol used by its booking system. Instead of
talking directly to the servers, customers should instead provide their information to
a central switchboard. The switchboard chooses a server (at random) and routes the
information to that server. The server then responds to the switchboard to acknowl-
edge receipt of the information. Finally, the switchboard passes this acknowledgement
back to the customer.
Explain in English how to model this new protocol, and define the processes:

(i) Switchboard – representing the switchboard’s behaviour. [30%]


(ii) N ewServer – representing the servers’ new behaviour. [10%]
(iii) NewCust – representing the customers’ new behaviour. [10%]

COM3190 4 CONTINUED
COM3190

4. This question concerns the modelling of data types in the π-calculus.


A programmer wishes to investigate the properties of various simple data types, and so
defines two π-calculus processes relevant to representing Booleans (Bool = {true, false}),
and two processes relevant to representing natural numbers (N = {0, 1, 2, . . . }):

Boolean Values Natural Numbers


False(i) = i (ab) . a .0 Zero(i) = i (ab) . a .0
True(i) = i (ab) . b .0 Succ(ip) = i (ab) . b hpi .0

The processes True(i) and False(i) represent the availability of true and false, respec-
tively, on the channel i.

a) Show how the processes Zero(i) and Succ(ip) can be used to define a family of
processes N0 (i), N1 (i), N2 (i), . . . so that each process Nn (i) represents the availability
of the corresponding natural number n = 0, 1, 2, . . . on the channel i. [15%]

Given a function f (x) of one variable, we say that a process F (io) represents f provided
the following condition holds:

WHENEVER f (x) = y
and X (i) represents the value x on the input channel i
and Y (o) represents the value y on the output channel o
THEN
(new i) ( F (io) | X (i) ) →∗ Y (o)

b) Describe in English, and give a definition of, a process Not(io) that represents the
function not : Bool → Bool with behaviour
not(true) = false
not(false) = true
[15%]

c) By adapting the definitions of Zero(i) and Succ(ip), or otherwise, show in detail how
to define a data type capable of representing finite integer lists, for example, [1,2,3]
or [2,2,7,4]. [40%]

d) Explain how processes can be defined that represent functions (of one argument)
defined on these lists. You should include derivations to illustrate the behaviour of the
processes you define. [30%]

END OF QUESTION PAPER

COM3190 5

You might also like