1 Introduction
-
Transference Closeness in the metric must translate to preserving interesting classes of logical and functional specifications between systems, and
-
Tractability The metric should be efficiently computable.
2 Conformance testing with the Skorokhod metric
2.1 Systems and conformance testing
2.2 The Skorokhod metric
2.3 Skorokhod metric computation: piecewise constant traces
-
The portion \([y_0,\, y_{j-1}]\) is mapped to \([x_0, x_{i-1}]\), and the portion \(( y_{j-1}, \, y_j]\) mapped to \(( x_{i-1}, \, x_i]\); or
-
The portion \([y_0,\, y_{j-1}]\) is mapped to \([x_0, x_{i}]\), and the portion \(( y_{j-1}, \, y_j]\) mapped to the single point \(x_i\); or
-
The portion \([y_0,\, y_j]\) is mapped to \([x_0, x_{i-1}]\), and the portion \(( x_{i-1}, \, x_i]\) mapped to the single point \(y_j\).
2.4 Skorokhod metric computation: polygonal traces
3 Transference of logical properties
3.1 The logic TLTL
-
\(p\in \mathcal {P}\) and \(x\in V_{\mathsf {T}}\), and \(\overline{x} = (x_1, \dots , x_l)\) with \(x_i\in V_{\mathsf {T}}\) for all \(1\le i \le l\);
-
\(f_{\mathsf {T}} \in \mathcal {F}_{\mathsf {T}}\) is a real-valued function, and \(\sim \) is one of \( \{ \le , <, \ge , > \}\). \(\square \)
3.2 Transference of TLTL properties for propositional traces
-
For every node \((\pi ^t, \mathcal {E}, \psi )\) of \(\mathcal {T}\), the tree \(\mathcal {T}'\) has a corresponding node \(\left( \pi _2^{r(t)}, \mathcal {E}_{r}, {{\mathrm{\mathsf {rx}}}}_{I_{\pi ,\pi _2}}^{\delta }(\psi )\ \right) \), where the environment \(\mathcal {E}_{r}\) is defined by \(\mathcal {E}_{r}(x) = \mathcal {E}(r(x))\).
-
Moreover, if \(\left( \pi ^{t_p}, \mathcal {E}_p, \psi _p\right) \) is a parent to \(\left( \pi ^{t}, \mathcal {E}, \psi \right) \) in tree \(\mathcal {T}\), then in the tree \(\mathcal {T}'\) the node \(\left( \ (\pi _2^{r(t_p)}, {\left( \mathcal {E}_p\right) }_{r}, {{\mathrm{\mathsf {rx}}}}_{I_{\pi ,\pi _2}}^{\delta }(\psi _p)\ \right) \) is a parent to \(\left( \pi _2^{r(t)}, \mathcal {E}_{r}, {{\mathrm{\mathsf {rx}}}}_{I_{\pi ,\pi _2}}^{\delta }(\psi )\ \right) \).
3.3 Transference of FLTL properties for \({\mathbb {R}}^n\)-valued traces
-
the input \(n+1\)-ary values \(\overline{u}_i\) can vary by at most \(\delta \) in the \(L^{\max }\) norm; and
-
the time-domain is restricted to \(\mathbf {J}(0)\); and
-
the k-th value-domain is restricted to intervals in \(\mathbf {J}(k)\).
-
\(\mathbf {J}\) be a mapping from \(\{ 0,1,\dots , n \}\) to subsets of \({\mathbb {R}}\);
-
\(\mathbf {J}(0)\) is the convex hull of \({{\mathrm{\mathsf {tdom}}}}(\pi ) \cup {{\mathrm{\mathsf {tdom}}}}(\pi ')\); and
-
\(\mathbf {J}(k)\) for \(n\ge k>0\) is \(\{ \pi (t)[k] \mid t\in {{\mathrm{\mathsf {tdom}}}}(\pi ) \} \cup \{ \pi '(t)[k] \mid t\in {{\mathrm{\mathsf {tdom}}}}(\pi ') \} \); where \(\pi (t)[k]\) denotes the k-th dimensional value in \(\pi (t)\) (and similarly for \(\pi '(t)\); and
-
\({{\mathrm{\mathsf {rx}}}}_{ \mathbf {J}}^{\delta }\) is defined with respect to the norm \(L^{\max }\).
-
\( f_1(\overline{x}_1)> 0\), for \(f_1(\overline{x})=\overline{x}_1[0] -96 \). We have \(K^{f_1}_{ \mathbf {J}}(\delta )\) to be \(\delta \) (since \(\left\| \overline{u}_1- \overline{u}_1'\right\| _{L_{\infty }^{\max }} \le \delta \) implies that \(\left| f_1(\overline{u}_1) - f_1(\overline{u}'_1) \right| \le \delta \). Thus, \({{\mathrm{\mathsf {rx}}}}_{ \mathbf {J}}^{\delta } (f_1(\overline{x}_1)> 0) \), which is defined to be \(f_1(\overline{x}_1) + K^{f_1}_{ \mathbf {J}}(\delta ) > 0\), is equal to \(\overline{x}_1[0] + \delta -96 >0\).
-
\( f_2(\overline{x}_1, \overline{x}_2) \le 0\), for \(f_2(\overline{x}_1, \overline{x}_2) = \overline{x}_2[0]- \overline{x}_1[0]-4\). Since if \(\left\| \overline{u}_1- \overline{u}_1'\right\| _{L_{\infty }^{\max }} \le \delta \) and if \(\left\| \overline{u}_2- \overline{u}_2'\right\| _{L_{\infty }^{\max }} \le \delta \) we havewe get that \(K^{f_2}_{ \mathbf {J}}(\delta )\) to be \(2\delta \). Thus, \({{\mathrm{\mathsf {rx}}}}_{ \mathbf {J}}^{\delta } (f_2(\overline{x}_1, \overline{x}_2) \le 0)\), which is defined to be \(f_2(\overline{x}_1, \overline{x}_2) -K^{f_2}_{ \mathbf {J}}(\delta ) \le 0\), is equal to \(\overline{x}_2[0]- \overline{x}_1[0]-4-2\delta \le 0\).$$\begin{aligned} \sup _{\overline{u}_1, \overline{u}_2, \overline{u}'_1, \overline{u}'_2} \left| \big (\overline{u}_2[0]- \overline{u}_1[0]-4 \big ) - \big (\overline{u}'_2[0]- \overline{u}'_1[0]-4\big ) \right| \ =\ 2\delta , \end{aligned}$$
-
\( f_2(\overline{x}_1, \overline{x}_2) \ge 0\), for \(f_2(\overline{x}_1, \overline{x}_2) = \overline{x}_2[0]- \overline{x}_1[0]-4\).Using the analysis from the previous case, we get \({{\mathrm{\mathsf {rx}}}}_{ \mathbf {J}}^{\delta } (f_2(\overline{x}_1, \overline{x}_2) \ge 0)\) to be \(\overline{x}_2[0]- \overline{x}_1[0]-4+2\delta \ge 0\).
-
\( f_3(\overline{x}_1, \overline{x}_2) \le 0\), for \(f_3(\overline{x}_1, \overline{x}_2) = \overline{x}_2[2] - \overline{x}_1[1] \cdot \overline{x}_1[1]\). For vectors \(\overline{u}_1, \overline{u}_2, \overline{u}'_1, \overline{u}'_2\) in \({\mathbb {R}}_+\times {\mathbb {R}}^{n}\) such thatwe have1.\(\left| \overline{u}_k[1]\right| \le 8\) and \(\left| \overline{u}'_k[1]\right| \le 8\) for \(k\in \{ 1,2 \}\), and2.\(0\le \overline{u}_k[2] \le 64\) and \(0\le \overline{u}'_k[2] \le 64\) for \(k\in \{ 1,2 \}\), and3.\(\left\| \overline{u}_1- \overline{u}_1'\right\| _{L_{\infty }^{\max }} \le \delta \) and4.\(\left\| \overline{u}_2- \overline{u}_2'\right\| _{L_{\infty }^{\max }} \le \delta \),Denote \(\overline{u}_1[1]\) as a, and \(\overline{u}'_1[1]\) as b. To compute the supremum in the last expression, we need to obtain the following:$$\begin{aligned}&\sup _{\overline{u}_1, \overline{u}_2, \overline{u}'_1, \overline{u}'_2} \left| \big (\overline{u}_2[2] - \overline{u}_1[1] \cdot \overline{u}_1[1]\big ) - \big (\overline{u}'_2[2] - \overline{u}'_1[1] \cdot \overline{u}'_1[1]\big )\right| \nonumber \\&\quad \le \sup _{\overline{u}_1, \overline{u}_2, \overline{u}'_1, \overline{u}'_2} \left| \overline{u}_2[2] - \overline{u}'_2[2]\right| \ +\ \sup _{\overline{u}_1, \overline{u}_2, \overline{u}'_1, \overline{u}'_2} \left| \overline{u}_1[1] \cdot \overline{u}_1[1]- \overline{u}'_1[1] \cdot \overline{u}'_1[1]\right| \nonumber \\&\quad \le \delta \ +\ \sup _{\overline{u}_1, \overline{u}_2, \overline{u}'_1, \overline{u}'_2} \left| \overline{u}_1[1] \cdot \overline{u}_1[1]- \overline{u}'_1[1] \cdot \overline{u}'_1[1]\right| \end{aligned}$$(15)We have \( \left| a^2-b^2\right| = \left| a-b\right| \cdot \left| a+b\right| \le \delta \cdot \left| a+b\right| \). Using the ranges of a, b, we get \( \left| a+b\right| \le 16\). Thus, \( \left| a^2-b^2\right| \le 16\cdot \delta \). Substituting back in Eq. (15), we get$$\begin{aligned} \text {maximize }&\ \left| a^2-b^2\right| \\ \text {subject to }&-8\le a \le 8\\&-8\le b \le 8\\&\left| a-b\right| \le \delta \end{aligned}$$Thus, \(K^{f_3}_{ \mathbf {J}}(\delta )\) is \(17\cdot \delta \). Hence, \({{\mathrm{\mathsf {rx}}}}_{ \mathbf {J}}^{\delta } (f_3(\overline{x}_1, \overline{x}_2) \le 0)\), which is defined to be \(f_3(\overline{x}_1, \overline{x}_2) -K^{f_3}_{ \mathbf {J}}(\delta ) \le 0\), is equal to$$\begin{aligned} \sup _{\overline{u}_1, \overline{u}_2, \overline{u}'_1, \overline{u}'_2} \left| \big (\overline{u}_2[2] - \overline{u}_1[1] \cdot \overline{u}_1[1]\big ) - \big (\overline{u}'_2[2] - \overline{u}'_1[1] \cdot \overline{u}'_1[1]\big ) \right| \ \le \ \delta \ +16\cdot \delta = 17\cdot \delta \end{aligned}$$$$\begin{aligned} \overline{x}_2[2] - \overline{x}_1[1] \cdot \overline{x}_1[1] - 17\cdot \delta \le 0. \end{aligned}$$
-
\( f_3(\overline{x}_1, \overline{x}_2) \ge 0\), for \(f_3(\overline{x}_1, \overline{x}_2) = \overline{x}_2[2] - \overline{x}_1[1] \cdot \overline{x}_1[1]\). Using the analysis of the previous case, we get \({{\mathrm{\mathsf {rx}}}}_{ \mathbf {J}}^{\delta } (f_3(\overline{x}_1, \overline{x}_2) \ge 0)\) to be$$\begin{aligned} \overline{x}_2[2] - \overline{x}_1[1] \cdot \overline{x}_1[1] + 17\cdot \delta \ge 0. \end{aligned}$$
4 Quantifying timing distortion using the Skorokhod metric
-
\(\left\| {{\mathrm{\mathsf {r}}}}-{{\mathrm{\mathcal {I}}}}\right\| _{\sup } < \epsilon \); and
-
\(\mathscr {D}_{\sup }(\pi _{\alpha },\, \pi _{\alpha }'\circ {{\mathrm{\mathsf {r}}}}) < \epsilon \).
-
\(\left\| {{\mathrm{\mathsf {r}}}}_{\frac{1}{\alpha }}-{{\mathrm{\mathcal {I}}}}\right\| _{\sup } < \frac{\epsilon }{\alpha }\); and
-
\(\mathscr {D}_{\sup }(\pi ,\, \pi '\circ {{\mathrm{\mathsf {r}}}}_{\frac{1}{\alpha }}) < \epsilon \).
5 Experimental evaluation
5.1 Skorokhod metric computation: polygonal traces
Window size | Avg. \(\mathscr {D}_{\mathscr {S}}\)
| Avg. time taken (s) |
\(\frac{\mathscr {D}_{\sup } - \mathscr {D}_\mathscr {S}}{\mathscr {D}_{\sup }}\)
| |||
---|---|---|---|---|---|---|
Computation | Monitoring | Max. | Avg. | SD | ||
20 | 8.58 | 0.81 | 0.13 | 0.11 | 0.03 | 0.03 |
40 | 8.35 | 1.55 | 0.26 | 0.23 | 0.06 | 0.06 |
60 | 8.09 | 2.31 | 0.39 | 0.34 | 0.1 | 0.09 |
80 | 7.88 | 3.05 | 0.52 | 0.38 | 0.1 | 0.11 |
100 | 7.72 | 3.77 | 0.64 | 0.38 | 0.1 | 0.11 |
5.2 Skorokhod metric computation: piecewise constant traces
Sampling rate | Avg. trace length | Avg. \(\frac{\mathscr {D}_{\mathscr {S}}^{\text { pwl}}-\mathscr {D}_{\mathscr {S}}^{\text { pwc}}}{\mathscr {D}_{\mathscr {S}}^{\text { pwl}}}\)
| Avg. \(\frac{\mathscr {D}_{\sup } - \mathscr {D}_{\mathscr {S}}^{\text { pwc}}}{\mathscr {D}_{\sup }}\)
| Avg. time (s) |
---|---|---|---|---|
1 | 381.5 |
\(-0.149\)
| 0.098 | 0.0034 |
2 | 761.9 |
\(-0.064\)
| 0.159 | 0.0104 |
5 | 1903.3 |
\(-0.033\)
| 0.181 | 0.0639 |
10 | 3805.6 |
\(-0.019\)
| 0.193 | 0.2553 |
15 | 5707.8 |
\(-0.012\)
| 0.198 | 0.5787 |
20 | 7610.2 |
\(-0.009\)
| 0.199 | 1.0365 |
50 | 19024.0 |
\(-0.003\)
| 0.204 | 6.5343 |
75 | 28535.5 |
\(-0.002\)
| 0.205 | 15.3230 |
Down-sampling rate (r) | Avg. \(\frac{\mathscr {D}^1_{\mathscr {S}} - \mathscr {D}^{r}_{\mathscr {S}}}{\mathscr {D}^1_\mathscr {S}} \ \)
| Avg. \(\frac{\mathscr {D}_{\sup } - \mathscr {D}^r_{\mathscr {S}}}{\mathscr {D}_{\sup }}\)
| Avg. time (s) |
---|---|---|---|
1 | 0 | 0.207 | 0.53 |
2 | −0.159 | 0.092 | 0.28 |
3 | −0.259 | 0.018 | 0.20 |
4 | −0.265 | 0.014 | 0.16 |
5 | −0.267 | 0.012 | 0.13 |
10 | −0.274 | 0.007 | 0.08 |
25 | −0.278 | 0.003 | 0.05 |
50 | −0.279 | 0.002 | 0.03 |
5.3 Quantifying timing distortion using the Skorokhod metric
5.4 Skorokhod distance between systems: case studies
Controller Sample-Time (s) | Skorokhod distance | Time taken (s) to compute \(\mathscr {D}_{\mathscr {S}}\)
| Number of simulations |
---|---|---|---|
0.01 | 0.012 | 232 | 104 |
0.05 | 0.049 | 96 | 104 |
0.1 | 0.11 | 70 | 106 |
0.3 | 0.39 | 45 | 104 |
0.5 | 1.51 | 40 | 101 |
Engine speed (rpm) | Skorokhod distance | Computation time (s) | Total time taken (secs) | Number of simulations |
---|---|---|---|---|
1000 | 0.47 | 218 | 544 | 700 |
1500 | 0.20 | 240 | 553 | 700 |
2000 | 0.27 | 223 | 532 | 700 |