# 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)\)  
We have \(L(G)\subseteq L(f/G)\) in Condition 2 of Model (2). To ensure the feasible region is not empty, we can obtain supervisor \(f\) such that \(L(G)=L(f/G)\). So, we have the following theorem:  
We have system \(G\) and secret \(K\subseteq L(G)\). In Case 1 of Scenario 1, \(L(G)=L(f/G)\) is an optimal solution of optimal Model (2). From the above analysis, it is obvious that \(L(G)=L(f/G)\) is the unique solution of the feasible set. So, \(V(L(f/G))\) is minimal. Case 2: \(\overline{K}\subset L(G)\) and \(\forall s\in K,\exists s^{\prime}\in\overline{K}-K\) Such That \(\theta(s)=\theta(s^{\prime})\)  
In Case 2, the condition means that any secret cannot be distinguished from some non-secret in closure \(\overline{K}\). For secret \(K\) and its closure \(\overline{K}\), we have \(\theta(K)\subseteq\theta(\overline{K}-K)\subset\theta(L(G)-K)\). If there exists a closed-loop system \(f/G\) such that \(\overline{K}\subseteq L(f/G)\), it obviously can ensure the opacity of secret \(K\). So, the feasible region of Model (2) is not empty. To find supervisor \(f\), we infer whether \(\overline{K}\) is controllable with respect to \(L(G)\). * If \(\overline{K}\) is controllable with respect to \(L(G)\), there exists supervisor \(f\) such that \(L(f/G)=\overline{K}\). For closed-loop behavior \(L(f/G)\), it satisfies the two constraint conditions of Model (2). So, the feasible region of Model (2) is not empty. * If \(\overline{K}\) is not controllable with respect to \(L(G)\), we can find a controllable and closed superlanguage \(\overline{K}^{\downarrow}\) of \(\overline{K}\). Superlanguage \(\overline{K}^{\downarrow}\) not only ensures the opacity of \(K\)(in Theorem A1 of Appendix A), but also maximizes secret \(K\). So, the feasible region of Model (2) is not empty. According to the above analysis, the following Theorem 3 states that an optimal solution of Model (2) can be obtained using the controllability of \(\overline{K}\) or superlanguage \(\overline{K}^{\downarrow}\). We consider system \(G\) and secret \(K\subseteq L(G)\). In Case 2 of Scenario 1, we have the following conclusions about the optimal solution of Model (2):  
* If \(\overline{K}\) is controllable with respect to \(L(G)\), there exists supervisor \(f\) such that \(L(f/G)=\overline{K}\), which is the optimal solution of Model (2). * If \(\overline{K}\) is not controllable with respect to \(L(G)\), there exists supervisor \(f\) such that \(L(f/G)=\overline{K}^{\downarrow}\), which is the optimal solution of Model (2). Firstly, we prove that closed-loop behavior \(L(f/G)\) of Theorem 3 is a feasible solution of optimal Model (2). If \(\overline{K}\) is controllable with respect to \(L(G)\), \(\overline{K}\) is a closed and controllable sublanguage of \(L(G)\). So, there exists supervisor \(f\) such that \(L(f/G)=\overline{K}\). If \(\overline{K}\) is not controllable with respect to \(L(G)\), it is obvious that \(\overline{K}^{\downarrow}\) is the infimal closed and controllable superlanguage of \(\overline{K}\). So, there exists supervisor \(f\) such that \(L(f/G)=\overline{K}^{\downarrow}\). Therefore, we have \(\overline{K}\subseteq L(f/G)\) which means constraint Condition 2 of Model (2) is true. By Theorem A1 of Appendix A, we conclude that \(L(f/G)\) can ensure the opacity of \(K\) under Case 2 of Scenario 1, which implies that constraint Condition 1 of Model (2) is true. From the above points, it is true that \(L(f/G)\) in Theorem 3 is a feasible solution of Model (2). Next, we prove by contraction that the discount total choosing costs of \(L(f/G)\) produced in Theorem 3 are minimal. We assume that there exists feasible solution \(L(f^{\prime}/G)\)\((\
eq L(f/G))\) of Model (2) such that \(V(L(f^{\prime}/G))<V(L(f/G))\). According to constraint condition 2, we have \(\overline{K}\subseteq L(f^{\prime}/G)\). Afterward, we consider the controllability of \(\overline{K}\). If \(\overline{K}\) is controllable, it holds that \(L(f/G)=\overline{K}\) by Theorem 1, which means \(L(f/G)\subseteq L(f^{\prime}/G)\).