{'fraction_non_alphanumeric': 0.04653712439231979, 'fraction_numerical': 0.009203560248698086, 'mean_word_length': 3.7471067588851605, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 50, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
A theory of robust software synthesis

A key property for systems subject to uncertainty in their operating environment is robustness, ensuring that unmodelled, but bounded, disturbances have only a proportionally bounded effect upon the behaviours of the system. Inspired by ideas from robust control and dissipative systems theory, we present a formal definition of robustness and algorithmic tools for the design of optimally robust controllers for omega-regular properties on discrete transition systems. Formally, we define metric automata - automata equipped with a metric on states - and strategies on metric automata which guarantee robustness for omega-regular properties. We present fixed point algorithms to construct optimally robust strategies in polynomial time. In contrast to strategies computed by classical graph theoretic approaches, the strategies computed by our algorithm ensure that the behaviours of the controlled system gracefully degrade under the action of disturbances; the degree of degradation is parameterized by the magnitude of the disturbance. We show an application of our theory to the design of controllers that tolerate infinitely many transient errors provided they occur infrequently enough.


INTRODUCTION
Reactive software systems that respond directly or indirectly to information coming from an uncertain environment are a fundamental component of many mission-critical applications-in healthcare, energy-distribution, and industrial automation-with enormous societal impact. It is widely recognized that the current design and verification methodologies fall short of what is required to design these systems in a robust yet costeffective manner. Current approaches to system design and verification are only able to differentiate between absolutely correct behaviour and incorrect behaviour, providing no way of quantifying precisely the effects of errors. Hence a catastrophic failure is indistinguishable from a small deviation and no guarantees as to the resulting effects on the nominal system behaviour may be made. Clearly, this view is overly restrictive. First, reactive systems need to operate for extended periods of time in environments that are either unknown or difficult to describe and predict at design time. For example, sensors and actuators may have noise, there could be mismatches between the dynamics of the physical world and its model, software scheduling strategies can change dynamically. Thus, asking for an environment and program model that encompasses all possible scenarios places an undue burden on the programmer, and the detailed book-keeping of every deviation from nominal behaviour renders the specifications difficult to understand and maintain. Second, even when certain assumptions are violated at run-time, we would expect the system to behave in a robust way: either by continuing to guarantee correct behaviour or by ensuring that the resulting behaviour only deviates modestly from the desired behaviour under the influence of small perturbations. Unfortunately, current design methodologies fall short in this respect: since the effects of errors cannot be explicitly quantified no guarantees may be made that small changes in the physical world, in the software world, or in their interaction, still result in acceptable behaviour.
In this paper, we present a theory of robustness for systems modelled discretely using automata. We are inspired by the well developed notion of robustness in continuous control theory, and the tools and methodologies which have been successfully applied therein. In the continuous world, the designer specifies the control system for the nominal case, ignoring the potential effects of errors on system behaviour and performance. The design methodology is such that guarantees may then be made as to the degree of degradation of functionality of the controlled system under disturbances of bounded power. We aim to provide a similar theory and algorithmic tools in the presence of discrete changes on the one hand, and in the presence of more complex temporal specifications -given, for example, in linear temporal logic (LTL) or as ω-automataon the other hand. We do this in three steps.
First, robustness is a topological concept. In order to define it, we need to give meaning to the word "closeness" or "distance." For this, we define a metric on the system states. Second, instead of directly modeling the effect of every disturbance, we model a nominal system (the case with no disturbance), together with a set of (unmodeled) disturbances whose effect can be bounded using the metric. That is, while making no assumption on the nature or origin of disturbances, we assume that the disturbances can only push the system to a state within a distance γ of the nominal state. Third, under these three assumptions, we show how we can derive strategies for ω-regular objectives that are robust in that the deviation from nominal behaviour can be bounded as a function of the disturbance and the parameters of the system.
To illustrate this last point, consider reachability properties F , where the system tries to reach a given set of states F . We provide fixed point algorithms which compute strategies that ensure F is reached in the nominal case, and additionally, when disturbances are present of magnitude γ, guarantee that the system reaches a set F which contains states at a distance of σγ or less from F , where σ ∈ R + 0 . Hence we may regard σ as a measure of robustness of this strategy. We also provide guarantees that the resulting inflation in the size of the acceptance set is indeed optimal. Additionally, we show that an arbitrary strategy obtained through classical automata-theoretic constructions (e.g., [18,30]) may provide trivial robustness guarantees (e.g., a bounded disturbance can force the system to reach any arbitrary state). We show how similar arguments can be made to provide robustness bounds for Büchi and parity (and thus, for all LTL) specifications under the presence of disturbances.
Technically, our constructions lift arguments similar to arguments in robust control based on control Lyapunov functions to the setting of ω-regular properties. For reachability, the correspondence is simple: we require that the strategy decrements a "rank function" at a rate that depends on the distance to the target. For parity, the argument is more technical, and uses progress measures for parity games [14,20]. Finally, we provide simple fixed point methods to compute optimal robustness bounds and strategies attaining these bounds.
We also consider a simple application of our theory to the synthesis problem in the presence of transient faults. We show how, using our methodology, we can algorithmically synthesize controllers for LTL objectives which provide a time-space tradeoff whereas classical automata-theoretic techniques may not be able to provide any such property without first explicitly modelling all of the parameters of the fault in detail.
Related work. The work presented here is inspired by the theory of robust continuous control [26,29] and the theory of infinite games with ω-regular objectives on discrete graphs [10,25,30]. There has not been much previous work combining robustness with automata theory. In discrete control systems, tolerance to errors is achieved by explicitly modeling faults and then solving a game assuming that the adversary determines when faults occur [11]. As mentioned earlier, the enumeration of possible faults can be tedious, if not impossible, at design time. Topologies for hybrid systems [7,21] have been examined before, but the interactions with ω-regular specifications have not been.
Qualitative notions of fault tolerance have been studied in distributed systems, for example, by designing algorithms to be "self-stabilizing" on perturbations [9], or by requiring that an invariant is eventually restored after an error ("convergence") or that the system satisfied a more liberal invariant under an error ("closure") [1]. However, quantitative notions, relevant to discrete systems, have not been studied. Our synthesis procedure produces strategies which satisfy quantitative notions of closure and (under some assumptions on the rate of faults) convergence.
In a series of papers [4,5,3,8], robustness measures are developed by comparing the number of environmental errors and the number of resulting system errors using cost functions. Bloem et al. [5] define k-robustness: roughly speaking, a system is k-robust if the ratio of system to environment errors is k. In general terms, the synthesis approach presented here results in σ-robust strategies for constant disturbance bounds, where σ is a constant associated with the rank function which serves as a formal characterization of the strategy. We demonstrate methods to construct strategies with optimal σ values. Moreover, we work in a simpler model, where the only adversarial action is the bounded disturbance, while the work of Bloem et al. considers an explicit adversary. Our framework has the advantage of leading to simple polynomial-time algorithms for synthesis, but may provide more conservative results than the game-solving algorithms from [3] when robustness is sought in the presence of explicit adversaries. A more detailed technical comparison with their work is provided in Section 3.
Tarraf et al. [24] develop a framework for quantifying robust stability in finite Mealy machines by extending classical notions of gain stability from control theory. The focus is upon input-output stability and, although we adopt a state-space approach, the results derived in this paper for reachability are similar. However, we go beyond simple reachability properties and consider also Büchi and parity requirements. A more technical comparison appears in Section 3.
Measures of robustness against transient fault models have been studied in the context of combinational circuits and FPGAs [12,13,15,19], but extensions to temporal behaviours have not been considered.

PRELIMINARIES
Let Q be a (finite or infinite) set. A function d : Q × Q → R + 0 is called a metric or distance function for Q if for all p, q, r ∈ Q, we have (i) d(p, q) = 0 if and only if p = q (identity of indiscernibles); (ii) d(p, q) = d(q, p) (symmetry); (iii) d(p, r) ≤ d(p, q) + d(q, r) (triangle inequality).
The pair (Q, d) where Q is a set and d is a metric for Q is called a metric space. Using a metric d we define the distance from a single state q ∈ Q to a set of states Q ⊆ Q as d(q, Q ) = inf q ∈Q d(q, q ), the shortest distance from q to some element of the set Q .
A function R : Q → R is Lipschitz continuous if there exists some constant K > 0 such that for any two states q, q ∈ Q: that is, the absolute value of the difference between the images of q and q is bounded above by a constant multiple of the distance between q and q for every pair of states in Q. The value K is called the Lipschitz constant of the function R with respect to the distance d. Note that if the set Q is finite then every real valued function of Q has this property.
We model discrete control systems using automata. Intuitively, we consider a "nominal" automaton modeling the undisturbed dynamics of the system, and add a set of disturbance actions which can perturb the nominal behaviour. We consider a very general model for the disturbances by simply requiring their effects to be bounded but otherwise arbitrary.
For a set Σ of symbols we let Σ * represent the set of finite strings of symbols from Σ, and let Σ ω denote the set of infinite strings over Σ; we let λ denote the empty string. The notation |Σ| represents the cardinality of the set Σ and Σ + is the set of non-empty finite strings over Σ. A (metric) automaton is a tuple A = ((Q, d), q 0 , Σ, X, δ, γ), where • Q is a set of states and (Q, d) is a metric space; • q 0 ∈ Q is the unique initial state; • Σ is a set of (system) input actions; • X is a set of disturbance indices including a special symbol signifying "no disturbance"; • δ : Q × Σ × X → Q is the transition function specifying the next state given the current state, the input letter chosen by the system and some member of X chosen by the environment and finally • γ : Q → R + 0 is a real-valued function such that for each p ∈ Q and for every a ∈ Σ such that δ(p, a, ) = q for some q ∈ Q d(q, δ(p, a, x)) ≤ γ(q) for every x ∈ X.
Note that the disturbance bound is defined with respect to the target state of a given transition, and not the source state (that is, the inequality above is bounded by γ(p) and not γ(q)). It would be a straightforward matter to reformulate the results herein with γ(p) replaced by γ(q).
An automaton is finite if Q, Σ, and X are all finite sets. For an automaton A, we define the undisturbed or nominal automaton, written A , as the automaton resulting from restricting the set of disturbance indices X to the singleton { }. For q ∈ Q, a ∈ Σ and x ∈ X we use the shorthand q ax to denote the state δ(q, a, x). We let γ = sup q∈F γ(q). If γ(q) = γ(p) for all p, q ∈ Q we say that A has constant disturbance bound and hence γ(q) = γ for all q ∈ Q.
Intuitively, the undisturbed automaton models the "nominal" behaviour of an automaton, and the set of disturbance indices X models possible environmental disturbances to the nominal behaviour (the symbol ∈ X thus represents the case where there is no disturbance). The function γ limits the effects of the disturbances with respect to the nominal behaviour at each state q: when an action a is chosen, the disturbances can cause a state at most distance γ(q a ) away from the nominal state to be reached instead. As a special case, if γ(q a ) = 0, then the disturbances have no effect on the nominal behaviour (i.e., q ax = q a for each a ∈ Σ, and x ∈ X).
A trace τ ∈ Q * ∪ Q ω of the automaton A is a (finite or infinite) sequence of states τ = q 0 q 1 q 2 . . . from Q such that q 0 is the initial state of the automaton, and there exist inputs a 0 , a 1 , a 2 , . . . and disturbances For q ∈ Q we write q ∈ τ and say the state q appears on the trace τ if q = q i for some i ≥ 0. A nominal trace is a trace in the nominal automaton A , that is, τ is such that x i = for all i ≥ 0. For a finite trace τ = q 0 q 1 . . . q n ∈ Q * , we define |τ | = n + 1, the length of τ .
The proposed model for the disturbances encompasses a wide range of concrete applications ranging from the discrete to the continuous world, as illustrated by the next two examples.
Example 2.1. [Digital Design with Single Bit-Flips] Consider an automaton A modeling a state machine whose states are encoded using a binary Gray code [27]. Each state of A is a sequence of n bits, and neighbouring states differ in only one bit. Disturbances occur as single-event upsets which can cause a single bit in the state to flip. The distance function for the automaton is defined to be the Hamming distance between n-bit strings. The set of disturbance actions X ⊂ {0, 1} n contains all binary strings of length n with at most one non-zero digit. Under this definition, is equal to the binary string of length n consisting entirely of zeros. The transition function δ for A is defined from the transition function δ of A by δ(q, a, x) = δ (q, a) ⊕ x for any q ∈ {0, 1} n where ⊕ is the XOR function. Hence, the potential effect of the disturbance is bounded by the constant γ = 1.

Example 2.2. [Robust Control]
Consider a continuous control system in discrete time which may be viewed as an infinite-state automaton with transition function δ : R n × R m × R p → R n . The state set is R n , the input alphabet is R m and R p is the set of environmental disturbances. Disturbance signals x : N → R p are often used as a lumped representation for several sources of uncertainly such as measurement errors or errors in the model of the transition function. Hence, the disturbance signals are assumed to be arbitrary but of bounded amplitude, that is, x(k) ≤ γ for some constant γ ∈ R + 0 , some norm · on R p , and every k ∈ N. A further typical assumption is Lipschitz continuity of δ. It then follows from these two assumptions that where K is the Lipschitz constant. Therefore by defining the distance function d as d(y, z) = y − z we conclude that the system in this example has constant disturbance bound γ ∈ R + 0 equal to K γ . We make certain natural assumptions as to the connectedness of the automata we consider. In order to elucidate these assumptions we define the following notions. A state q ∈ Q is (nominally) reachable if there exists a finite (nominal) trace connecting q 0 to the state q, and (nominally) coreachable with respect to some set of states Q ⊆ Q if there exists a finite (nominal) trace connecting q to some state in Q . If every state in Q is reachable (resp. coreachable w.r.t. Q ) we say that A is reachable (resp., coreachable w.r.t. Q ). Throughout the following we will assume that every automaton we consider is reachable.
We associate acceptance conditions with automata to distinguish between "good" and "bad" traces. A reachability condition is a set F ⊆ Q of terminal states. A reachability automaton (A, F ) consists of an automaton A together with a reachability condition F . A finite trace of the automaton A satisfies the reachability condition F if and only if it ends at some state in the set F . We make the following assumption for all reachability automata in the paper. Assumption 2.3. The automaton A is nominally coreachable with respect to F .
A Büchi automaton (A, F ) is an automaton A together with a Büchi acceptance condition F ⊆ Q. For an infinite trace τ = q 0 q 1 . . . ∈ Q ω let ζ(τ ) = {q ∈ Q | ∀i ≥ 0 ∃j > i, q j = q} denote the set of states appearing infinitely often on τ . A trace τ ∈ Q ω satisfies the Büchi acceptance condition F if and only if ζ(τ )∩F = ∅. In other words, there exists at least one state in the set F which features infinitely often on the trace. We again make Assumption 2.3.
A generalized Büchi acceptance condition is a set of the form F = {F 0 , . . . F n−1 } and consists of a finite number of subsets of the state set Q. An automaton A paired with such an acceptance condition is called a generalized Büchi automaton. An infinite trace τ ∈ Q ω of A satisfies the acceptance condition F if and only if ζ(τ ) ∩ F i = ∅ for i = 0, . . . , n − 1. We ask that the following assumption is satisfied.
The justifications for this assumption will be discussed further in Section 5.2. Finally a parity automaton (A, F ) is an automaton A together with a parity acceptance condition consisting of a finite number of pairwise disjoint subsets of the state set Q: The parity of a state q ∈ Q is the index i of the unique set F i containing q, if any, and undefined if there exists no such F i . A trace τ ∈ Q ω of A satisfies the acceptance condition F if and only if the least parity amongst the states in the set ζ(τ ) is even. Note that we allow the set of states to be partially colored [30]: the set ∪ 2n+1 i=1 F i may not necessarily cover Q. The connectedness assumption for parity automata is the following. Assumption 2.5. Each state q ∈ Q in the parity automaton A is nominally coreachable with respect to some set of even parity F 2i , and if q has odd parity, then it is nominally coreachable with respect to some F 2i where 2i is less than the parity of q.
The reasoning for this assumption will be given in Section 5.3. A strategy for an automaton A is a function S : Q + → 2 Σ specifying input choices for each finite trace. Given a strategy S, the set of outcomes is the set of traces q 0 q 1 . . . on which q 0 is the initial state of the automaton, and for each i ≥ 0 there exists a i ∈ S(q 0 . . . q i ) with q i+1 = δ(q i , a i , x) for some x ∈ X. A nominal outcome of a strategy is a trace q 0 q 1 q 2 . . . where q 0 is the initial state and for each i ≥ 0 we have q i+1 = δ(q i , a i , ).
A strategy S is memoryless if S(w · q) = S(w · q) for all w, w ∈ Q * and q ∈ Q, that is, if it depends only on the last state on the trace. In this case, we omit the (irrelevant) prefix, and consider a strategy to be a function from Q to 2 Σ .
A strategy S is called deterministic if for all q ∈ Q, |S(q)| = 1. If a strategy does not have this property we say that it is non-deterministic.
For a state q ∈ Q of a reachability or Büchi automaton with acceptance set F and strategy S, let τ S (q, Q ) denote the set of nominal traces connecting q to an element of the set Q ⊆ Q. Note that if S is deterministic the set τ S (q, Q ) will contain only one trace for each q; we abuse notation and let τ S (q, Q ) denote this unique trace directly. Let Reach S (q) ⊆ Q denote the set of states in A reachable from q via a finite trace resulting from the system following strategy S and any environmental action, and let Reach ST (q) denote the set of states in A reachable from q via a finite trace resulting from the system following any strategy S and the environment following strategy T .
A disturbance strategy is a function from Q + × Σ to X. Let S : Q + → 2 Σ be a strategy and T : Q + × Σ → X a disturbance strategy. An outcome q 0 q 1 . . . of S and T is a trace on which q 0 is the initial state of the automaton and for each i ≥ 0 we have Let (A, F ) be an automaton together with an acceptance condition. A strategy is nominally winning in A if every nominal outcome satisfies F . It is known that reachability, Büchi, and parity conditions admit memoryless nominally winning strategies [10]. A strategy S is winning if for every disturbance strategy T , each outcome of S and T satisfies F .
For a finite automaton A and memoryless strategy S : Q → 2 Σ let A| S denote the automaton resulting from restricting the behaviour of A using S. That is, the automaton We are now able to introduce our definitions of robustness.
Definition 2.6. A nominally winning strategy S for a reachability or Büchi automaton A nominally winning strategy S for a generalized Büchi automaton A nominally winning strategy S for a parity automaton We show a simple example illustrating our definitions.
The relative distances of the states in Q are presented in Table 1 and are approximated by the relative arrangement of the states in the automaton in Figure 1. The disturbance function is defined as γ(q) = 1 for all q ∈ Q and the nominal behaviour is defined as shown in Figure 1. Since the disturbance bound is constant we shall refer to it simply as γ = 1.
Let S b : Q → Σ be the deterministic memoryless strategy which chooses b ∈ Σ for every q ∈ Q, and let S a : Q → Σ be the deterministic memoryless strategy which chooses a ∈ Σ for every q ∈ Q. Clearly both S b and S a are nominally winning for the reachability condition; they are equally good strategies in classical automata theory.
Consider the result of applying the strategies S b and S a in the disturbed automaton A. First note that the unique nominal trace connecting the initial state q 0 to the terminal state The distance between states in the automaton A of Figure 1. q 6 resulting from applying S b is q 0 q 1 q 6 . Inputting b at state q 0 could result in reaching any of the states in the ellipse on the left and hence it is possible that the system may remain in state q 0 indefinitely. Then since q 0 is at a distance of 5 from the terminal state q 6 , a trace implementing S b is only guaranteed to reach a state at distance 5 or less from F . Therefore, in the disturbed automaton, strategy S b is winning with respect to the inflated acceptance condition F b = {q ∈ Q | d(q, F ) ≤ 5} as shown in Figure 1 and S b is 5-robust. Now consider the strategy S a . The nominal trace connecting q 0 to q 6 for this strategy is q 0 q 3 q 5 q 6 . Note that d(q 0 , q 3 ) and d(q 3 , q 5 ) are both greater than the power of the disturbance γ = 1. Therefore in the disturbed automaton progress is still being made towards F until we reach q 5 which is at a distance of 1 from F . Hence the strategy S a is winning with respect to the inflated reachability condition F a = {q ∈ Q | d(q, F ) ≤ 1} as shown in Figure 1 and S a is 1-robust.
In classical automata and game theory (e.g., [30]), the outcomes of the two strategies are indistinguishable: both strategies reach the set F = {q 6 } in the nominal case, and may result in traces which never reach F when disturbances are present. However, the metric d provides an extra method of comparison: the distance from F as a function of the bound on the disturbance γ. With this in mind it is obvious that the strategy S a is a better choice for the automaton A.
We discuss the construction of the two strategies S b and S a in Section 3.

REACHABILITY
In this section we provide methods to verify the robustness of strategies for finite reachability acceptance conditions, as well as algorithms to synthesize optimally robust strategies. The definitions presented are based upon ideas from continuous control and provide the foundations for dealing with more complex infinite acceptance conditions in the following sections.
Let (A, F ) = ((Q, d), q 0 , Σ, δ, X, γ, F ) be a reachability automaton satisfying Assumption 2.3. A (reachability) rank function with respect to F is a function R F : Q → R + 0 where R F (q) = 0 if and only if q ∈ F , and there exists a monotonically increasing function α : A rank function R F is said to be a control Lyapunov function if there exists a monotonically increasing function f : We exclude states in the set F since we exclusively consider finite reachability conditions of the form F . By asking that R F satisfies inequality (2) at every state in Q one may also reason about acceptance conditions of the form F ("eventually always F ") in the same manner.
A control Lyapunov function R F induces one or more memoryless strategy functions S defined by mapping a state q ∈ Q to some subset of the inputs a ∈ Σ which satisfy inequality (2).
The existence of a control Lyapunov function relies upon the nominal coreachability assumption with respect to F . This is a natural assumption in certain applications, such as in the control of physical systems, but it is typically not satisfied in the normal treatment of reachability of discrete systems. However it is straightforward to restrict the state set of the automaton to exclude states from which the set F cannot be reached via a finite nominal trace.
Theorem 3.1. Let (A, F ) be a finite reachability automaton satisfying Assumption 2.3. A memoryless strategy S is nominally winning with respect to F if and only if there exists a control Lyapunov function R F such that S can be induced from R F .
Proof. Let (A, F ) be a reachability automaton and let R F be a Lipschitz continuous control Lyapunov function with respect to F . Define S : (2) holds for every q on the trace τ and the function R F is non-negative, R F decreases along τ and necessarily reaches zero in finitely many steps. It then follows from (1) that d(q, F ) is also zero for some q ∈ τ appearing in τ after a finite prefix since d(q, F ) ≤ α −1 (R F (q)) where the inverse α −1 is also a monotonically increasing function vanishing at zero. Now let S : Q → 2 Σ be a nominally winning strategy for (A, F ), and let η : be a monotonically increasing function. We define a weighted digraph G = (Q, E) in which there exists an edge (q, x q , q ) ∈ E with x q = η(d(q, F )) if and only if δ(q, a, ) = q for some a ∈ S(q). For each q ∈ Q define Note that the definition above is indeed well formed: every trace in the set τ S (q, F ) is simple (that is, one without loops) by definition and therefore each state in Q may appear at most once on such a trace.
Observe that η(d(q, F )) ≤ R(q) for all q ∈ Q and hence that R is a reachability rank function. Also since R(q) ≥ R(δ(q, a, )) + η(d(q, F )) for every a ∈ S(q) we may trivially observe that for every q ∈ Q and the function R is indeed a control Lyapunov function. By definition the function R satisfies inequality (2) at a state q for an input a ∈ Σ if and only if a ∈ S(q), and therefore the strategy induced from R will be precisely S as required.
Control Lyapunov functions provide a method for the verification of robustness of potential strategies. For a system with a constant disturbance bound, the following theorem describes the "graceful degradation" or robustness properties possessed by strategies induced from control Lyapunov functions. When disturbances are present, a nominal outcome is not guaranteed but no catastrophic failure will occur. Instead, the deviation from a nominal outcome is linearly bounded by the power of the disturbance, and may be explicitly calculated.
Proof. Assume that R F : Q → R + 0 is a control Lyapunov function for the reachability automaton (A, F ) and let S : Q → 2 Σ be a strategy induced from R F . Let T be a disturbance strategy and consider an outcome τ = q 0 q 1 . . . of S and T . We first establish the inequality: for any q appearing in τ : Note that as long as q is sufficiently far from F , the value −f (d(q, F )) is sufficiently negative, and the sum Kγ−f (d(q, F )) remains negative. Hence, R F continues to decrease along τ . The situation changes when we reach a state q satisfying Kγ > f (d(q, F )).
Hence, an outcome of S and T is guaranteed to reach the set The case in which the function f is linear, that is, for every x ∈ R + 0 , f (x) = cx for a fixed constant c ∈ R + 0 , is worth noting. In this case the expression σ = f −1 (Kγ)/γ in the above theorem simplifies to σ = K/c.
Although a similar approach to the one provided in the proof of Theorem 3.2 for calculating robustness bounds may be used for automata having state dependent disturbance bounds, the resulting value is likely to be conservative. Indeed, let (A, F ) be a finite reachability automaton and let S be a memoryless strategy with associated control Lyapunov function R. Let the set of states where the control Lyapunov inequality (2) may be violated under the effects of a disturbance, that is, states q from which the disturbance action can force the system to reach a state which is further away from the target set than q. The value of σ calculated via the method presented in Theorem 3.2 would be Let q ∈ Q be the state achieving this value, that is, d(q, F ) = σγ and let p ∈ Q be the state reached by following S at q. If δ(p, a, x) ∈ Q for all x ∈ X \ { }, a smaller value of the bound could be achieved. Instead, for systems with state dependent disturbance bounds, we give a dynamic programming algorithm. The operators presented below will form the basis for optimal synthesis and robustness verification not just for reachability automata, but for the ω-regular automata which follow in later sections.
Fix a reachability automaton (A, F ), and let Q = {q 0 , . . . , q m−1 }. We characterize the optimal robustness bound achievable by a memoryless strategy as the fixed point of a certain operator. The operator acts upon a vector of size |Q| = m consisting of positive real numbers.
Consider a state q ∈ Q and the objective to reach the set F via a finite trace beginning at q. We argue that for any nominally winning strategy S beginning at q, the robustness bound σ cannot be more than d(q, F )/γ, since just by staying at q, the strategy ensures that the system is within distance d(q, F ) of the final states (c.f. strategy S b in Example 2.7). Hence the maximal value of σ is equal to d(q, F )/γ.
We define a sequence of vectors opt i for i ≥ 0. With the above intuition, we define opt 0 (j) = d(q j , F ) for j = 0, . . . , m − 1.
For q ∈ Q let Post a (q) = {q | ∃x ∈ X δ(q, a, x) = q } ⊆ Q, the set of states reachable from q via the input action a. The definition is extended to sets of states in the natural way. Further, for words w = w 1 . . . w n ∈ Σ * , we write with the assumption that Post λ (q) = q for the empty word λ. Let opt i+1 = g(opt i ).
Consider the result of applying g once to the vector opt 0 . As previously stated, opt 0 (j) = d(q j , F ) for each 1 ≤ j ≤ m. Applying g gives the result where λ is the empty word. So opt 1 (j) encodes the closest the system is able to get to F via a trace of length at most one beginning at q j when the environment chooses disturbance inputs which are worst-case, that is, the environment's objective is to force the system to move as far away as possible from F . Iterating this reasoning leads to the fixed point opt * defined by opt * (j) = min Since the automaton A is finite the fixed point opt * will be reached in a finite number of iterations. There can be at most |Q| − 1 iterations since this is the longest input word labeling a simple path between two states in A, and each iteration can be performed in time polynomial in the size of Q. Hence the overall worst case complexity for the algorithm is polynomial in the size of Q. This algorithm is easily seen to be a simple generalization of the Bellman-Ford shortest path algorithm [2], modified to take into account the non-determinism resulting from disturbances.
We first use Definition 3.3 to verify robustness for a given strategy. Given a nominally winning memoryless strategy S for a finite reachability automaton (A, F ) the robustness bound σ for S is precisely σ = opt * (0) γ for the automaton A| S where q 0 is the initial state.
Finally we approach the issue of the synthesis of optimally robust winning strategies. Given a finite reachability automaton (A, F ) the optimal achievable robustness bound for A is σ min = opt * (0) γ A memoryless strategy achieving the optimal robustness for (A, F ) may be recovered in the following way. We define S(q) = {a ∈ Σ | q j = δ(q, a, ) and opt * (j) = opt * (0)} \ {a ∈ Σ | q ∈ Post a (q)} if the right-hand side is non-empty, and S(q) = Σ otherwise.
Example 3.4. Returning to Example 2.7, we discuss the two rank functions R b : Q → R + 0 and R a : Q → R + 0 from which the strategies S b and S a are induced. Table 2 lists the distance from each state to the terminal state q 6 and the value of the two rank functions R b and R a .
The function R b : Q → R + 0 is the result of a classical graph theoretic shortest path approach -each state q ∈ Q is mapped to the length of the shortest path connecting q to some state in F .
Let η : R + 0 → R + 0 be the monotonically increasing function defined by x → 2x for all x ∈ R + 0 . Then R a is a control Lyapunov function since for all q ∈ Q \ {q 6 } R a (q a ) − R a (q) ≤ −η(d(q, q 6 )).
The rank functions R b and R a for the automaton A.
For optimal robustness, the vectors opt 0 and opt * are as follows for this example.
Therefore the strategy S a is optimal with respect to a disturbance of size γ = 1.
Comparison with existing work. At this point it is convenient to compare our framework with the frameworks of Bloem et. al. [5] and of Tarraf et. al. [24]. Both of these references adopt an input-output perspective by relating environment errors (inputs) to system errors (outputs). In contrast, we adopt a state-space approach by endowing the set of states with a metric and placing no assumptions on the environment other than having bounded power.
In [5] the authors define the notion of k-robustness for automata. For a reachability automaton (A, F ) two monotonically increasing functions which map zero to zero are defined: an environmental error function e : Σ * → N ∪ {∞} and a system error function s : Σ * → N∪{∞}. A pair (e, s) of error functions for a given automaton is called an error specification for A. Then a strategy S : Q → Σ for A is κ-robust with respect to the error specification (e, s) if there exists β ∈ N such that for all w ∈ Σ * which label outcomes of S, s(w) ≤ κe(w) + β. In order to compare Bloem's and Tarraf's results with ours, we resort to some key ideas from robust control [26,29]. First, we define an environment error signal e = e 1 e 2 . . . e n ∈ R * and a system error signal s = s 1 s 2 . . . s n ∈ R * . The only assumption we place on e and s is that an absence of environment errors at time k ∈ N corresponds to e k = 0 and the absence of system errors at time k ∈ N corresponds to s k = 0. The error functions e and s in Bloem's framework can be seen as the cumulative versions of e and s, for example: In Tarraf's framework and notation the role of e i is played by ρ(u(i)) and the role of s i is played by µ(y(i)). We now regard an automaton as defining a transformation F : R * → R * from environment error signals to system error signals F (e) = s. In general F will be a set valued function, but we assume it to be single valued to simplify the discussion. The notion of finite-gain stability from robust control can now be introduced as follows: A map F : R * → R * is said to be finite-gain stable with gain κ and bias β if the following inequality holds: for every e ∈ R * . A more condensed version of (3) is: which is Bloem's notion of κ-robustness and Tarraf's notion of ρ/µ gain stability. It is well known in robust control and dissipative systems theory that the existence of a certain type of Lyapunov function (a storage function) implies finite-gain stability. In the context of reachability automata, we define e to be the effect of the environment actions on the state: e k = d(q ax k , q a k ). If x = then q ax k = q k and e k = 0, since the behaviour coincides with the nominal behaviour under no environment disturbances. For problems of the form F we regard F as the set of states describing the desired operation for the system. Hence, any deviation from F is regarded as a system error. The system error signal is defined as: Standard arguments in dissipative systems theory [26] would then show that: where f : R + 0 → R + 0 is some monotonically increasing function satisfying f (0) = 0 and K is the Lipschitz constant of R F . It is also known that finite-gain stability does not imply the notion of stability considered in this paper unless certain controllability/observability assumptions hold. This follows from the fact that it may not be possible to infer the decrease of R F at every state only from the knowledge of e and s when not every state can be reached from q 0 or when s does not provide enough information about the state.

EXAMPLE
In this section we recast a classic problem from distributed computing in our framework to allow the explicit quantification of the robustness of possible solution strategies. Figure  2 shows a network of four computer nodes, each having a two way communication channel (represented by an undirected edge in the graph) connected to each of its two neighbouring nodes. Each computer in the network has a unique identifier which is presented in the figure. The four nodes are required to elect a leader, and may make use of the communication channels to exchange information. In order for a leader to be elected, the nodes must come to a unanimous consensus on which of the four nodes is the leader. However, the communication channels between the nodes are known to be subject to noise, and so messages may be corrupted between transmission and receipt, as described below. We model the system as an automaton with state set defined by the global state of the network. That is, each state in the automaton represents the current belief of the four nodes as to who is the leader. Hence Q ⊆ {1, 2, 3, 4} 4 . The initial state is (1, 2, 3, 4). At each state, each of the four nodes communicates its current belief to its neighbouring nodes, and each node uses this information combined with its own belief about the current leader to update its belief. The acceptance condition is a reachability condition with terminal set {(i, i, i, i) | i ∈ {1, 2, 3, 4}}. There are a number of different strategies which the nodes could apply to decide upon a new belief using the information available to them. We consider the following three possibilities. It is a well known result in distributed computing that choosing either of the first two strategies is computationally optimal [17]. The disturbances in our system are characterized in the following way: beliefs are assumed to be sent as decimal numbers, and the noise in the channel may cause the value of the sent belief to change by ±1. However, we do not allow messages outside of the set {1, 2, 3, 4}: for example if a disturbance occurs on the message '1', the recipient will receive either '1' or '2'. A distance function on the state set Q is defined by d((x 1 x 2 , x 3 , x 4 ), (y 1 , y 2 , y 3 , y 4 )) = |x 1 − y 1 | + |x 2 − y 2 | + |x 3 − y 3 | + |x 4 − y 4 |; this is precisely the Manhattan or L 1 norm. For each node i ∈ {1, 2, 3, 4} we assume that only one of the two incoming messages may be affected by the disturbance at any given time in order to simplify the presentation, though the methodology applies in the same way without this assumption. This combined with our assumption about the power of the disturbance on the messages themselves translates into a constant disturbance in our automaton model of size γ = 1. Figures 3 and 4 show the metric automata for the three strategies described above. We restrict to the reachable part of the automaton. Nominal transitions are represented by dashed lines, disturbed transitions by solid.
We use the function opt described in Section 3 to analyze the robustness of the three strategies. First note that strategies B and T , the classical optimal strategies, are 0-robust. Indeed, the fixed point iteration gives σ min = 0. More interesting is the conclusions we may draw for the floor strategy F . Here σ min = 1, due to the self loops at states 2223 and 2232. Hence a disturbance bounded by γ = 1 results in only one node having the wrong belief and hence though the nodes do not reach a unanimous decision, they at least are able to come to a majority decision. This is obviously a "better" outcome than that resulting from only two nodes agreeing on their belief.

OMEGA-REGULAR OBJECTIVES
We now extend the results to more general ω-regular acceptance conditions. We do this in two steps. First, we provide a simple generalization to Büchi acceptance conditions. Then, we show how ideas based on progress measures [14,20] can be used to provide   robustness results for parity acceptance conditions. In every case we make an appropriate connectedness assumption. 5.1. Büchi acceptance conditions. Let (A, F ) = ((Q, d), q 0 , Σ, δ, X, γ, F ) be a Büchi automaton with acceptance condition F ⊆ Q such that A is nominally coreachable with respect to F . First note that Büchi acceptance asks that for a trace τ ∈ Q ω , the intersection of the set ζ(τ ) with the set of terminal states is non-empty. So by viewing the Büchi condition as an infinite series of reachability conditions for the set F , and under Assumption 2.3, the definitions and results for reachability also apply in the case of Büchi automata.
In particular, note that the definition of a control Lyapunov function given in the previous section only requires that inequality (2) holds for states outside of the set F . A control Lyapunov function R F for a Büchi automaton induces a memoryless strategy S : Q → 2 Σ which specifies actions satisfying (2) for any state in Q \ F and any arbitrary action for states in F . The strategy S is nominally winning: the argument that F is reached is identical to the reachability case, and the coreachability assumption ensures that an arbitrary action from F will not prevent F from being visited again. Since we are able to cast Büchi acceptance as an infinitely repeated reachability condition, the methods for calculating σ for a given strategy and optimal achievable robustness bounds are identical to the reachability case. S is a f −1 (Kγ)/γ-robust winning strategy where K is the Lipschitz constant of R F .
The robustness bound for a given nominally winning strategy may be calculated in a manner identical to that presented for reachability automata. The same is true for the optimal and worst case achievable robustness bounds and optimal strategies for a given Büchi automaton.
Example 5.3. Consider the Büchi automaton (A, F ) with F = {q 6 } whose nominal behaviour is shown in Figure 5. Note that this automaton is identical to the reachability automaton presented in Figure 1 (Example 2.7) with the addition of two new edges beginning at q 6 . The distances between the states and the rank functions R b : Q → R + 0 and R a : Q → R + 0 are as before; their values may be found in Tables 1 and 2. The two strategies S b : Q → Σ and S a : Q → Σ are induced in the same way for states in Q \ F . Observe that a control Lyapunov function for a Büchi automaton does not specify the value of the induced strategy for terminal states. There are of course two options, namely a and b, leading to the states q 0 and q 2 respectively.
For S a observe that R a (q 0 ) < R a (q 2 ) and so we set S a (q 6 ) equal to a. For the strategy S b , note that R b (q 0 ) = R b (q 2 ). For consistency we set S b (q 6 ) = b. Then the strategy S b is 5-robust and S a is 1-robust.

5.2.
Generalized Büchi conditions. We want to generalize the construction of rank functions to parity acceptance conditions. As a warm-up, we first describe methods for generalized Büchi acceptance conditions. It is a standard argument in automata theory to reduce a generalized Büchi automaton to a Büchi automaton: the resulting automaton will have state set Q × {0, . . . , n − 1} where |F | = n. So for a system presented as a generalized Büchi automaton, Proposition 5.1 may be applied to an expanded state space, and winning strategies may be induced. However, we give an alternate "direct" rank function construction based on progress measures that will introduce techniques useful in the parity case. Calculating robustness directly for generalized Büchi automata has other advantages too: for example, given a distance function d on a generalized Büchi automaton A, how do we lift d to a metric on the new Büchi automaton that makes sense in the context of the original system? This question is likely to be difficult to answer in a satisfactory manner. Let (A, F ) = ((Q, d), q 0 , Σ, δ, X, γ, F ) be a generalized Büchi automaton with F = {F 0 , . . . , F n−1 }. For i = 0, 1, . . . , n − 1 let R i : Q → R + 0 be a (reachability) rank function with respect to the set F i . Then a (generalized Büchi) rank function R : Q → (R + 0 ) n is defined by R(q) = (R 0 (q), R 1 (q), . . . , R n−1 (q)) for each q ∈ Q.
We extend the notion of Lipschitz continuity for functions in the obvious way: a function R : Q → (R + 0 ) n is Lipschitz continuous if there exists K > 0 such that for each i ∈ {0, . . . , n − 1} and for all q, q ∈ Q it holds that As before, if the set Q is finite then every real valued function of this form has this property.
A relation and ordering on n-tuples of positive reals is defined as follows. For every i ∈ {0, 1, . . . , n − 1} define the preorder > i on (R + 0 ) n : let a, b ∈ (R + 0 ) n with a = (a 0 , . . . , a n−1 ) and b = (b 0 , . . . , b n−1 ). Then a > i b if and only if a i > b i . We also let a ≥ i b if and only if a i ≥ b i . Based on > i we introduce another relation on (R + 0 ) n , denoted by i and defined by a i b if and only if one of the following two conditions holds: Observe that, since the labeling of the sets in F begins at 0 instead of 1, the relation > 0 corresponds with the 1st index of the n-tuple, > 1 corresponds with the 2nd index, and so on.
Proposition 5.4. Let A be a finite generalized Büchi automaton with acceptance condition F = {F 0 , . . . , F n−1 }. If a trace τ = q 0 q 1 q 2 . . . is such that then τ satisfies the generalized Büchi acceptance condition F .
Proof. Let τ be a trace of the form given above. By definition, if two consecutive relations in (4) have different indices (say k and k + 1) then the state appearing between them must be contained in the set F k . Hence q i0 ∈ F 0 , q i1 ∈ F 1 , . . . , q in−1 ∈ F n−1 , . . . , and τ infinitely often features a state in each of the sets in F .
Intuitively, a trace of this form is initially moving towards the set F 0 via the relation 0 . Once a state in the set F 0 is reached, the second part of the definition of applies and 1 is satisfied until a state in the set F 1 is reached. On reaching a state in the set F n−1 , the relation returns to 0 , and so on.
Note that the other direction does not necessarily hold: a winning trace will not necessarily have the above form. For example, the trace may visit the sets in a non-sequential order, or may visit multiple states from each set on each pass through the automaton.
A generalized Büchi rank function R is said to be a control Lyapunov function if there exists a monotonically increasing function f : R + 0 → R + 0 with f (0) = 0 such that for every i ∈ {0, 1, . . . , n − 1} and every q ∈ Q \ F i there exists a ∈ Σ with For a fixed i, the function R i is a reachability control Lyapunov function with respect to the set F i . Hence every state q ∈ Q is coreachable with respect to the set F i for every i ∈ {0, . . . , n − 1} and the automaton A satisfies Assumption 2.4. To see that this is necessary, consider for example a state q ∈ Q from which the set F i is not reachable for some i > 0. Then any state coreachable with respect to q, and any state reachable from q, may not appear on a winning trace. Hence all such states are redundant (including q). These definitions are the natural extension of those given for reachability and Büchi automata.
Generalized Büchi automata do not admit memoryless strategies; a winning strategy must keep track of the index i + 1 where i is the index of the last terminal set F i which was visited on the trace. Therefore a strategy for a generalized Büchi automaton (A, F ) is a function S : Q × {0, . . . , n − 1} → 2 Σ where for every i ∈ {0, . . . , n − 1}, the restriction S(·, i) is a memoryless reachability strategy, and may be induced from R i . For automata with constant disturbance bounds we have the following.
Proposition 5.6. Let (A, F ) be a finite generalized Büchi automaton satisfying Assumption 2.4 with constant disturbance bound γ and let S be a nominally winning memoryless strategy induced from a control Lyapunov function R F . The strategy S is σ-robust where Proof. Assume that R F is a control Lyapunov function for (A, F ) and let S be a nominally winning memoryless strategy induced from R F . Let T be a disturbance strategy. Proposition 5.2 implies that for every q ∈ τ \ F i where τ ∈ Q ω is any outcome resulting from S and T and with K i the Lipschitz constant of R i with respect to d. Hence S is σ i -robust for σ i = f −1 (K i γ)/γ with respect to F i and therefore the robustness of S is certainly bounded by σ as required.
For generalized Büchi automata with state dependent disturbance bounds the verification of robustness for a strategy and the calculation of optimal robustness bounds is done in a similar manner to the reachability case. Let (A, F ) be a generalized Büchi automaton, and assume Q = {q 0 , . . . , q m−1 } and |F | = n. Instead of a vector, we define opt 0 to be an m by n matrix. Letting opt 0 (j, k) denote the entry in the jth row and kth column of opt 0 , we let opt 0 (j, k) = d(q j , F k−1 ) for j = 1, . . . , m and k = 1, . . . , n. This is the natural generalization of the definition for reachability and Büchi conditions where only one terminal set is considered. Then the monotonic function g : (R + 0 ) m×n → (R + 0 ) m×n is defined on each index (j, k) of the matrix opt 0 by g(opt)(j, k) = min opt(j, k), min a∈Σ max i∈Posta(qj ) opt(i, k) .
That the operator repeatedly applied beginning with opt 0 converges to the required value follows easily from the reachability case.
Given a nominally winning strategy S for a finite generalized Büchi automaton (A, F ) the robustness bound σ may be recovered by first calculating opt * for the restricted automaton A| S . Then σ = max k=1,...,n opt * (0, k) γ .
The method of induction of the strategy S is a straightforward generalization of the approach presented for reachability and Büchi automata.

5.
3. Parity conditions. The simple notions of rank and progress defined previously are insufficient to capture the complexity of parity acceptance conditions. Instead we generalize progress measures for parity games [14,20]. Note that, for clarity of exposition, all results in this section are presented for deterministic strategies only. The extension to non-deterministic strategies is straightforward.
Recall that Assumption 2.5 asks only that every state in q is nominally coreachable with respect to some set of even parity F 2i , and if q has odd parity, we assume that 2i is less than the parity of q. This is the least restrictive generalization of the coreachability assumptions made for simpler acceptance conditions. A consequence is that we extend the distance function d to allow states of infinite distance from each other. Let R We call the parity progress measure. A (parity) rank function R F : Q → (R + 0 ) n+1 is a function with R i F (q) = 0 if and only if q ∈ F 2i (where the notation R i F (q) denotes the ith component of the image of q under R F ) and there exists a monotonically increasing function α : R + 0 → R + 0 such that α(0) = 0 and α(d(q, F i )) ≤ R i F (q) for all q ∈ Q, i ∈ {0, . . . , n}. Hence a parity rank function consists of n + 1 reachability rank functions defined upon the extended positive real numbers.
Let Q ⊆ (F 0 ∪ F 2 ∪ . . . ∪ F 2n ) denote the set of states of even parity from which a state of lower or equal even parity cannot be reached. That is, Q contains all states q ∈ F 2i for some i ∈ {0, . . . , n} such that there does not exist k ≤ i with some state q ∈ F 2k reachable from q.
A rank function R F for a parity automaton (A, F ) is a control Lyapunov function if there exists some monotonically increasing function f : (R + 0 ) n+1 → (R + 0 ) n+1 satisfying 1 f (0 n+1 ) = 0 n+1 such that for every j ∈ {1, . . . , 2n + 1} and every q ∈ F j \ Q there exists a ∈ Σ with for some 2i ≤ j. The next proposition demonstrates that the parity progress measure is correct. Since the parity acceptance condition looks only at infinite behaviour on a trace, and we consider only automata with finite state sets, necessarily any infinite trace consists of a finite simple (loop-free) prefix followed by an infinite sequence of repeated loops. This observation is key to the proof.
Proposition 5.7. Let τ = q 0 q 1 q 2 . . . ∈ Q ω be an infinite trace of the parity automaton (A, F ). Then if τ is winning with respect to F . Moreover, if the set of indices I ⊂ N such that R F (q i ) qi R F (q i+1 ) does not hold is finite, then τ will be winning with respect to F .
Proof. Let p 1 , . . . , p m ∈ Q be such that and let k = min j∈{1,...,m} By definition Let j ∈ {1, . . . , m} be such that p j ∈ F 2k+1 or p j ∈ F 2k . If p j ∈ F 2k+1 then one of the inequalities in (8) must be strict and hence R F (p 1 ) k R F (p 1 ), a contradiction. Therefore p j ∈ F 2k and the least parity appearing in the loop p 1 . . . p m p 1 must be even. This is sufficient to prove that any infinite trace τ ∈ Q ω satisfying (6) also satisfies the parity condition F . Now assume that the set I is non-empty and has finite cardinality. Since I is finite there exists some N ∈ N such that for all k ≥ N , R F (q k ) q k R F (q k+1 ) holds. Let τ N denote the suffix of τ whose first state is q N . Then by Proposition 5.7 the lowest parity in the set ζ(τ N ) is even, and since ζ(τ ) = ζ(τ N ) the result follows.
As we observed before the proposition, a nominally winning infinite trace of a finite state parity automaton is necessarily comprised of a finite simple prefix followed by an infinite series of repeated loops. It is then straightforward to argue that the least parity appearing on any such loop must be even. Continuing on this line of thinking one observes that any such repeated loop comprising part of an infinite trace satisfying (6) must consist entirely of even states. Hence a trace of this form will feature odd states only finitely often.
Proposition 5.8. Let τ = q 0 q 1 q 2 . . . ∈ Q ω be an infinite trace of the parity automaton (A, F ). If for all q k ∈ Q \Q appearing on τ andQ is finite then τ satisfies F .
Proof. Let q k ∈ Q \Q. If q k ∈ F 2i for some i then (9) implies that R F (q k ) i R F (q k+1 ) and q k q k q k+1 as required. Instead assume that q k ∈ F j for some j odd. The function f (d(q k , F )) restricted to any i ∈ {0, . . . , n} is non-zero, and so R F (q k+1 ) ≺ i R F (q k ) for some 2i < j and hence for all l satisfying i ≤ l < j. Therefore R F (q k ) q k R F (q k+1 ).
Finally let q k ∈Q and q k ∈ F 2i . Then q k and q k+1 need not satisfy (9) and so may not satisfy the parity measure . Since q ∈Q there exists no l > k such that q l = q k . Indeed, if this were the case, it would contradict our assumption that a finite trace connecting q k to a state of lower or equal parity does not exist. Since the cardinality ofQ is finite there exist only a finite number of indices l ∈ N such that R F (q l ) q l R F (q l+1 ) does not hold and Proposition 5.7 yields the result.
Given a control Lyapunov function R F for a parity automaton (A, F ) a deterministic memoryless strategy S : Q → Σ induced from R F may be defined as follows. Let q ∈ Q.
(i): If q ∈ Q \Q choose S(q) = a such that R F (q a ) satisfies (9) and is minimal with respect to the lexicographic ordering. (ii): If q ∈Q set S(q) = a for any a ∈ Σ.
Theorem 5.9. Let (A, F ) be a finite parity automaton satisfying Assumption 2.5 and let S : Q → Σ be a deterministic memoryless strategy. Then S is nominally winning if and only if there exists a Lipschitz continuous control Lyapunov function R F such that S may be induced from R F .
Proof. That a strategy induced from a control Lyapunov function is nominally winning follows immediately from Proposition 5.8. So let S : Q → Σ be a deterministic memoryless nominally winning strategy for (A, F ). In order to synthesize a control Lyapunov function from which S may be induced, the state set Q is partitioned into n + 1 pieces, where the sets F 2i for i = 0, . . . , n are defined as follows. For q ∈ Q, let i ∈ {0, . . . , n} be the least such that there exists a trace resulting from applying S in A connecting q to a state in the set F 2i . Then the state q is contained in F 2i . Since we assume that a state of even parity may be reached from all states in Q, the resulting sets form a partition.
Define R : Q → (R + 0 ) n+1 where for q ∈ F 2i \ F 2i , R(q) = q ∈τ x q where τ ∈ Q * is the unique trace connecting q to some state in F 2i resulting from applying the strategy S in A.
Let F d = n i=0 (F 2i ∩ F 2i ), the set of states for which the function R has not been defined. Notice that it is not necessarily the case that F d = F . These states are precisely those states of even parity from which a state of lower or equal even parity cannot be reached -that is, F d coincides precisely with the set Q. For q ∈ Q set R i (q) = 0 where q ∈ F 2i , R j (q) = d(q, F 2j ) for j > i and R j (q) = ∞ for j < i where j ∈ {0, . . . , n}.
We once again observe that for all q ∈ Q \ Q for some i depending on q. Hence R is a control Lyapunov function.
Since the choice of input for q ∈ Q may be arbitrary for a strategy induced from R, the result follows.
The following result takes advantage of the extra flexibility resulting from a partial colouring of the state set. If each set F 2i for i = 0, . . . , n has only non-parity states in its immediate neighbourhood, the sets may be inflated without overlap to ensure that a strategy induced from a control Lyapunov function is winning for an inflated acceptance condition F as defined below.
Theorem 5.10. Let (A, F ) be a finite parity automaton satisfying Assumption 2.5 with constant disturbance bound γ and let S be a deterministic memoryless strategy induced from a control Lyapunov function R F . Further, let F = 2n+1 j=0 F j be such that F Q and for all i ∈ {0, . . . , n} if q ∈ F 2i and f (d(q, F 2i )) ≤ Kγ then q ∈ F . Then S is a σ-robust winning strategy for σ = f −1 (Kγ)/γ.
Proof. Assume first that R F is a Lipschitz continuous control Lyapunov function for (A, F ) and let S be a deterministic memoryless strategy induced from R F . Let T be a disturbance strategy and let τ ∈ Q ω be the unique nominal outcome resulting from S and T . An argument similar to the one used in Theorem 3.1 implies that for each q ∈ τ Let 2i be the least colour appearing infinitely often on τ and define F 2i = {q ∈ Q | d(q, F 2i ) ≤ σγ} for i = 0, . . . , n. Inequality (10) implies that τ will visit infinitely often states in the set F 2i in A. Since, by assumption, states in F 2i \ F 2i are not contained in F , the inflation from F 2i to F 2i will not cause any state to have more than one parity, and we conclude that the strategy S is σ-robust.
For parity automata with state dependent disturbance bounds we again use the operators g and g, but this time with some modifications to take advantage of the progress measure . As for the case of reachability automata, opt 0 is defined to be a vector of size m over the positive reals, however this time we let opt 0 (j) = (d(q j , F 0 ), d(q j , F 2 ), . . . , d(q j , F 2n )) where F = {F 0 , F 1 , . . . , F 2n+1 }. The operators g and g are defined in the same way as for reachability automata but the underlying ordering used for the minimum operation is the lexicographic ordering on the n + 1-tuples instead of numerical ordering as in previous cases. This alteration will not affect the complexity of the algorithm.
For a nominally winning strategy S for a finite parity automaton (A, F ), σ may be recovered by calculating opt * for A| S . We abuse previous notation and let opt(j, k) denote the k-th index in the n + 1 tuple appearing on the jth line of the vector opt. Then σ = max k=1,...,n+1 opt * (0, k) γ .
Then if F = 2n+1 k=0 F k is such that F Q and for all i ∈ {0, . . . , n} if q ∈ F 2i and d(q, F 2i ) ≤ σγ then q ∈ F , the strategy S is σ-robust.
For optimal strategy synthesis we first restrict the automaton A with respect to the progress measure . For all q ∈ Q, a ∈ Λ(q) if and only if opt 0 (j) opt 0 (j ) where δ(q, a, ) = q j . We denote the automaton restricted in this way by A| . Calculating opt * for A| , the optimum achievable value of σ is recovered as The method of induction of the strategy S is a straightforward generalization of the approach presented for previous acceptance conditions. Again one must check the separation of the even parity sets with respect to the distance function d to ensure that the resulting strategy will be robust.

APPLICATION: TRANSIENT FAULTS
Transient faults, such as single-event upsets, are unpredictable disturbances in electronic systems that can cause bits in an electronic circuit to flip. They are becoming more relevant in electronic systems design due to reductions in feature sizes [6,16,22]. We show that strategies synthesized using control Lyapunov functions are robust to infinitely occurring transient faults provided they occur infrequently enough.
Let N ∈ N. A disturbance strategy T : Q + × Σ → X is N -bounded if, whenever T (τ, a) = and T (τ , b) = for traces τ, τ ∈ Q * with τ a proper prefix of τ and a, b ∈ Σ, we have |τ | − |τ | ≥ N . Intuitively, disturbance strategies are N -bounded if any two occurrences of (non-trivial) disturbances are separated by at least N steps.
Let A be an automaton and F a (Büchi or parity) acceptance condition. Our main result is that for sufficiently large (but finite) N , a nominally winning strategy induced from a control Lyapunov function is winning against N -bounded disturbance strategies. Proposition 6.1. Let A be an automaton, F a Büchi acceptance condition and F a parity acceptance condition.
(i): Let R F be a control Lyapunov function for the Büchi automaton (A, F ) and let S be a σ-robust deterministic strategy induced from R F . Then S is winning against every N -bounded disturbance strategy with N ≥ max q∈F |τ S (q, F )| where F = {q ∈ Q | d(q, F ) ≤ σγ}. (ii): Let R F be a control Lyapunov function for the parity automaton (A, F ) and let S be a σ-robust strategy induced from R F . Then S is winning against every N -bounded disturbance strategy, where In (ii) it is important that the value of N is finite. Indeed, that N is not finite is a possibility since there may exist sets of even parity which are not reachable from a given state q ∈ Q.
Proof. For (i), we show that for any q ∈ Q there exists a finite trace in A connecting q to F resulting from applying S.
First let q ∈ Q be such that d(q, F ) > σγ. Then since S is σ-robust there exists a unique finite trace τ S (q, F ) ending at some state q ∈ Q such that d(q , F )) ≤ σγ, regardless of how frequently the fault occurs. Now assume q ∈ Q is such that d(q, F ) ≤ σγ. By assumption if the unique trace τ S (q 0 , {q}) is such that q = p ax for some x = , that is, the state q was reached due to the effects of a fault, the next N transitions on the trace will be nominal, that is, x = . By definition of N and S the resulting subtrace of length N will visit a state in the set F . Assume instead that q = p a ∈ F . If the next state q a x on the trace resulting from S is such that x = then q a x will satisfy d(q a x ) ≤ σγ and the same argument may be applied. Therefore if no fault occurs for the next N transitions some state in the set F will be reached. If a fault occurs, a state in the set F will be reached in the N transitions following the fault.
If x = then either d(q ax , F )) ≤ σγ in which case the above argument applies, or d(q ax , F ) > σγ and the first argument applies. So we conclude that the strategy S is winning in the automaton A against an N -bounded disturbance strategy.
For (ii) the argument is similar. If q has even parity then the result follows. Assume instead that q ∈ F j with j odd. If for i ∈ {0, . . . , n}, ∞ > d(q, F 2i ) > σγ with 2i < j then since S is σ-robust there exists a finite trace resulting from S connecting q to some state q satisfying d(q , F 2k ) < σγ for some k ∈ {0, . . . , n} regardless of how frequently the fault occurs. Now assume q and i ∈ {0, . . . , n} are such that 2i < j and d(q, F 2i ) ≤ σγ. By assumption if the trace resulting from S connecting q 0 to q is such that q = p ax for some p ∈ Q, a ∈ Σ and x ∈ X \ { } the next N transitions will be nominal and the resulting subtrace will feature a state in the set F 2i . If instead q = p a then either (i): the next state on the trace is contained in a set F 2i for some 2i < j and we are done; (ii): q ax ∈ F 2i for some i and x = and a state in a set of lower even parity will be reached in the next N steps or (iii): the next state q ax is such that x = . Then the argument is repeated: if a fault does not occur for the next N transitions then a state in a set of lower even parity will be visited. If a fault occurs, a state of even parity will be visited in the next N transitions following the fault. Therefore a strategy S induced from a Lipschitz continuous control Lyapunov function is winning for the parity automaton (A, F ) against an N -bounded disturbance strategy.
Compare the above result to the equivalent bound one might establish for a strategy induced from a classical shortest path rank function in a Büchi automaton: in this case the value of N must be greater than the length of the longest simple path connecting a state in Q to a state in F . In our result N is defined with respect to a potentially much smaller subset of Q. Since the bound N is a monotonically increasing function of the environmental error γ this result provides a bridge between the state based view of faults and the running time of the system: a less powerful fault may occur more frequently than a more powerful one without disrupting a well designed strategy.

DISCUSSION
We have presented a theory of robustness for ω-regular properties of automata. We have considered both deterministic and non-deterministic memoryless strategies, and disturbances whose power is bounded universally across the whole system, or bounded dependent upon the current state. In every case we provide methods to explicitly calculate and guarantee robustness of given strategies, as well as polynomial time algorithms to synthesize optimally robust strategies for a given system. There are two natural extensions to our work. First, in our model, bounded disturbances are the only source of adversarial interaction. The presence of additional adversaries leads to (more complex) algorithms for solving two-player games [3,30]. We believe our simpler model is already applicable in many settings -we are inspired by similar models in continuous control-and our polynomial-time algorithms render our results applicable in practice. It would therefore be of interest to see how our results extend to a setting in which additional adversarial influences exist.
Second, how can we combine our results on automata with the existing theory of robust control for continuous systems? We believe that by consolidating some of the recently reported results [23,28] on the existence of automata based abstractions of continuous control systems with the methods presented here we can expect to obtain a comprehensive robustness theory for cyber physical systems.