//This model is an adaptation by Camil Staps of //an adaption by Frits Vaandrager of //a model made by Martijn Hendriks // Number of processes in system: const int N = 5; const int emptyPot = 0; const int fullPot = 1; const int mutex = 2; const int nr_sem = 3; // nr. of semaphores int servings = 5; const int max_servings = 5; // The channels to synchronize with the semafores // A call semWait(s) by process p translates to a sequence of two transitions labeled with // semWait(s)(p)! // semGo(s)(p)? //A call semSignal(s) by process p translates to a transition labeled with // semSignal(s)(p)! chan semWait[nr_sem][N], semGo[nr_sem][N], semSignal[nr_sem][N];EmptyPot = Semaphore(emptyPot, N-1, 0); FullPot = Semaphore(fullPot, N-1, 0); cook = Cook(0); Mutex = Semaphore(mutex, 5, 1); s1 = Savage(0); s2 = Savage(1); s3 = Savage(2); s4 = Savage(3); system EmptyPot, FullPot, Mutex, cook, s1, s2, s3, s4;