-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathasw.smv
executable file
·63 lines (55 loc) · 2 KB
/
asw.smv
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
-- SENG 5801 - Homework 6
-- Submitted by - Amit Nandan Periyapatna
-- Date - 12/02/2016
MODULE main
VAR
--- declare input variables ---
altitude : {Below, Between, Above, Unknown};
altitudeQuality: {Good, Bad, Unknown};
reset : boolean;
inhibit : boolean;
--- declare output variables ---
doiCommand : {On, Off};
--- declare state variables ---
altitudeStatus: {Above, Below, AltitudeBad, Undefined};
-- INVAR altitudeQuality=Good;
-- INVAR reset=FALSE;
-- INVAR inhibit=FALSE;
ASSIGN
-- Contrain Input Variables.
init(altitude) := Unknown;
next(altitude) :=
case
altitude=Below : {Below, Between};
altitude=Between : {Below, Between, Above};
altitude=Above : {Below, Above};
TRUE : {Below, Between, Above};
esac;
-- Define next state relation.
init(altitudeStatus) := Undefined;
next(altitudeStatus) :=
case
reset : Undefined;
altitudeQuality=Bad : AltitudeBad;
altitudeStatus!= AltitudeBad &
altitude=Below : Below;
altitudeStatus=Undefined &
(altitude=Between | altitude=Above) : Above;
altitudeStatus=Below &
altitude=Above : Above;
TRUE : altitudeStatus;
esac;
init(doiCommand) := Off;
next(doiCommand) :=
case
inhibit : doiCommand;
next(altitudeStatus)=Below : On;
next(altitudeStatus)=Above : Off;
TRUE : doiCommand;
esac;
-- REQ 1: The DOI shall not be powered off eventhough the altitudeQuality is Bad when altitude is Below.
SPEC AF!(altitudeQuality=Bad & altitude=Below & doiCommand = Off)
-- REQ 2: The DOI shall remain powered On when the airplane ascends from Below the threshold to Between the Threshold and Hysterisis altitude.
SPEC AF(altitudeStatus=Below & altitude=Below & doiCommand=On -> AF(altitude=Between & doiCommand = On & altitudeStatus=Above))
-- REQ 3: The DOI shall be powered off when the airplane ascends from Between Threshold and Hysterisis altitude to Above the Hysterisis altitude.
SPEC AF(altitudeStatus=Above & altitude=Between & doiCommand=On -> AF(altitudeStatus=Above & altitude=Above & doiCommand=Off))