add lab1 and lab2 exercises
This commit is contained in:
25
lab1/switch.smv
Normal file
25
lab1/switch.smv
Normal file
@@ -0,0 +1,25 @@
|
||||
MODULE main
|
||||
-- Model of the switch
|
||||
IVAR
|
||||
press : boolean;
|
||||
VAR
|
||||
mode : {on, off};
|
||||
x : 0..15;
|
||||
ASSIGN
|
||||
init(mode) := off;
|
||||
next(mode) := case
|
||||
mode = off & press : on;
|
||||
mode = on & (press | x >= 10) : off;
|
||||
TRUE : mode;
|
||||
esac;
|
||||
init(x) := 0;
|
||||
next(x) := case
|
||||
mode = on & next(mode) = off : 0;
|
||||
mode = on & x < 10 : x + 1;
|
||||
TRUE : x;
|
||||
esac;
|
||||
|
||||
INVARSPEC x <= 10;
|
||||
INVARSPEC mode = off -> x = 0;
|
||||
INVARSPEC x < 10;
|
||||
INVARSPEC mode = off;
|
||||
Reference in New Issue
Block a user