# Automatic Addition of Fault-Tolerance in Presence of Unchangeable Environment Actions +
## 7 Discussion and Extensions of Algorithms  
In this section, we consider problems related to those addressed in Sections 3 and 5. Our first variation focuses on Definition 6. In this definition, we assumed that the environment is _fair_. Specifically, at least \(k-1\) actions execute between any two environment actions. We consider variations where (1) this property is satisfied eventually. In other words, for some initial computation, environment actions may prevent the program from executing. However, eventually, fairness is provided to program actions and (2) program actions are given even with reduced fairness. Specifically, we consider the case where several environment actions can execute in a row but program actions execute infinitely often. Our second variation is related to the invariant of the revised program, \(S^{\prime}\) and the invariant of the original program, \(S\). In the case of adding stabilization, we considered \(S^{\prime}=S\) whereas, in the case of adding fault-tolerance, we considered \(S^{\prime}\subseteq S\). **Changes for adding stabilization and fault-tolerance with an eventually fair environment. ** No changes are required to Algorithm 1 even if the environment is eventually fair. This is due to the fact that this algorithm constructs programs that provide recovery from _any_ state, that is, it will provide recovery from the state reached after the point when fairness is restored. For Algorithm 2 and Algorithm 3, we should change the input \(f\) to include \(\delta_{e}\cup\delta_{f}\). The resulting algorithm will ensure that the generated program will allow unfair execution of the program in initial states. However, fault-tolerance will be provided when the fairness is restored. **Changes for adding stabilization and fault-tolerance with multiple consecutive environment actions. ** If environment actions can execute consecutively, we can change input \(\delta_{e}\) to be its transitive closure. In other words, if \((s_{0},s_{1})\) and \((s_{1},s_{2})\) are transitions in \(\delta_{e}\), we add \((s_{0},s_{2})\) to \(\delta_{e}\). With this change, the constructed program will provide stabilization or fault-tolerance even if environment transitions can execute consecutively. **Changes for adding stabilization and fault-tolerance based on relation between \(S^{\prime}\) (invariant of the fault-tolerant program) and \(S\) (invariant of the fault-intolerant program)**. No changes are required to Algorithm 1 even if we change the problem statement to allow \(S^{\prime}\subseteq S\) without affecting soundness or completeness. Regarding soundness, observe that the program generated by this algorithm ensures \(S^{\prime}=S\). Hence, it trivially satisfies \(S^{\prime}\subseteq S\). Regarding completeness, the intuition  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline  & \multicolumn{4}{c}{**Addition Time (s)**} \\ \cline{2-5}
**Size** & \multicolumn{2}{c}{**Failsafe**} & \multicolumn{2}{c}{**Masking**} \\ \cline{2-5}  & **Arbitrary Fault** & **Same-Location Fault** & **Arbitrary Fault** & **Same-Location Fault** \\ \hline
4 & 0.006 & 0.009 & 0.009 & 0.057 \\
5 & 0.019 & 0.027 & 0.043 & 0.176 \\
6 & 0.006 & 0.018 & 0.023 & 0.129 \\
7 & 0.007 & 0.017 & 0.016 & 0.197 \\
8 & 0.004 & 0.012 & 0.013 &  
is that if it was impossible to recover to states in \(S\) then it is impossible to recover to states that are a subset of \(S\). Regarding Algorithm 2 and Algorithm 3, if \(S^{\prime}\) is required to be equal to \(S\) then they need to be modified as follows: in these algorithms if any state \(S\) is removed (due to it being in \(ms_{2}\), deadlocks, etc.) then they should declare failure. **Other applications of our algorithms. ** In this paper, we considered the shepherding application as a way to illustrate the role of environment actions. The shepherding program is an instance of several other programs. For example, consider a smart cruise controller.