# Dynamic Controllability of Processes without Surprises
## 4 Sudden Termination and Sudden Start Problems, and Semi-Dynamic Controllability
### Sudden Termination Problem  
We briefly recap here the characterization of the sudden termination problem for a semi-contingent activity, and the conditions that have to be satisfied, such that a sudden termination problem might occur [11]. First, we highlight the distinction between sudden termination constellation (STC) and sudden termination pattern (STP). In an STP, constraints can only be satisfied with the sudden termination of an activity, while in the more general STC, it might depend on the controller, whether a sudden termination actually occurs. In an STP, sudden termination needs to necessarily happen, while in an STC that is not an STP it is possible to avoid sudden termination.  
We have shown in prior work that an STC requires at least two constraints between two activities. Given two activities \(C\) (contingent) and \(S\) (semi-contingent), a sudden termination means that the admissible times for ending \(S\) depend on the observation of the end of \(C\), and this is not known when \(S\) starts. This requires the existence of a constraint \(c_{1}\) between the end events of \(C\) and \(S\).  
A sudden termination only occurs if \(C\) and \(S\) have to be executed concurrently, i.e., it is not possible that they are executed sequentially. This requires an additional constraint \(c_{2}\). When the end event \(S.e\) of \(S\) can always be executed before the end event \(C.e\) of \(C\), it cannot depend on the observed duration of \(C\). In a similar way, if \(S\) can always start after \(C\) has ended, the duration of \(C\) is already known at the start of \(S\).  
In an STC, for all possible start times of \(C\), _there exist_ certain start times for \(S\), such that, no matter how long \(S\) is enforced to take, some (uncontrollable) durations of \(C\) exist, which lead to the violation of some temporal constraint in the process. Instead in an STP, for all possible start times of \(C\), _for all_ start times for \(S\), no matter how long \(S\) is enforced to take, some (uncontrollable) durations of \(C\) exist, which lead to the violation of some temporal constraint in the process.  
**Definition 4** (Sudden Termination Constellation and Pattern): _Let \(P\) be a dynamically controllable process. Let \(S\) and \(C\) be activities in \(P\), with duration constraints \(d(S,S.d_{min},S.d_{max},sc)\) and \(d(C,C.d_{min},C.d_{max},c)\). Let \(\Phi\) be the set of constraints in \(P\)._  
\(S\) _and \(C\) are in a **sudden termination constellation (STC)** iff_  
\(\forall C.s\ \exists S.s\ \forall S.d_{min}\leq S.d\leq S.d_{max}\ \exists C.d_{min}\leq C.d\leq C.d_{max}:\ \
eg\Phi\)__  
\(S\) _and \(C\) are in a **sudden termination pattern (STP)** iff_  
\(\forall S.s,C.s\ \forall S.d_{min}\leq S.d\leq S.d_{max}\ \exists C.d_{min}\leq C.d\leq C.d_{max}:\ \
eg\Phi\)__We use the notation \(STC_{S,C}\) to indicate that \(S\) and \(C\) are in a sudden termination constellation, and \(STP_{S,C}\) for a sudden termination pattern.  
If there is an STP in a process, sudden termination cannot be avoided without changing the process model. If there is an STC but not an STP, the execution of a process can be dynamically scheduled so that all constraints are met and sudden termination is avoided. We are interested in verifying in which cases it is possible to prevent an STC to become an STP, i.e., whether the process controller is able to schedule the process without sudden termination.