Com 3190
Com 3190
a) Suppose P and Q are two CCS processes. Define the following terms formally:
COM3190 2 CONTINUED
COM3190
P = a1 .P | a2 .P | . . . | an .P
(i) Show by induction that every process Q, into which P can evolve, can be
written in the form
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%]
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
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:
COM3190 4 CONTINUED
COM3190
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%]
COM3190 5