Repository navigation
Expand file tree
/
Copy pathattack.envelope
More file actions
123 lines (115 loc) · 4.66 KB
/
Copy pathattack.envelope
File metadata and controls
123 lines (115 loc) · 4.66 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
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
envelope "Attack"
Guideline
Find a checkable final-step control envelope under which applying the redundant pump override P1 := 0 preserves:
L1 <= x1 <= H1
L2 <= x2 <= H2
ometric >= 0
rmetric >= 0
This canonical Phase 1 example only needs to cover the case where less than one control period remains before the attack ends.
Definitions
Definitions
Bool isBinary(Real v) <-> (v = 0) | (v = 1);
Bool safe(Real x1, Real x2) <-> (L1 <= x1 & x1 <= H1 & L2 <= x2 & x2 <= H2);
Bool unsafe(Real x1, Real x2) <-> (x1 < L1 | x1 > H1 | x2 < L2 | x2 > H2);
End.
ProgramVariables
Real P1; /* Pump 1. If 1, pump is on; if 0, off. */
Real V1; /* Valve 1. If 1, valve is open; if 0, closed. */
Real P2; /* Pump 2. If 1, pump is on; if 0, off. */
Real V2; /* Valve 2. If 1, valve is open; if 0, closed. */
Real x1; /* Tank 1 water level. */
Real x2; /* Tank 2 water level. */
Real L1; /* Tank 1 low safety bound. */
Real H1; /* Tank 1 high safety bound. */
Real L2; /* Tank 2 low safety bound. */
Real H2; /* Tank 2 high safety bound. */
Real f1; /* Inflow rate. */
Real f2; /* Outflow rate. */
Real t; /* Time within one control-loop step. */
Real T; /* Maximum control-loop step duration. */
Real Tmin; /* Minimum control-loop step duration. */
Real attackTimer; /* Time elapsed since the attack began. */
Real AttackTime; /* Upper bound on attack duration. */
Real ometric; /* Operational budget remaining. */
Real rmetric; /* Intervention budget remaining. */
Real c1; /* Operational cost coefficient for pump 1 inefficiency. */
Real c2; /* Operational cost coefficient for pump 2 inefficiency. */
Real op1; /* Intervention cost for changing pump 1. */
Real ov1; /* Intervention cost for changing valve 1. */
Real op2; /* Intervention cost for changing pump 2. */
Real ov2; /* Intervention cost for changing valve 2. */
End.
precondition
L1 <= H1 & L2 <= H2
& f1 >= 0 & f2 >= 0
& T > 0 & Tmin > 0 & Tmin <= T
& AttackTime >= 0 & attackTimer >= 0
& AttackTime < attackTimer + Tmin
& c1 >= 0 & c2 >= 0
& op1 >= 0 & ov1 >= 0 & op2 >= 0 & ov2 >= 0
& x2 = 0
& ometric >= 0 & rmetric >= op1
& L1 <= x1 & x1 <= H1 & L2 <= x2 & x2 <= H2
& P1 = 0 & V1 = 1 & P2 = 0 & V2 = 0
postcondition
(
L1 <= x1 & x1 <= H1 & L2 <= x2 & x2 <= H2
& attackTimer >= 0
& x2 = 0
& ometric >= 0
& rmetric >= 0
& (P1 = 0 | P1 = 1) & (V1 = 0 | V1 = 1)
& (P2 = 0 | P2 = 1) & (V2 = 0 | V2 = 1)
)
game
{
{
{
? attackTimer <= AttackTime;
P1_PLC1: P1 := 1;
V1_PLC1: V1 := 1;
P2_PLC1: P2 := 0;
V2_PLC1: V2 := 0;
? (P1 = 0 | P1 = 1) & (V1 = 0 | V1 = 1)
& (P2 = 0 | P2 = 1) & (V2 = 0 | V2 = 1);
}
++
{
? attackTimer > AttackTime;
P1_PLC1: P1 := 0;
V1_PLC1: V1 := 1;
P2_PLC1: P2 := 0;
V2_PLC1: V2 := 0;
? (P1 = 0 | P1 = 1) & (V1 = 0 | V1 = 1)
& (P2 = 0 | P2 = 1) & (V2 = 0 | V2 = 1);
}
;
{
{
? attackTimer <= AttackTime;
P1_PLC2: P1 := 0;
? (P1 = 0 | P1 = 1) & (V1 = 0 | V1 = 1)
& (P2 = 0 | P2 = 1) & (V2 = 0 | V2 = 1);
rmetric := rmetric - op1;
}
++
{
? attackTimer > AttackTime;
P1_PLC2: P1 := 0;
? (P1 = 0 | P1 = 1) & (V1 = 0 | V1 = 1)
& (P2 = 0 | P2 = 1) & (V2 = 0 | V2 = 1);
rmetric := rmetric;
}
}^@;
t:=0;
{
x1' = V1 * P1 * f1 - V2 * P2 * f2,
x2' = V2 * P2 * f2,
t' = 1,
attackTimer' = 1,
ometric' = -x2 - c1 * (P1 * (1 - V1)) - c2 * (P2 * (1 - V2)),
& x1 >= 0 & x2 >= 0 & f1 >= 0 & f2 >= 0 & t <= T
};
? t >= Tmin;
}*
}^@