-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathq5.lts
More file actions
64 lines (51 loc) · 1.93 KB
/
q5.lts
File metadata and controls
64 lines (51 loc) · 1.93 KB
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
const True = 1
const False = 0
range B = False..True
CLAN = (raiseFlag -> checkFlag -> (lowerFlag -> CLAN | visit -> water -> leave -> lowerFlag -> CLAN)).
RIVER = RIVER[False][False], // initially no flag is raised
RIVER[hatFlag:B][mcFlag:B] =
(
hatfields.raiseFlag -> RIVER[True][mcFlag]
|hatfields.checkFlag ->
(
when(!mcFlag)
hatfields.visit -> hatfields.leave -> hatfields.lowerFlag -> RIVER[False][mcFlag]
|when(mcFlag)
hatfields.lowerFlag -> RIVER[False][mcFlag]
)
|mcCoys.raiseFlag -> RIVER[hatFlag][True]
|mcCoys.checkFlag ->
(
when(!hatFlag)
mcCoys.visit -> mcCoys.leave -> mcCoys.lowerFlag -> RIVER[hatFlag][False]
|when(hatFlag)
mcCoys.lowerFlag -> RIVER[hatFlag][False]
)
).
property NOCARNAGE =
(
hatfields.visit -> hatfields.leave -> NOCARNAGE
|mcCoys.visit -> mcCoys.leave -> NOCARNAGE
).
progress HATFIELDSVISIT = {hatfields.visit}
progress MCCOYSVISIT = {mcCoys.visit}
||SafeRiver = (hatfields:CLAN || mcCoys:CLAN || RIVER || NOCARNAGE) << {hatfields.raiseFlag}.
/*
The community's concern about the clans potentially being greedy in using the river-sharing protocol is valid.
In a scenario where one or both clans act greedily, repeatedly raising their flag to monopolize river access,
the system could become unfair.
a) Under the assumption that the clans are not greedy, no progress violation will be detected.
b) Under the assumption that the clans are greedy, a progress violation will occur.
In the current model, it is assumed that "Hatfields" are being greedy (<< {hatfields.raiseFlag}),
resulting in a progress violation:
Progress violation: MCCOYSVISIT
Cycle in terminal set:
hatfields.raiseFlag
hatfields.checkFlag
hatfields.visit
hatfields.water
hatfields.leave
hatfields.lowerFlag
Actions in terminal set:
{hatfields.{checkFlag, leave, lowerFlag, raiseFlag, visit, water}, mcCoys.{checkFlag, lowerFlag, raiseFlag}}
*/