-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhost.sal
executable file
·144 lines (115 loc) · 5.74 KB
/
host.sal
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
host : CONTEXT =
BEGIN
IMPORTING network;
stateful [ me : HOST, cable : REALLINK, faulted : BOOLEAN, mylognet : topology!LOGICALNETWORKADDR, nummsgstosend : nznat ] : MODULE =
BEGIN
LOCAL processcategories : network!CLEARANCE
LOCAL received : METAMESSAGE
LOCAL numsgsent : [0..nummsgstosend]
LOCAL sendfromphyhost : {v : topology!CLIENT | faulted OR v = me}
LOCAL sendfromloghost : {v : topology!CLIENT | faulted OR v = me}
LOCAL sendfromlognet : {v : topology!LOGICALNETWORKADDR | v /= topology!null AND (faulted OR v = mylognet)}
LOCAL sendtophyhost : {a : topology!NODE | a /= topology!none AND a /= me}
LOCAL sendtologhost : {a : topology!CLIENT | a /= me OR faulted}
LOCAL sendtolognet : {a : LOGICALNETWORK | TRUE}
GLOBAL aether : NETWORK
INITIALIZATION
numsgsent = 0;
received = EMPTYMETAMESSAGE;
(FORALL (c : topology!CATEGORY) : processcategories[c] = FALSE);
TRANSITION
[
send:
numsgsent < nummsgstosend AND aether[cable].author = topology!none
-->
aether'[cable] = (# author := me, forwarder := topology!none, payload := (# source := sendfromphyhost, destination := sendtophyhost, payload:= (# sourcenetwork := sendfromlognet, sourcehost := sendfromloghost, destinationnetwork := sendtolognet, destinationhost := sendtologhost, label := processcategories #) #) #);
numsgsent' = numsgsent + 1;
sendfromphyhost' IN {v : topology!CLIENT | faulted OR v = me};
sendfromloghost' IN {v : topology!CLIENT | faulted OR v = me};
sendfromlognet' IN {v : topology!LOGICALNETWORKADDR | v /= topology!null AND (faulted OR v = mylognet)};
sendtophyhost' IN {a : topology!NODE | a /= topology!none AND a /= me};
sendtologhost' IN {a : topology!CLIENT | a /= me OR faulted};
sendtolognet' IN {a : LOGICALNETWORK | TRUE}
[]
receive:
aether[cable].author /= topology!none AND
aether[cable].author /= me
-->
received' = aether[cable];
aether'[cable] = EMPTYMETAMESSAGE
]
END;
stateless [ me : HOST, cable : REALLINK, faulted : BOOLEAN, mylognet : topology!LOGICALNETWORKADDR, nummsgstosend : nznat ] : MODULE =
BEGIN
LOCAL processcategories : network!CLEARANCE
LOCAL numsgsent : [0..nummsgstosend]
LOCAL sendfromphyhost : {v : topology!CLIENT | faulted OR v = me}
LOCAL sendfromloghost : {v : topology!CLIENT | faulted OR v = me}
LOCAL sendfromlognet : {v : topology!LOGICALNETWORKADDR | v /= topology!null AND (faulted OR v = mylognet)}
LOCAL sendtophyhost : {a : topology!NODE | a /= topology!none AND a /= me}
LOCAL sendtologhost : {a : topology!CLIENT | a /= me OR faulted}
LOCAL sendtolognet : {a : LOGICALNETWORK | TRUE}
GLOBAL aether : NETWORK
INITIALIZATION
numsgsent = 0;
(FORALL (c : topology!CATEGORY) : processcategories[c] = FALSE);
TRANSITION
[
send:
numsgsent < nummsgstosend AND aether[cable].author = topology!none
-->
aether'[cable] = (# author := me, forwarder := topology!none, payload := (# source := sendfromphyhost, destination := sendtophyhost, payload:= (# sourcenetwork := sendfromlognet, sourcehost := sendfromloghost, destinationnetwork := sendtolognet, destinationhost := sendtologhost, label := processcategories #) #) #);
numsgsent' = numsgsent + 1;
sendfromphyhost' IN {v : topology!CLIENT | faulted OR v = me};
sendfromloghost' IN {v : topology!CLIENT | faulted OR v = me};
sendfromlognet' IN {v : topology!LOGICALNETWORKADDR | v /= topology!null AND (faulted OR v = mylognet)};
sendtophyhost' IN {a : topology!NODE | a /= topology!none AND a /= me};
sendtologhost' IN {a : topology!CLIENT | a /= me OR faulted};
sendtolognet' IN {a : LOGICALNETWORK | TRUE}
[]
receive:
aether[cable].author /= topology!none AND
aether[cable].author /= me
-->
aether'[cable] = EMPTYMETAMESSAGE
]
END;
trustedsystem [ me : HOST, cable : REALLINK, faulted : BOOLEAN, mylognet : topology!LOGICALNETWORKADDR, nummsgstosend : nznat ] : MODULE =
BEGIN
LOCAL processcategories : network!CLEARANCE
LOCAL received : METAMESSAGE
LOCAL numsgsent : [0..nummsgstosend]
LOCAL sendfromphyhost : {v : topology!CLIENT | faulted OR v = me}
LOCAL sendfromloghost : {v : topology!CLIENT | faulted OR v = me}
LOCAL sendfromlognet : {v : topology!LOGICALNETWORKADDR | v /= topology!null AND (faulted OR v = mylognet)}
LOCAL sendtophyhost : {a : topology!NODE | a /= topology!none AND a /= me}
LOCAL sendtologhost : {a : topology!CLIENT | a /= me OR faulted}
LOCAL sendtolognet : {a : LOGICALNETWORK | TRUE}
GLOBAL aether : NETWORK
INITIALIZATION
numsgsent = 0;
received = EMPTYMETAMESSAGE;
TRANSITION
[
send:
numsgsent < nummsgstosend AND aether[cable].author = topology!none
-->
aether'[cable] = (# author := me, forwarder := topology!none, payload := (# source := sendfromphyhost, destination := sendtophyhost, payload:= (# sourcenetwork := sendfromlognet, sourcehost := sendfromloghost, destinationnetwork := sendtolognet, destinationhost := sendtologhost, label := processcategories #) #) #);
numsgsent' = numsgsent + 1;
sendfromphyhost' IN {v : topology!CLIENT | faulted OR v = me};
sendfromloghost' IN {v : topology!CLIENT | faulted OR v = me};
sendfromlognet' IN {v : topology!LOGICALNETWORKADDR | v /= topology!null AND (faulted OR v = mylognet)};
sendtophyhost' IN {a : topology!NODE | a /= topology!none AND a /= me};
sendtologhost' IN {a : topology!CLIENT | a /= me OR faulted};
sendtolognet' IN {a : LOGICALNETWORK | TRUE}
[]
receive:
aether[cable].author /= topology!none AND
aether[cable].author /= me AND
(FORALL (c : topology!CATEGORY) : (NOT(aether[cable].payload.payload.label[c]) OR processcategories[c]))
-->
received' = aether[cable];
aether'[cable] = EMPTYMETAMESSAGE
]
END;
END