
In the following we use an arbitrary UCA with
control action A and context C. We define subfor-
mulas for the context variables v, representing that C
is present, and control action a, meaning A is sent.
Hence, for UCA1, we set a := accelerate is sent and
v := dist = brakeDist. We will use a short form of the
trace definition: We use (v, a) or (¬v, ¬a), meaning
the input and internal variables are set according to v
or ¬v, respectively. The variables that do not occur
in v can have any value, the state s can be any state,
and the output must (not) contain A. Figure 1 gives an
overview of the traces we reject as unsafe.
Provided Formula. For PROVIDED UCAs we use
the formula proposed by Abdulkhaleq et al.:
G(v → ¬a) (1)
It states that every time the context holds, the con-
trol action is not sent. For UCA1 this ensures that
accelerate is not sent when the distance is the break-
ing distance. Traces leading to the UCA as seen in
Figure 1a violate the formula.
Not-Provided Formula. UCAs of type NOT-
PROVIDED can be interpreted in two ways. Either in
every reaction where the context holds the control
action must be sent or during the timespan where the
context holds continuously, the control action must
be sent at least once. Since the first interpretation
also covers the types TOO-LATE and STOPPED-
TOO-SOON, we propose a formula for the second
interpretation.
For UCA3 the formula must ensure that decelerate
is sent at least once when the distance is the breaking
distance. A trace as shown in Figure 1b where the
context changes to false although the control action
was not yet sent should evaluate to false. Let
ψ := v → (aR v ∧ F a),
χ := G((¬v ∧ X v) → X(aR v ∧ F a))
then we translate a UCA of type NOT-PROVIDED to
the following formula:
ψ ∧ χ (2)
In χ the implicant ¬v ∧ X v holds in the reactions
directly before v changes from false to true. This
means the next reaction is the first time where the con-
text holds, and in this reaction ((aR v) ∧ F a) should
hold. (aR v) ensures that when v changes to false, the
control action has to have been sent before.
Since (aR v) evaluates also to true when the con-
trol action is not sent as long as the context holds in-
definitely, we ensure with F a that eventually the con-
trol action will be sent. ψ ensures that the UCA does
not occur in the first reaction.
Too-Late Formula. For TOO-LATE UCAs we only
have to consider the first moment in which the con-
trol action should be provided. For UCA5 we want
to provide decelerate immediately when the distance
changes to the break distance. This leads to the fol-
lowing formula:
(v → a) ∧ G(¬v → X(v → a)) (3)
The second conjunct ensures that traces such as
shown in Figure 1c do not occur. The moment the
control action should be applied is when the context
currently holds and did not hold in the previous reac-
tion. In the formula we capture this in the following
way: The control action should be applied in the next
reaction if the context currently does not hold and in
the next reaction does hold. The first conjunct of (3),
namely v → a, ensures that the UCA does not occur in
the first reaction.
Too-Early Formula. We use the following formula
for TOO-EARLY UCAs:
G((¬v ∧ X v) → ¬a) (4)
The reaction where the context holds but did not
hold in the previous reaction is the first one where
the control action is allowed to be sent. Hence, we
must ensure that before this reaction the control action
is not sent (see Figure 1d). The implicant, namely
¬v ∧ X v, is true if the current reaction is the last one
in which v is false before it switches to true. In such
a reaction the control action is not allowed to be sent,
which is guaranteed by the implication.
Applied-Too-Long Formula. For UCAs of type
APPLIED-TOO-LONG we use the following formula:
G((v ∧ a) → X(¬v → ¬a)) (5)
To ensure an action is not applied too long, we
have to inspect the reactions where the control action
is already applied while the context holds (v ∧ a). In
these reactions, we must ensure that the control action
is not sent anymore when the context does not hold
any longer. Hence, we must check whether the con-
text still holds in the next reaction (X(. . .)). If it does
not, the control action must not be sent. Hence, traces
such as shown in Figure 1e violate the formula. For
UCA2 this ensures that we immediately stop sending
accelerate when the distance value is no longer equal
to the accelerate distance.
Stopped-Too-Soon Formula. To guarantee that a
control action is not stopped too soon, we must ensure
that after it is sent the first time it is continuously sent
Safe Behavior Model Synthesis: From STPA to LTL to SCCharts
135