true), ready(b(cust(m)))), seq(send(cust(m), false), ready(b(h))), if(release?(m), ready(b(nil)), ready(b(h))))) customer = rec(λb.λself.λs.λm. seq(if(m, seq(/* critical section */, send(s, mkrelease(self))), send(s, mkget(self))), ready(b(self)(s)))) // 補助関数 mkget = λh.pr(true, h) mkrelease = pr(false, nil) get? = λm.if(ispr?(m), 1st(m), false) release? = λm.if(ispr?(m), not(1st(m)), false) cust = λm.2nd(m) // 消費者が2⼈で実⾏する例 letrec s = new(sem(nil)), a = new(customer(a)(s)), b = new(customer(b)(s)) in seq(send(a, false), send(b, false))