1 Introduction
1.1 Background
1.2 Our goal and approach
1.3 Plan of the paper
2 Preliminaries
2.1 Reactive systems
-
An interaction between a reactive system and the environment is represented as an infinite word on alphabet \(2^{{ AP}}\), i.e., an infinite sequence \(s = (\alpha _0^O \cup \alpha _0^I) (\alpha _1^O \cup \alpha _1^I) \cdots \in (2^{{ AP}})^{\omega }\).
-
A reactive system is a function \(\mathcal {R}: (2^{{ IAP}})^* \rightarrow 2^{{ OAP}}\) that decides an output \(\alpha _n^O \in 2^{{ OAP}}\) at the current step, based on a sequence \(h \in (2^{{ IAP}})^*\) of inputs thus far.\(^{1}\)
2.2 Linear temporal logic (LTL)
2.2.1 Syntax and semantics
2.2.2 Realizability
2.2.3 Minimal bad prefixes
2.2.4 LTL-to-automata translation
2.3 Games
-
\(A=\langle V_0, V_1, \varGamma _0, \varGamma _1, E_0, E_1 \rangle \) is an arena, where
-
\(V_0\) (resp., \(V_1\)) is a disjoint set of states for Player 0 (resp., Player 1)
-
\(\varGamma _0\) (resp., \(\varGamma _1\)) is a set of actions for Player 0 (resp., Player 1),
-
\(E_0 : V_0 \times \varGamma _0 \rightarrow V_1\) (resp., \(E_1 : V_1 \times \varGamma _1 \rightarrow V_0\)) is a (possibly, partial) transition function which maps to \(V_1\) (resp., \(V_0\)) from \(V_0\) (resp., \(V_1\)) and \(\varGamma _0\) (resp., \(\varGamma _1\)),
-
-
\(v_{{ init}} \in V_0\) is the initial state,
-
\({ outcome}: (E_0 E_1)^{\omega } \rightarrow \mathbb {R}\) is a function that gives the outcome of a play \(\rho \in (E_0 E_1)^{\omega }\).
2.3.1 Safety games
2.3.2 Mean-payoff games
2.3.3 Strategies
2.3.4 Winning regions
2.3.5 Reactive systems as strategies
-
Players 0 and 1 represent system-side and environment-side players, respectively.
-
\(\varGamma _0\) is \(2^{{ OAP}}\), and \(\varGamma _1\) is \(2^{{ IAP}}\).
-
\(E_0\) may be partial, whereas \(E_1\) must be total.
-
An available play \(\rho = e_0 e_1\ldots \in { Play}(\mathcal {G})\) corresponds to an interaction \({ trace}(\rho ) \in (2^{{ AP}})^{\omega }\),
-
where a trace \({ trace}(\rho )\) on \(\rho \) is an infinite word \(({ act}(e_0) \cup { act}(e_1)) ({ act}(e_{2}) \cup { act}(e_{3}))\cdots ({ act}(e_{2i}) \cup { act}(e_{2i+1}))\ldots \).
-
-
\(\mathcal {R}^{\nu _0}(\varepsilon )=\alpha _0^O\) and \(\mathcal {R}^{\mu _0}(\alpha _0^I \ldots \alpha _i^I)=\alpha _{i+1}^O\) where, for \(0 \le j \le i\),
-
\(v_0=v_{{ init}}\), \(v_{2(j+1)} = E_1( E_0(v_{2j},\alpha _{j}^O),\alpha _{j}^I)\), and
-
\(\alpha _0^O={ act}(\nu _0(v_{0}))\) and \(\alpha _{j+1}^O=\nu _{0}({ act}(v_{2(j+1)}))\).
-
2.4 Safraless synthesis
LTL2UCWA_translation
, i.e., \(\mathcal {A}^{\varphi }=\mathcal {T}({\varphi })\). We next derive an under-approximation to \(\mathcal {A}^{\varphi }\) using k and transform the under-approximated k-UCWA \(\mathcal {T}^k({\varphi })\) into a safety game \(\mathcal {S}^{\varphi ,k}\) (the procedure \(\texttt {BUCWA2SG\_transformation}\) at Line 4). This transformation consists of determinizing \(\mathcal {A}^{\varphi }\) and dividing its states/transitions into system-side and environment-side ones based on the respective sets \({ OAP}\) and \({ IAP}\) of output and input propositions. \(\mathcal {S}^{\varphi ,k}\) has characteristics described in Sect. 2.3.5. Additionally, the winning condition of \(\mathcal {S}^{\varphi ,k}\) corresponds to the under-approximated property \(\mathcal {L}(\mathcal {T}^k({\varphi }))\) of \(\varphi \). Therefore, if the system-side player wins for a play \(\rho \) on \(\mathcal {S}^{\varphi ,k}\), \({ trace}(\rho )\) satisfies \(\varphi \). Then we extract a winning region \(\mathcal {W}^{\varphi ,k}\) for the system-side player on \(\mathcal {S}^{\varphi ,k}\) (the \(\texttt {extract\_winning\_region}\) at Line 5). If the initial state of \(\mathcal {S}^{\varphi ,k}\) is in \(\mathcal {W}^{\varphi ,k}\) (Line 6), there exists a reactive system that realizes \(\varphi \). Otherwise, k is incremented (Line 9), and we repeat a loop from Line 3. Lines 1–10 check the realizability of \(\varphi \), and in practice the unrealizability of \(\varphi \) is also checked in parallel. Finally, we concretely compose a winning strategy \(\nu \) for the system-side player on \(\mathcal {W}^{\varphi ,k}\) (the procedure \(\texttt {winning\_strategy}\) at Line 11).3 Mean-payoff objectives
3.1 Basic idea
3.2 Syntax and semantics
3.2.1 Choice on LTL-to-automata translators
3.2.2 The relations between mean-payoff objectives and \(\mathbf{G }\mathbf{F }\)-/\(\mathbf{F }\mathbf{G }\)-formulae
3.2.3 Mean-payoff objectives for words with periodic suffixes
3.3 Interpretation
3.3.1 General cases
3.3.2 Special cases
3.4 Assumptions
4 Our synthesis method
4.1 Outline
LTL2UCWA_translation
8 and BUCWA2SG_transformation
in Algorithm 1 (either Lines 3–9 or 12–13), where LTL2UCWA_translation
implements \(\mathcal {T}\). It is then transformed into a mean-payoff game \(\mathcal {M}^{t_i}\) (using either procedure \(\texttt {SG2MPG\_transformation\_S}\) at Line 10 or \(\texttt {SG2MPG\_transformation\_B}\) at Line 14). For each game \(\mathcal {M}^{t_i}\), its transition functions are total, and an outcome of any play \(\rho \) equals
. Second, we construct a weighted synchronized product of an input winning region \(\mathcal {W}^{\varphi ,k}\) and the mean-payoff games \(\mathcal {M}^{t_1}, \ldots , \mathcal {M}^{t_n}\) (the procedure \(\texttt {weighted\_synchronized\_product}\) at Line 17). For the synchronized product mean-payoff game \(\mathcal {M}^{\varphi ,k,t}\), the outcome of a play \(\rho \) is
. Finally, we find an optimal strategy \(\nu \) for the system-side player (Player 0) on \(\mathcal {M}^{\varphi ,k,t}\) using the standard technique for solving mean-payoff games [12, 20] (the procedure \(\texttt {optimal\_strategy}\), Line 17).
4.2 Mean-payoff games for simple mean-payoff objectives
4.2.1 Mean-payoff game for \({\textsf {MP}}({\textsf {S}}(\chi ))\)
LTL2UCWA_translation
, implementing \(\mathcal {T}\), at Line 4 in Algorithm 2. In the transformation from \(\mathcal {A}^{\varphi '}\) into a mean-payoff game \(\mathcal {M}^{{\textsf {S}}(\chi )}\) for \({\textsf {MP}}({\textsf {S}}(\chi ))\), we use transitions labeled \(\hat{p}\) as guides to set payoffs.BUCWA2SG_transformation
at Line 6 in Algorithm 2. Note that both \(E_0\) and \(E_1\) are total. The mean-payoff game \(\mathcal {M}^{{\textsf {S}}(\chi )} =\langle \langle V_0 \cap S, V_1 \cap S, 2^{{ OAP}}, 2^{{ IAP}}, E_0',E_1' \rangle , v_{{ init}}, W \rangle \) constructed by the procedure \(\texttt {SG2MPG\_transformation\_S}\) at Line 10 in Algorithm 2 isBUCWA2SG_transformation
at Line 8 in Algorithm 2. The mean-payoff game \(\mathcal {M}^{{\textsf {S}}(\chi )} = \langle \langle V_0 \cap S, V_1 \cap S, 2^{{ OAP}}, 2^{{ IAP}}, E_0'', E_1'' \rangle ,v_{{ init}},W' \rangle \) constructed by the procedure \(\texttt {SG2MPG\_transformation\_S}\) at Line 10 in Algorithm 2 is4.2.2 Mean-payoff game for \({\textsf {MP}}({\textsf {B}}^{b}(\varphi ))\)
LTL2UCWA_translation
at Line 12 in Algorithm 2. On a determinized safety word automaton of \(\mathcal {T}^b(\varphi )\) (resp., in \(\mathcal {A}^{\varphi }\)), reaching (resp., more than b-times visiting) rejecting states on a run means a minimal bad prefix of \(\mathcal {L}(\mathcal {T}^b(\varphi ))\) has occurred in its word. In the transformation from \(\mathcal {A}^{\varphi }\) with bound b into a mean-payoff game \(\mathcal {M}^{{\textsf {B}}^{b}(\varphi )}\) for \({\textsf {MP}}({\textsf {B}}^{b}(\varphi ))\), we use rejecting states as guides to set payoffs.BUCWA2SG_transformation
at Line 13 in Algorithm 2. The mean-payoff game \(\mathcal {M}^{{\textsf {B}}^{b}(\varphi )} = \langle \langle V_0, V_1 \cup \{v_{ mid}\}, 2^{{ OAP}}, 2^{{ IAP}}, E'''_0, E'''_1 \rangle , v_{{ init}}\), \(W'' \rangle \) constructed by the procedure \(\texttt {SG2MPG\_transformation\_B}\) at Line 14 in Algorithm 2 is4.3 Weighted synchronized product
4.4 Correctness and optimality
4.5 Complexity
5 Experimental evaluation
5.1 Implementation and experimental environment
5.2 Experiments
n
| Execution time (s) | Size | |||||||
---|---|---|---|---|---|---|---|---|---|
\(\alpha \)
|
\(\beta \)
|
\(\gamma \)
| Total |
\(|\mathcal {W}|\)
|
\(|\mathcal {M}|\)
|
\(|\mathcal {P}|\)
|
\(|\mathcal {P}^{\text {abs}}|\)
|
\(|\mathcal {R}|\)
| |
2 | 0.022 | 0.035 | 0.027 | 0.201 | 5 | 59 | 116 | 59 | 5 |
3 | 0.026 | 0.061 | 0.063 | 0.278 | 9 | 199 | 460 | 84 | 17 |
4 | 0.022 | 0.472 | 0.183 | 0.818 | 17 | 707 | 1684 | 92 | 47 |
5 | 0.023 | 20.56 | 0.604 | 21.38 | 33 | 2599 | 5710 | 92 | 99 |
6 | 0.025 | 884.6 | 1.726 | 887.0 | 65 | 9779 | 18136 | 92 | 179 |
7 | 0.026 | TO | – | – | 129 | – | – | – | – |
n
| Execution time (s) | Size | |||||||
---|---|---|---|---|---|---|---|---|---|
\(\alpha \)
|
\(\beta \)
|
\(\gamma \)
| Total |
\(|\mathcal {W}|\)
|
\(|\mathcal {M}|\)
|
\(|\mathcal {P}|\)
|
\(|\mathcal {P}^{\text {abs}}|\)
|
\(|\mathcal {R}|\)
| |
2 | 0.029 | 0.031 | 0.152 | 0.335 | 55 | 4 | 94 | 75 | 15 |
3 | 0.047 | 0.029 | 1.765 | 1.965 | 471 | 4 | 854 | 315 | 87 |
4 | 0.714 | 0.029 | 112.7 | 113.5 | 6449 | 4 | 12150 | 1624 | 711 |
5 | 61.12 | 0.026 | TO | – | 125,309 | 4 | 240,484 | 8353 | – |
n
| Execution time (s) | Size | |||||||
---|---|---|---|---|---|---|---|---|---|
\(\alpha \)
|
\(\beta \)
|
\(\gamma \)
| Total |
\(|\mathcal {W}|\)
|
\(|\mathcal {M}|\)
|
\(|\mathcal {P}|\)
|
\(|\mathcal {P}^{\text {abs}}|\)
|
\(|\mathcal {R}|\)
| |
2 | 0.025 | 0.029 | 0.019 | 0.085 | 20 | 4 | 23 | 18 | 8 |
3 | 0.047 | 0.030 | 0.132 | 0.362 | 101 | 4 | 110 | 54 | 25 |
4 | 0.686 | 0.029 | 0.750 | 1.620 | 810 | 4 | 861 | 188 | 148 |
5 | 25.03 | 0.031 | 13.29 | 38.76 | 8693 | 4 | 9126 | 691 | 1299 |
6 | TO | – | – | – | – | – | – | – | – |
k
| Execution time (s) | Size | MP | ||||||
---|---|---|---|---|---|---|---|---|---|
\(\alpha \)
|
\(\beta \)
|
\(\gamma \)
| Total |
\(|\mathcal {W}|\)
|
\(|\mathcal {P}|\)
|
\(|\mathcal {P}^{\text {abs}}|\)
|
\(|\mathcal {R}|\)
| value | |
3 | 0.468 | 0.029 | 0.065 | 0.763 | 165 | 197 | 58 | 37 | −0.500 |
6 | 5.246 | 0.027 | 1.995 | 7.281 | 1194 | 1185 | 323 | 93 | −0.200 |
9 | 23.15 | 0.029 | 4.055 | 27.86 | 3015 | 3159 | 855 | 153 | −0.125 |
12 | 68.12 | 0.024 | 33.51 | 103.1 | 5852 | 6069 | 1638 | 213 | −0.091 |
15 | 156.7 | 0.031 | 85.16 | 224.9 | 9635 | 9915 | 2673 | 273 | −0.071 |
18 | 352.0 | 0.032 | 432.1 | 790.9 | 14,354 | 14,697 | 3960 | 333 | −0.059 |
19 | 415.3 | 0.040 | 350.6 | 779.8 | 16,135 | 16,499 | 4444 | 353 | −0.056 |
20 | 535.3 | 0.156 | 650.6 | 1157 | 18,020 | 18,405 | 4958 | 373 | −0.053 |
21 | 631.7 | 0.314 | TO | – | 20,009 | 20,415 | 5499 | – | – |
5.3 Summary
-
We can obtain a best-effort system from an unrealizable specification, by interpreting low-priority subspecifications into a mean-payoff objective.
-
Our method can treat non-trivial scale instances in times that are practical.
-
We can obtain a reasonably good system by choosing bound k (which is an over-approximation parameter for a given must LTL specification) considering the available computational resource and desired mean-payoff value.