# Optimal Opacity-Enforcing Supervisory Control of Discrete Event Systems on Choosing Cost
## 5 Scenario 1: Secret \(K\) Is Opaque with Respect to \(L(G)\) and \(\Sigma_{a}\)
### Case 1: \(\overline{K}=L(G)\)
So, we have \(V(L(f/G))\leq V(L(f^{\prime}/G))\), which contracts with \(V(L(f^{\prime}/G))<V(L(f/G))\). If \(\overline{K}\) is not controllable, it holds that \(\overline{K}\subseteq L(f/G)=\overline{K}^{\downarrow}\) by Theorem 1. For any \(s\in\overline{K}^{\downarrow}-\overline{K}\), there exists \(t\leq s\) such that \(t\in\overline{K}\) and \(s=t\Sigma_{u}^{*}\) hold. As shown in Proposition 2 and Assumption 1, we have \(V_{e}(s)=V_{e}(t)+V_{t}(\Sigma_{u}^{*})=V_{e}(t)\). So, it holds that \(V(\overline{K})=V(\overline{K}^{\downarrow})=V(L(f/G))\). According to formula \(\overline{K}\subseteq L(f^{\prime}/G)\), it is true that \(V(L(f/G))\leq V(L(f^{\prime}/G))\), which contracts with \(V(L(f^{\prime}/G))<V(L(f/G))\). In summary, it is true that \(V(L(f/G))\leq V(L(f^{\prime}/G))\), which means that the discount total choosing costs of \(L(f/G)\) in Theorem 3 are minimal. According to the proof of Theorem 3, we have the following corollaries:  
Corollary 1: _We consider language \(L\). If new language \(L^{\prime}\) is considered as the concatenation of any string of \(L\) with an uncontrollable string (i.e., \(\Sigma_{u}^{*}\)), then the discount total choosing costs of \(L\) and \(L^{\prime}\) are the same, that is, \(V(L)=V(L^{\prime})\)._  
Corollary 2: _We consider system \(G\) and secret \(K\subseteq L(G)\). In Case 2 of Scenario 1, \(V(\overline{K})=V(\overline{K}^{\downarrow})=V(L(f/G))\) holds, where \(L(f/G)\) is the closed-loop system in Theorem 3._  
Example 3: _We consider finite transition system \(G=(Q,\Sigma,\delta,q_{0})\) shown in Figure 5, where \(\Sigma_{u}=\{f,t\}\). Obviously, for system \(G\), Assumption 1 is true. We suppose that secret \(K=\{a,ab,aebf\}\), which can be recognized by \(Q_{s}=\{3,6,16\}\). To show choosing cost \(c(s,\gamma)\), label \(\
ot{p}\underset{\cdot|n}{\longrightarrow}\
ot{q}\) means that if there is a transition from \(p\) to \(q\) by \(\cdot\), notation \(n\) denotes choosing cost \(c(s,\cdot)\). For control input \(\Gamma\), the cost of choosing \(\gamma\in\Gamma\) is defined as \(c(s,\gamma)=\sum\limits_{\sigma\in\gamma}c(s,\sigma)\)._  
_We assume that the adversary has complete knowledge of the supervisor's control policy. From the adversary's view, the adversary can see a partial set of events, denoted by \(\Sigma_{a}=\{a,b,d,f,g\}\). For secret \(K\), it can be verified that \(K\) is opaque with respect to \(L(G)\) and \(\Sigma_{a}\) (Scenario 1). To reduce the choosing cost, closed-loop system \(L(f/G)\) can be obtained in Theorem 3, where \(L(f/G)=\{e,t,a,ab,abt,abt,afe,ae,aeb,aebg,aebgt\}\) is shown in Figure 6._  
_By Definition 5 and Algorithm 1, \(V(L(f/G))=V_{e}(t)+V_{e}(a)+V_{a}(ebgt)+V_{a}(btf)=1.726\) is minimal._  
Figure 5: System \(G\). Case 3: \(\overline{K}\subset L(G)\) and \(\exists s\in K,\forall s^{\prime}\in\overline{K}-K\) Such That \(\theta(s)\
eq\theta(s^{\prime})\)  
In Case 3, the condition means that there exists some secret in \(K\) such that all the non-secrets confused with them are outside of \(\overline{K}\). For \(L(G)\), we let \(\underline{K}=\{s\in K|\forall s^{\prime}\in\overline{K}-K,\theta(s)\
eq \theta(s^{\prime})\}\) be a set of some secret which cannot be confused by any string in \(\overline{K}-K\), and \(L=\{s\in L(G)-K|\theta(s)\subseteq\theta(\underline{K})\}\) be a set of strings which can confuse the secret of \(\underline{K}\). For language \(L\), we call \([s]=\{s^{\prime}\in L|\theta(s)=\theta(s^{\prime})\}\) the coset (or equivalence class) of \(s\) with respect to \(L\) and \(\theta\), where \(s^{\prime}\) is said to be the equivalent string of \(s\). And \(L/[\cdot]\) is defined as the quotient set of \(L\) with respect to coset \([\cdot]\). For a determined finite transition system, the number of strings in \(L\) is finite and the length of each string of \(L\) is finite, too. Obviously, coset \([\cdot]\) and quotient set \(L/[\cdot]\) are also finite. To solve Model (2), Algorithm 3 shown as follows is proposed by referring to Function 1 (seen in Algorithm 4) and Function 2 (seen in Algorithm 5).