4.1.2. Case 2: and such that .
In case 2, the condition means that any secret can not be distinguished from some non-secret in the closure .
For secret
K and its closure
, we have
. If there exists a closed-loop system
such that
, 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 if is controllable w.r.t. .
If
is controllable w.r.t.
, there exists supervisor
f such that
. For the closed-loop behavior
, it satisfies the two constraint conditions of model (
2). So, the feasible region of model (
2) is not empty.
If
is not controllable w.r.t.
, we can find a controllable and closed superlanguage
of
. Obviously, the superlanguage
not only ensures the opacity of
K(in Theorem A1 of Appendix), but also maximizes the secret
K. So, the feasible region of model (
2) is not empty.
According to the above analysis, the following Algorithm 2 returns a closed-loop behavior to solve model (
2).
By theoretical proof, the following Theorem 5 states that Algorithm 2 can produce an optimal solution of model (
2).
Theorem 5. Given system G and secret . In case 2 of scenario 1, the closed-loop produced in Algorithm 2 is an optimal solution of model (2).
Proof. Firstly, we will prove that the closed-loop behavior
produced in Algorithm 2 is a feasible solution of optimal model (
2).
At Line 1, M is a closed and controllable sublanguage of . At Line 5, it is obvious that is the infimal closed and controllable superlanguage of . So, Line 3 and Line 6 can produce a supervisor f such that .
Therefore, we have
which means constraint condition 2 of model (
2) is true.
By Theorem A1 of Appendix, we conclude that
can ensure the opacity of
K under case 2 of scenario1, which implies that constraint condition 1 of model (
2) is true.
From the above points, it is true that
produced in Algorithm 2 is a feasible solution of model (
2).
Nextly, we prove by contraction that the discount total choosing costs of
produced in Algorithm 2 is minimal. Assume that there exists a feasible solution
of model (
2) such that
.
According to the constraint condition 2, we have . Afterwards, we consider the controllability of .
If is controllable, it holds that by Line 2-3, which means . So, we have , which contracts with .
If is not controllable, it holds that by Line 5-6. For any , there exists such that and hold. As shown in Theorem 3 and Assumption *, we have . So, it holds that .By the formula , it is true that , which contracts with .
In summary, it is true that , which means that the discount total choosing costs of produced in Algorithm 2 is minimal.
□
According to the proof of Theorem 5, we have the following corollaries.
Corollary 1. Given a language L. If a new language as the concatenation of any string of L with an uncontrollable string (i.e. ), then the discount total choosing costs of L and are the same, that is, .
Corollary 2. Given system G and secret . In case 2 of scenario 1, holds, where is the closed-loop system produced in Algorithm 2.
Example 3. Given a finite transition system shown in Figure 4, where . Obviously, for system G, Assumption * is true. Suppose that secret which can be recognized by . To show choosing cost , a label means if there is a transition from p to q by ·, the notation n denotes the choosing cost . For control input Γ, the cost of choosing is defined as .
Assume that adversary has complete knowledge of the supervisor’s control policy. From adversary’s view, adversary can see partial set of events, denoted by . For secret K, it can be verified that K is opaque w.r.t. and (scenario 1). To reduce the choosing cost, a closed-loop system can be obtained by Algorithm 2,where is shown in Figure 5.
By Definition 4 and Algorithm 1, is minimal.
4.1.3. Case 3: and such that
In case 3, the condition means that there exists some secret in K such that all the non-secret confused with them are outside of .
For , let be a set of some secret which can not be confused by any string in , and be a set of strings which can confuse the secret of . For language L, we call be the coset (or equivalence class) of s w.r.t. L and , where is said to be equivalent string of s. And, is defined as the quotient set of L w.r.t. the coset . For 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 and quotient set are also finite.
To solve model (
2), Algorithm 3 shown as follows is proposed by calling function 1 (seen in Algorithm 4) and function 2 (seen in Algorithm 5).
In Line 13 of Algorithm 3, function 1 (in Algorithm 4 shows how to compute the choosing cost outside of the closure of secret K. For a quotient set, take any string of some coset and get a prefix with a maximal length in the closure of secret. And then, we compute the discount cost of choosing the remaining string after the prefix. The specific process is shown in Algorithm 4.
In Line 14 of Algorithm 3, function 2 constructs a weighted directed diagram with multi-stages and produces a path with minimal discount total choosing cost. For the diagram, the elements of a set
H are regarded as the stages, and the elements of
are defined as the nodes of each stage. Based on dynamic programming, the optimal weight between different nodes of adjacent stages is obtained in function 3 (in Algorithm 6). Then, the weighted directed diagram is got. For every node of the diagram, an ordered pair is obtained by calling function 3 (in Algorithm 6). For the ordered pair, the first element is the set of shortest path with minimal discount total choosing cost from starting node to current node, and the second is the discount total choosing cost of the path. When the current node is ending node, the path with minimal discount total choosing cost is obtained. The specific processes are shown in Algorithms 5 and Algorithms 6.
According to the calculaton process of Algorithm 3, we have the following theorem to show the solution of model (
2).
Theorem 6. Given system G and secret . In case 3 of scenario 1, the closed-loop behavior produced in Algorithm 3 is an optimal solution of model (2).
Proof. We firstly show that closed-loop behavior
produced in Algorithm 3 is a feasible solution of optimal model (
2).
- 1.
-
To prove the opacity (the first constraint condition).
As shown in case 3, the secret of can be confused by the non-secret strings of . For , all the non-secret in which can not be distinguished with the secret in are in of Line 12. At Lines 14 and 15, the string is from , where . At Lines 15 and 16, we have and . So, the closed-loop behavior produced in Algorithm 3 can ensure the opacity of secret K.
- 2.
To prove the secret remained in the closed-loop system is maximal (the second constraint condition).
According to the Lines 15 and 16, it holds that . So, the second constraint condition is true.
To sum up, the closed-loop behavior
obtained in Algorithm 3 is a feasible solution of optimal model (
2).
Secondly, we will show that the discount total choosing cost of closed-loop behavior produced by Algorithm 3 is minimal.
Since it holds that
, the discount total choosing cost of
can be computed as follows.
Obviously,
is finite. To minimize the discount total choosing cost of
, we need to show
is minimal by formula (
3). As shown at Line 1 of Algorithm 3, it is obvious that language
L contains all the non-secret in
, which can not distinguish with all the secret of
. So, if we want to make
is minimal, all the strings
s in
must come from
L. And then
holds. According to Lines 3-11 of Algorithm 3, we have
. And, all the strings in
can confuse one secret of
and its equivalent secret. Obviously, only one string chosen in each set
of
H is the necessary condition to minimize
.
At Line 13 of Algorithm 3 (i.e. function 1 of Algorithm 4), all the strings in L are traversed and the choosing cost after can be obtained, where and .
At Line 14 of Algorithm 3, a diagram with multi-stages is constructed in , where initial node and ending node are virtual, are the set of nodes in j-th stage. To only pick a string in each , we will find a path from to . And then, Algorithm 6 is proposed to optimize the weight of a transition from node to node s between adjacent stages. For the optimal weight, it is obvious that the discount total choosing cost of each node (i.e. string) of the path is equal to the total weight of the path (at Line 12 of Algorithm 5). At Lines 3-19 of Algorithm 5, the shortest path and its minimal discount total choosing cost of j-th stage can be obtained by and of -th stage based on dynamical programming. As shown in the above analysis about Line 14 of Algorithm 3(i.e. function 2 in Algorithm 5), the first element of the ordered pair () is the shorted path (i.e. the set of strings) with minimal discount total choosing cost from starting node to current node , and the second is the discount total choosing cost of the path. When the current node is (i.e. Line 20 of Algorithm 5), is the shorted path from initial to ending node and is the minimal discount total choosing cost of the path (see Lines 21-25 of Algorithm 5). So, is the subset of L, whose discount total choosing cost is minimal and whose strings can confuse all the secret of .
At Lines 16 and 17 of Algorithm 3, the closed-loop behavior can be ensured to be controllable and closed by Corollary 2. And the discount total choosing is minimal as shown in above analysis.
All in all, the closed-loop behavior
produced in Algorithm 3 is an optimal solution of model (
2). □
Example 4. Given a finite transition system and secret shown in Figure 6, where and K can be recognized by . Suppose that adversary has complete knowledge of the supervisor’s control policy, and the observed set of events by adversary is . It is verified that K is opaque w.r.t. and . But, K is not opaque w.r.t. and , i.e. secret can not be confused by any non-secret of . Obviously, case 3 of scenario 1 is fulfilled and Assumptions * are true. Nextly, we will construct a closed-loop behavior by Algorithm 3.
For system G and secret K, we get a language , where the strings in can not be confused by any strings of . From the opacity of , we can find a sub-language , whose strings can not be distinguished with the secret in . For language L, we give the following computational process.
Take , and then we have and .
Take , and then we have and .
So, the quotient set is a partition of L.
For coset , we can compute the choosing cost of suffix of the non-secret string out of in the first stage (seen in the function 1 of Algorithm 4.
If , we have and .
If , we have and .
If , we have and .
For coset , we can similarly get the following in the second stage.
If , we have and .
If , we have and .
If , we have and .
If , we have and .
Based on and the choosing cost out of above, a weighted directed diagram shown in Figure 7 is constructed by using Algorithm 5 calling Algorithm 6. In the diagram, every node denoted by ⊙ is shown as a fraction. For the fraction, its numerator is a non-secret string in , and its denominator is , where and .
To show the weight between nodes of adjacent stages, some weight is given as follows by Definition 4.
.
By Algorithm 5, the label and minimal choosing cost of a path from initial node to current node s are computed in Table 1.
In Table 1, we have for the ending node . From Line 16 of Algorithm 3, we know that shortest path is . So, it holds that .Since (by Algorithm 1 is finite, . So, in Line 17, we have shown in Figure 8.
In Figure 8, it is verified that by Algorithm 1.