mirror of
https://github.com/tu-darmstadt-informatik/Tu-Darmstadt-Informatik-Kurse.git
synced 2025-12-13 09:55:48 +00:00
26 lines
374 B
Promela
26 lines
374 B
Promela
chan request = [0] of { byte };
|
|
chan reply = [0] of { bool };
|
|
|
|
active proctype Server() {
|
|
byte client;
|
|
end:
|
|
do
|
|
:: request ? client ->
|
|
if
|
|
:: printf("Client %d\n", client);
|
|
reply ! true
|
|
:: skip /* loosing a request */
|
|
fi
|
|
od
|
|
}
|
|
|
|
active proctype Client0() {
|
|
request ! 0;
|
|
reply ? _
|
|
}
|
|
|
|
active proctype Client1() {
|
|
request ! 1;
|
|
reply ? _
|
|
}
|