mirror of
https://github.com/tu-darmstadt-informatik/Tu-Darmstadt-Informatik-Kurse.git
synced 2025-12-13 09:55:48 +00:00
25 lines
364 B
Promela
25 lines
364 B
Promela
mtype = { nice, rude };
|
|
chan request = [0] of { mtype };
|
|
chan reply = [0] of { mtype };
|
|
|
|
active proctype Server() {
|
|
mtype msg;
|
|
end:
|
|
do
|
|
:: request ? msg -> reply ! msg
|
|
od
|
|
}
|
|
|
|
active proctype NiceClient() {
|
|
mtype msg;
|
|
request ! nice;
|
|
reply ? msg;
|
|
assert (msg == nice)
|
|
}
|
|
|
|
active proctype RudeClient() {
|
|
mtype msg;
|
|
request ! rude;
|
|
reply ? msg
|
|
}
|