home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
cs.rhul.ac.uk
/
www.cs.rhul.ac.uk.zip
/
www.cs.rhul.ac.uk
/
pub
/
CS375
/
comm.fdr2
< prev
next >
Wrap
Text File
|
1999-12-08
|
1KB
|
48 lines
-- Question 4 from Coursework 3
datatype message = StartReq | StartAck | StopReq | StopAck
channel a, b, c, d : message
-- For simplicity, we write out the whole definition of each process,
-- rather than use relabelling
P_STOPPED = a.StartReq -> P_STARTING
[] b.StartReq -> P_WILLSTART
P_STARTING = b.StartAck -> P_STARTED
P_STARTED = a.StopReq -> P_STOPPING
[] b.StopReq -> P_WILLSTOP
P_STOPPING = b.StopAck -> P_STOPPED
P_WILLSTART = a.StartAck -> P_STARTED
P_WILLSTOP = a.StopAck -> P_STOPPED
Q_STOPPED = c.StartReq -> Q_STARTING
[] d.StartReq -> Q_WILLSTART
Q_STARTING = d.StartAck -> Q_STARTED
Q_STARTED = c.StopReq -> Q_STOPPING
[] d.StopReq -> Q_WILLSTOP
Q_STOPPING = d.StopAck -> Q_STOPPED
Q_WILLSTART = c.StartAck -> Q_STARTED
Q_WILLSTOP = c.StopAck -> Q_STOPPED
CHAN1 = a?x -> c!x -> CHAN1
CHAN2 = d?x -> b!x -> CHAN2
PROCS = P_STOPPED [ {| a,b |} || {| c,d |} ] Q_STOPPED
CHANS = CHAN1 [ {| a,c |} || {| b,d |} ] CHAN2
SYSTEM = PROCS [ {| a,b,c,d |} || {| a,b,c,d |} ] CHANS