UniTO/anno2/YearI/SecondSem/VPC/labs/analisi/es3/ferra/3.6-NuSMV.smv
Francesco Mecca 5e286062f8 MCAD 2019
2018-11-22 13:09:11 +01:00

34 lines
No EOL
708 B
Text

MODULE main
VAR
wantp : boolean;
wantq : boolean;
procp : process user(wantp, wantq);
procq : process user(wantq, wantp);
ASSIGN
init(wantp) := FALSE;
init(wantq) := FALSE;
--SPEC
--AG (proc1.state = entering -> AF proc1.state = critical)
MODULE user(wantp, wantq)
VAR
state : {p1,p2,p3,p4,p5};
ASSIGN
init(state) := p1;
next(state) :=
case
state = p1 : {p1,p2};
state = p2 & wantq = FALSE : p3;
state = p3 : p4;
state = p4 : p5;
state = p5 : p1;
TRUE : state;
esac;
next(wantp) :=
case
next(state) = p4 : TRUE;
next(state) = p1 & state = p5 : FALSE;
TRUE : wantp;
esac;
FAIRNESS
running