D.3.3 ALGORITHMS FOR INCREMENTAL ... - SecureChange
D.3.3 ALGORITHMS FOR INCREMENTAL ... - SecureChange
D.3.3 ALGORITHMS FOR INCREMENTAL ... - SecureChange
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Dealing with Known Unknowns: A Goal-based Approach 21<br />
Algorithm 3. Calculating max belief and residual risk using DAT.<br />
1 procedure calcMBRR(DAT : DAT, C : set of Goal, out mb, rr : number)<br />
2 begin<br />
3 trails ←∅ ;<br />
4 totalBelief ←0;<br />
5 mb ←0;<br />
6 for each 〈 S i, mb i, rr i, T i 〉 in DAT do<br />
7 if (C ⊇ S i and T i /∈ trails) then<br />
8 mb ←max(mb, mb i);<br />
9 totalBelief ←totalBelief + (1 − rr i);<br />
10 trails ←trails ∪ {T i}<br />
11 rr ←1 − totalBelief;<br />
12 end<br />
This values need to be multiplied by the complexity of the join and concat<br />
operations which is bounded by the number of design alternatives in the DAT.<br />
The second point of the theorem is that DATs for all nodes are properly generated<br />
when the algorithm terminates. Since join and concat operators are<br />
commutative and associative (see Lemma 1), the DAT calculation of a node by the<br />
for loop at line 9 obviously follows Formula 9. Furthermore, when a node have<br />
all of its children processed, it is immediately put in queue Q. This means that it<br />
will be processed sometime later. Therefore, when the algorithm terminates, all<br />
nodes have their DAT calculated as Formula 9.<br />
Theorem 2 (Stability of DAT) Each time a node changes, its DAT as well as its<br />
ancestors’ DATs are updated.<br />
Proof (Theorem 2) When Algo. 1 is running, once a node x has been visited,<br />
REACH[x] is set to -1 (line 8). After that, DAT[x] is no longer touch by Algo. 1<br />
because of the precondition check at line 7.<br />
Later on, if users change x e.g., adding new predecessors, Algo. 2 is invoked.<br />
Therefore, the DATs of x and its ancestors are updated.<br />
Algo. 3 presents the algorithm calculating max belief and residual risk of a<br />
configuration C using DAT of the root node, which generated by Algo. 1. Basically,<br />
this algorithm is a translation of Formula 10 in programming language. The<br />
algorithm walks though all elements DA i of the DAT (the for loop at line 6),<br />
checks whether C supports DA i , and there is no DA j which have the same trail<br />
with DA i . For each matched element, the max belief and total belief values are<br />
updated (line 8–9). When the for loop terminates, the residual risk is the complement<br />
of calculated total belief (line 11).<br />
Example 5 (Max Belief, Residual Risk and DAT) We apply the algorithm to the<br />
hypergraph denoted in Example 4. Table 2 presents some entries in the DAT of the<br />
root goal g 1 , for the full DAT (g 1 ), please refer to Table 3 in the appendix. Next, we<br />
apply Formula 10 to calculate the max belief and residual risk of a configuration<br />
C= {g 9 , g 12 , g 6 , g 7 , g 11 , g 15 , g 16 , g 17 , g 19 , g 20 } as follows.