1. Chapter 9 -- Problem 25: process p const w var na, ns, i, nr, j : integer, {init. 0} akn: boolean {init. false} begin na+w>ns -> send data(ns, nr) to q; ns:=ns+1; akn := false [] rcv data(i,j) from q -> na:=max(na,j); if true -> skip [] i akn:=true [] nr=i -> {accept data} nr:=nr+1; akn := true fi [] akn -> send ack(nr) to q; akn := false [] rcv ack(j) from q -> na := max(na,j) [] timeout (na send data(na, nr) to q [] rcv error from q -> skip end (Note: You will receive full credit even your solution doesn't have the third and the fourth actions.) 2. Chapter 11 -- Problem 10 process p[i:0..n-1] var up: boolean, b : 0..1 begin rcv chk(b) from p[i -n 1] -> if i = 0 -> b:=1 [] i != 0 -> skip fi; send chk(b) to p[i +n 1]; if b=0 -> up := false [] b=1 -> up := true fi [] rcv error from p[ i -n 1] -> skip [] timeout (for every k, 0<=k<=n-1, #ch.p[k].p[k + n 1] = 0) -> if i = 0 -> send chk(0) to p[i +n 1] [] i != 0 -> skip fi; up:=false end 3. Chapter 11 -- Problem 24 The protocol remains the same as in Section 11.3 except for the following changes: 1. Each message is of the form st(i, vp) where vp is the value of variable vp in p[i] when p[i] generates this message. 2. Remove variables ts and t from each process.