# Optimal Opacity-Enforcing Supervisory Control of Discrete Event Systems on Choosing Cost
## 3 Optimal Supervisory Control Model on Opacity  
In the section, an optimal supervisory control model is constructed to minimize the choosing cost of the controlled system which is opaque. Given system \(G\) and secret \(K\subseteq L(G)\), as shown in [1], secret \(K\) is a regular language. For secret \(K\), we suppose there exists a set of secret states \(Q_{s}\subseteq Q\) which can recognize secret \(K\), i.e., \(s\in K\) iff \(\delta(q_{0},s)\in Q_{s}\)To show the cost of information released, we introduce the cost of choosing control input in [31; 32] and define the total choosing cost as follows:  
Given closed-loop behavior \(L(f/G)\), the discount total choosing cost of \(L(f/G)\) is defined as \(V(L(f/G),f)=\sum\limits_{s\in L(f/G)}\beta^{|s|}c(s,f)\), where \(f\) is a supervisor controlling system \(G\) and \(\beta>0\) is a discount factor. For convenience, \(V(L(f/G),f)\) is simplified as \(V(L(f/G))\). For system \(G\), if there exist two supervisors \(f_{1}\) and \(f_{2}\) such that \(L(f_{1}/G)\subseteq L(f_{2}/G)\), it is obvious that \(V(L(f_{1}/G))\leq V(L(f_{2}/G))\) by Definition 4. To obtain the discount total choosing cost, we definite discount cost by the sum of choosing cost after \(s\) under \(f\). We consider \(s\), \(t_{n}=\sigma_{1}\sigma_{2}\cdots\sigma_{n}\) and \(t_{k}=\sigma_{1}\sigma_{2}\cdots\sigma_{k}(0\leq k\leq n,t_{0}=\epsilon)\). Then, \(V_{s}(t_{n})=\sum\limits_{k=0}^{n}\beta^{|s|+k}c(st_{k},f_{st_{n}})\) is said to be the discount cost of choosing \(t_{n}\) after \(s\) under \(f\), where \(f_{st_{n}}(st_{k})=f(st_{k})\cap\Sigma_{st_{n}}(st_{k})\) and \(\Sigma_{st_{n}}(st_{k})=\{\sigma|st_{k}\sigma\in\overline{st_{n}}\}\). Particularly, if \(k=0\), i.e., \(t_{0}=\epsilon\), then \(V_{s}(\epsilon)=\beta^{|s|}c(s,\phi)=0\); if \(s=\epsilon\), then \(st_{n}=t_{n}\) and \(V_{\epsilon}(t_{n})=\sum\limits_{k=0}^{n}\beta^{k}c(t_{k},f_{t_{n}})\), where \(t_{0}=\epsilon\) means that choosing \(f(s)\) at \(s\) has nothing to do with \(\Sigma\). In Definition 5, if some string can be divided into two pieces, a formula is formulated to simplify the computation of discount cost in the following conclusions:  
We consider \(t=st^{\prime}\). Then, we have \(V_{\epsilon}(t)=V_{\epsilon}(s)+V_{s}(t^{\prime})\). Proof. : For \(t=st^{\prime}\), we proved the following formula, where \(s=\sigma_{1}\sigma_{2}\cdots\sigma_{|s|}\) and \(t^{\prime}=\sigma_{|s|+1}\sigma_{|s|+2}\cdots\sigma_{|s|+n}\):  
\[V_{\epsilon}(t) =\sum\limits_{k=0}^{|s|+n}\beta^{k}c(t_{k},f_{t})\] \[=c(\epsilon,f_{s})+\beta c(\sigma_{1},f_{s})+\cdots+\beta^{|s|}c (s,f_{s})+\sum\limits_{k=1}^{n}\beta^{|s|+k}c(st^{\prime}_{k^{\prime}},f_{st^ {\prime}})\] \[=\sum\limits_{k=0}^{|s|}\beta^{k}c(\sigma_{1}\cdots\sigma_{k},f_{ s})+\sum\limits_{k=0}^{n}\beta^{|s|+k}c(st^{\prime}_{k^{\prime}},f_{st^{ \prime}})\] \[=V_{\epsilon}(s)+V_{\text{s}}(t^{\prime})\]  
To generalize the above Proposition 1, we have the following conclusion as Proposition 2:  
We consider \(s=s_{1}s_{2}\cdots s_{k}\in L(G)\). Then, we have \(V_{\epsilon}(s)=V_{\epsilon}(s_{1})+V_{s_{1}}(s_{2})+\cdots+V_{s_{1}s_{2} \cdots s_{k-1}}(s_{k})\). Proof. : The proof can proceed by induction. Base case: If \(k=1\), then it holds that \(V_{\epsilon}(s)=V_{\epsilon}(s_{1})\). Inductive hypothesis: Suppose that we have \(V_{\epsilon}(s_{1}\cdots s_{j-1}s_{j})=V_{\epsilon}(s_{1})+V_{s_{1}}(s_{2})+ \cdots+V_{s_{1}s_{2}\cdots s_{j-1}}(s_{j})\) if \(k=j\). Inductive step: For \(k=j+1\), we prove that \(V_{\epsilon}(s_{1}\cdots s_{j-1}s_{j}s_{j+1})=V_{\epsilon}(s_{1})+V_{s_{1}}(s_{2 })+\cdots+V_{s_{1}s_{2}\cdots s_{j-1}}(s_{j})+V_{s_{1}s_{2}\cdots s_{j}}(s_{j+1})\).