UniTO/anno3/vpc/consegne/3/3.5.smv
Francesco Mecca 4950a08fff analisi .2
2020-05-07 17:47:52 +02:00

40 lines
No EOL
925 B
Text

MODULE main
VAR
turn: 1..2;
p: proc(turn, 1);
q: proc(turn, 2);
ASSIGN
init(turn) := 1;
next(turn) := case
p.state = done: 2;
q.state = done: 1;
TRUE: turn;
esac;
CTLSPEC -- no mutual exclusion
AG (p.state != done | q.state != done)
CTLSPEC -- no deadlock
AG ((p.state = await | q.state = await) -> AF (p.state = done | q.state = done))
CTLSPEC -- no individual starvation
AG (p.state = await -> AF p.state = done)
CTLSPEC
AG (q.state = await -> AF q.state = done)
CTLSPEC -- prova: path senza starvation
AG (q.state = await -> EF q.state = done)
MODULE proc(turn, id)
VAR
state: {await, done};
ASSIGN
init(state) := await;
next(state) := case
turn = id: {await, done};
state = await: await;
state = done: await;
esac;