Live synthesis

Synthesis automatically constructs an implementation that satisfies a given logical specification. In this paper, we study the live synthesis problem, where the synthesized implementation replaces an already running system. In addition to satisfying its own specification, the synthesized implementation must guarantee a sound transition from the previous implementation. This version of the synthesis problem is highly relevant in “always-on” applications, where updates happen while the system is running. To specify the correct handover between the old and new implementation, we introduce an extension of linear-time temporal logic (LTL) called LiveLTL. A LiveLTL specification defines separate requirements on the two implementations and ensures that the new implementation satisfies, in addition to its own requirements, any obligations left unfinished by the old implementation. For specifications in LiveLTL, we show that the live synthesis problem can be solved within the same complexity bound as standard reactive synthesis, i.e., in 2EXPTIME. Our experiments show the necessity of live synthesis for LiveLTL specifications created from benchmarks of SYNTCOMP and robot control.


Introduction
The past decade has brought remarkable progress in the automatic synthesis of reactive systems from temporal specifications [8,17,22]. Traditionally, synthesis is seen as a one-off method: the generated implementation is guaranteed, by construction, to satisfy the specification. If the specification changes, the process is repeated from the start. For systems that are always-on, like banking systems, or controllers in power plants, this may, however, not be an option: when the requirements change, the system must be updated,    1 CISPA Helmholtz Center for Information Security, Saarbrücken, Germany while it is still running, and the control must transition to the new version without disrupting the safety or functionality of the running system. While such live updates are a wellstudied concern in operating systems research (cf. [13]), they are, somewhat surprisingly, still a novelty in formal methods. In this paper, we define a live system as sequence of implementations, each with a corresponding specification. The last element in the sequence is the currently executed system. Performing a live update terminates the currently active system and extends the sequence with a new implementation. The key challenge of live updates is that any obligations imposed by the specification of the terminated system that are not yet satisfied at the time of the update must be taken care of by the newly active system. This transfer of obligations is important to make the update transparent from the user's perspective. Consider, for example, an arbiter specified as the LTL formula (request → grant), which requires that every request is eventually followed by a grant. If the update occurs after some request, but before the corresponding grant, then the new implementation must still guarantee the occurrence of the grant.
The problem of model checking live updates is to check whether a given new implementation will result in a correct live update; the synthesis problem is to automatically find such an implementation. To specify the correct han-dover between the old and new implementation, we introduce an extension of linear-time temporal logic (LTL) called LiveLTL. A LiveLTL specification defines requirements on the two implementations and ensures that the new implementation satisfies, in addition to its own requirements, any obligations left unfinished by the old implementation.
We consider two variants of the model checking and synthesis problems. In finite-trace live updates, we only require the update to be correct in a specific situation, i.e., after a specific execution of the previous implementation. In universal updates, we require that the update can occur at any time. We show that model checking live updates is PSPACEcomplete in the initial and update specification. Synthesis is 2EXPTIME-complete in the combination of the specifications for both update variants.
We report on experience with a prototype implementation of our approach on a range of benchmarks, including examples taken from the synthesis competition and a robotic case study. In our experiments, live synthesis is used to construct live updates built on reasonable pairs of specifications. The results show the necessity of verifying live updates with the adapted semantics of LiveLTL and that every considered specification states obligations for the update. This paper is the journal version of [9] with extended proofs and case studies as well as an exploration of the class of obligations induced by LiveLTL.

Running example -relay station
Consider the following setup: a satellite has been positioned in the orbit of Mars in combination with multiple base stations on the planet. The base stations take samples from the extraterrestrial environment, analyze them and submit their findings to the satellite. After the data has been sent by a station, it waits for instructions from the satellite: whether the sample must be further analyzed, or whether it can be discarded and a new sample must be taken. The satellite, on the other hand, provides the stations with the corresponding instructions and collects the data of all stations for relaying it back to earth. To this end, the satellite takes care that always some data of all base stations has been collected to be present in the report for earth.
We formalize this behavior of the satellite in LTL, the semantics is defined in Sect. 3. On the input side, the satellite receives n measurements m j of every base station, where 0 ≤ j < n ranges over the n deployed base stations on the planet. On the output side, the satellite outputs instructions i j and can create a report r to be sent back to earth. The behavior is formalized using the following guarantees: First of all, every measurement m i must be responded to eventually and instructions are only sent in response to received measurements.
Furthermore, a report is generated as long as every base station submits a measurement regularly, while no report needs to be generated as long as some measurements are still missing.
All guarantees ϕ j must be satisfied at every point in time. We obtain the overall specification ϕ := 4 j=1 ϕ j . The specification is realizable, as witnessed by the synthesized labeled transition system (LTS) for two base stations in Fig. 1. We follow the transition system for ϕ 1 . Starting in the initial state, if m 0 and m 1 is received, we stay in the same state and m 0 as well as m 1 is satisfied. The transition system follows the ¬m 0 edge to the state labeled with i 1 to satisfy the subformula i 1 . Note that m 1 → i 1 would be directly satisfied in the initial state since the Moore semantics evaluates the formula based on the current state and next edge label. The states at the top right and bottom left ensure that ϕ 2 is satisfied, i.e., it waits for inputs before the corresponding output is set. Corresponding to ϕ 4 , the top left and bottom right states control the output r which is only allowed to be true as long as all measurements are received.
Consider a situation, where one of the base stations fails. The satellite controller must be updated, since the satellite would wait indefinitely for the data of the broken base station otherwise. The report generation would also be broken. However, we cannot just eliminate the broken base station from the original specification, synthesize again and restart the satellite with the new result. The reason is that there still may be an outstanding instruction of the satellite for one of the remaining base stations, for which this base station is actively waiting. Therefore, the updated specification still needs to take this obligation of the old implementation into account.
In the remainder of this paper, we consider the necessary changes to the synthesis procedure that are required for a correct update of the specification and synthesized implementation. An adapted verification framework is introduced that enables the validation of live systems. We present a logic that avoids the break of the base stations and satellite due to the disregarded obligations of the old system during update. Fig. 1 Synthesized LTS for the satellite specification syntax is a combination of state and path operators over a set of atomic propositions (AP) that define behavior over infinite time. Formulas in LTL are built according to the grammar ϕ ::= ⊥ a ¬ϕ ϕ 1 ∧ ϕ 2 ϕ ϕ 1 U ϕ 2 where a ∈ AP. Temporal operators are next and until U, and all other operators are Boolean connectives. We assume every LTL formula to be in release positive normal form (PNF) where negations are only allowed in front of atomic propositions. For readability, implication → and equivalence ↔ as well as the common abbreviations eventually a for U a and globally a for ¬ ¬a are used throughout this paper. Defining the LTL semantics, the operator evaluates infinite traces σ and explicit index i against LTL formulas ϕ where traces are words over letters σ ∈ (2 AP ) ω . For example, σ satisfies a if in the next step a holds in σ and a U b if a holds until b holds. A trace σ = A 0 A 1 A 2 . . . with A i ∈ 2 AP is an infinite sequence of sets of atomic propositions. We use the infix notation σ [n, m] to crop the trace to the sub-trace from position n to m, σ [n, m] = A n A n+1 . . . A m−1 , where A i ∈ 2 AP , and concatenate the finite trace σ 1 with the possibly infinite trace σ 2 with σ 1 · σ 2 . The semantic operator builds a language of a specification ϕ with Words(ϕ) = {σ ∈ (2 AP ) ω σ, 0 ϕ}. A trace σ that is terminated at an arbitrary position m, i.e., σ [0, m], is a finite trace and denoted by η. The function ex pand : LT L → LT L uses the standard LTL expansion rules to unroll the given formula, ex pand n repeats ex pand n times. For example, ex pand 1 The function after : LT L × 2 AP → LT L [5] evaluates the formula on a given atomic proposition assignment and returns the remaining formula, e.g., after(a U b, {a}) = a U b and after(a U b, {b}) = . The function is formally defined as after(ϕ ∧ ψ, ν) = after(ϕ, ν) ∧ after(ψ, ν) after(ϕ ∨ ψ, ν) = after(ϕ, ν) ∨ after(ψ, ν) . Transition Systems. The reactive model for LTL are transition systems where state labels correspond to the output of systems and transition labels correspond to the input of the environment. Given a finite set of directions ϒ and a finite set of labels , a -labeled ϒ-transition system is a tuple We assume transition systems without terminal states and a deterministic transition function. Model checking and synthesis Model checking a transition system T S against a specification ϕ checks the relation Traces(T S) ⊆ Words(ϕ). The problem of automatically constructing a transition system that satisfies the model checking property is referred to as synthesis. In the course of this paper, we refer to the algorithms of LTL model checking and synthesis as black box algorithms. Similar to Traces(T S), we denote the set of finite traces of T S by FinTraces(T S).

Live updates
Common formalisms for verification agree on the following assumption: different system versions are analyzed in isolation, i.e., everything that happened before the initial state of the new implementation is irrelevant for its correctness. For updates at runtime, this assumption is infeasible. The update system has to satisfy obligations that were stated during the execution of the previous system to be correct. In this section, we set the foundations for a specification language that is able to express the correctness of a live update by defining the structure of two live update problems. We identify the factors that affect the update process and formalize the interplay of the components. The definitions are kept independent of specific temporal logics and can be adapted to various logics and system models.
Proving the correctness of systems either by model checking or synthesis assumes the existence of a starting point that is handled as the initial state. For live updates, the starting point of verification is not the initial state of the update system, but the initial state of the system running beforehand. Running systems create obligations that cannot be discarded when updated live; otherwise, for example, an observer would starve waiting for its response. The recent development of live systems enforces the sensibility of correctness algorithms to validate systems w.r.t. the context they are started in. For linear-time systems given as transition systems, we define the context as the finite execution of the previous system combined with its specification. The finite execution implicitly changes the state of the formula which we refer to as active formula. We capture this change to the formula with a function , which, given a finite trace and a specification, returns a specification that captures the obligations needed for the satisfaction of the update system. With defining , one is able to vary the impact of the initial system to the update system. Verifying an update system with standard LTL, one implicitly defines to be for every input, enforcing no obligations on the update system.

Definition 4.1 (Finite trace live update)
Let T S I be an initial system, T S U be an update system, ϕ be an initial specification, ψ be an update specification, and η be a finite trace of T S I . T S U is considered correct if it is correct w.r.t. ψ and the result of (η, ϕ) for the function : (2 AP ) * × LT L → LT L defining the obligation.
The finite trace live update handles the context of the update as white-box: the finite execution of the previous system is fully known. For this explicit execution, the obligation is computed and, together with the specification of the update system, verified against the update. Figure 2a shows the dependencies built by the finite trace live update where n is the number of discrete time-steps of the finite execution. However, the explicit finite execution of the initial system is not always available. Therefore, Definition 4.2 introduces update correctness for all possible finite paths of the initial system.

Definition 4.2 (Universal live update)
Let T S I be an initial system, T S U be an update system, ϕ be an initial specification, and ψ be an update specification. T S U is considered correct if it is correct w.r.t. ψ and (η, ϕ) for all possible finite traces η of T S I .
The context of the update is handled as black-box in the universal case. The explicit execution and the system's state of the update is unknown, as shown in Fig. 2b. Nevertheless, if all possible obligations are satisfied by the update system, the update is guaranteed to be correct. Definition 4.2 increases the number of possibilities to be verified, since arguing over an infinite set of finite traces cannot be performed directly. In comparison with the explicit live update, length n is kept arbitrary since every finite trace may enforce its particular obligation.
Since we consider reactive systems, it is natural to aim for an update system that reacts to the update context and contains different initial states for different contexts, i.e., for each result of (η, ϕ) the update system starts differently. Note that this problem is covered by the finite trace live update if the number of different contexts is finite. One can solve the update problem for each context and combine the resulting update systems accordingly. In general, multiple other meaningful models of update correctness can be designed, e.g., an existential version defining the existence of an update point in the initial system's future. Nevertheless, finite trace and universal live updates suffice for the course of this paper and build a justifiable framework for live updates.

A temporal language for live updates
With the two live update problems defined, we introduce LiveLTL to state and verify the correctness of live updates. LiveLTL is an extension to LTL and specifies live update properties that automatically enforce the obligations of the previous execution on the update system. The syntax and semantics of LiveLTL as well as the language equivalence to LTL are shown. Moreover, we identify the class of obligations that can be stated by LiveLTL specifications.

LiveLTL
LiveLTL is designed according to three aspects: (1) the initial system is not able to enforce new obligations after termination, (2) all obligations stated before termination are satisfied by the update system, and (3) obligations are satisfiable in finite time. This guideline is a trade-off between independence of the previous system and incurring obligations from the initial specification to the update system. The definition of LiveLTL follows the finite trace update structure and builds the language for inputs as a combination of a finite and an infinite trace evaluation. The syntax is taken from LTL, and we assume the set of atomic proposition for the initial system to be a subset of the atomic propositions of the update system. As extension to the semantic operator of LTL, the operators |η|,I and |η|,U form the language for the initial system and the update system, respectively. |η|,U performs with ϕ as the initial specification, ψ as the update specification, and as the function computing the obligation for T S U an index shift from time-step 0 to the update position and evaluates the changed formula with the LTL operator and is defined as σ, i |η|,U ϕ iff σ, i + |η| ϕ. Since the update specification is only relevant for the update system, the shift of size |η| enables the correct evaluation of the update system's part of the trace. |η|,I inserts |η| as upper bound for recurrent formulas, i.e., formulas with the release operator: Informally, ϕ 1 R ϕ 2 opens the obligation ϕ 2 in every execution step which contradicts (1) if evaluated after the update. As standard LTL semantics enables the specification to infinitely open new obligations, |η|,I is built to limit this behavior to the actual finite execution of the initial system. The definition of |η|,I mostly follows the definition of , except for the evaluation of release formulas. For all indices greater or equal to the length of the trace, ϕ 1 R ϕ 2 is immediately satisfied, thus imposing the end of newly created obligations from the initial implementation. Therefore, the initial operator permits the transfer of finitely satisfiable obligations to the update system (2), but forbids the impact of the initial system after its termination (1). Note that for LTL formulas in PNF, all operators except release only specify finite behavior and all open obligations are satisfiable in finite time (3). The newly introduced operators are used to define the language of LiveLTL.

Definition 5.1 (Language of LiveLTL)
Let ϕ, ψ be LTL formulas and let η ∈ (2 AP ) * . The linear-time property induced by ϕ, ψ, and η is The language is dependent on the initial specification, the update specification, and the finite trace. Evaluating the inclusion of an infinite trace with the first |η| elements being fixed consists of a combination of the operators |η|,I and |η|,U . The initial LiveLTL operator is defined on the syntactic structure of the initial formula and is insensitive with respect to syntactic tautologies. Providing formulas without syntactic ambiguity that cannot be dissolved in |η| time steps is left to the specifier. The following theorem relates LiveLTL and LTL.
LiveLTL ⊆ LTL: To show that LiveLT L ⊆ LT L, we first shift the update formula to the end of the finite trace η with |η|+1 (ψ). The evaluation of the formula ψ is thereby delayed to the starting point of the update system. Secondly, we simulate the handover of the initial formula to the update system: We use ex pand |η| to unroll the initial formula ϕ for |η| time-steps. The resulting formula is equivalent to ϕ and the operators and only occur inside |η| next operators. Following the LiveLTL semantics, we limit the influence of R: Let stri p : LT L → LT L be a function syntactically substituting every R by . The formula stri p(ϕ ) on the expanded formula simulates the operator |η|,I . To obtain the equivalent LTL formula, we concatenate both formulas with an LTL encoding of the finite trace, denoted by While being equally expressive, LiveLTL enables the direct evaluation of the newly introduced live update problems on a given context. Correctness for finite trace live updates follows from standard language inclusion. Definition 5.2 (Finite trace LiveLTL update) Let T S U be an update system, ϕ be an initial specificaiton, ψ be an update specification, and η be a finite trace. T S U is correct w.r.t. finite trace LiveLTL if η · Traces(T S U ) ⊆ Words(ϕ, ψ, η).

Example 5.1
Interpreting the running example as finite trace LiveLTL update, we can obtain the finite trace η = {m 1 , i 0 , i 1 , r }, {i 1 }, {m 0 , m 1 } as execution of the relay station. Evaluating η with |η|,I shows that i 0 , i 1 , and r need to be satisfied by the update system, since both measurements are unanswered, and no report was given after both base stations sent their measurements. Note that changing the last trace element to {m 0 } eliminates the obligations for the base station i 1 and the report r .
The finite trace update directly translates to the definition of LiveLTL, whereas the universal live update adds a level of quantification.

Definition 5.3 (Universal live LTL update)
Let T S I be an initial system, T S U be an update system, ϕ be an initial specification, and ψ be an update specification. T S U is correct w.r.t. universal LiveLTL if ∀η ∈ FinTraces(T S I ) : η · Traces(T S U ) ⊆ Words(ϕ, ψ, η).
To satisfy the universal update condition, the update system needs to be robust against every possible obligation of the initial system. We explore the model checking and synthesis problems of LiveLTL in Sect. 6.

Obligations
The impact of the initial system on the update system is declared by the operator |η|,I and forms a class of temporal properties. We investigate this class and build a monitor that traces the open obligations during the execution of a system. In practice, the explicit update to be performed is unknown during the design of the initial system. Therefore, one approach to face live updates is keeping track of open obligations, while the system is executed. To obtain the expressivity of the obligations possibly enforced by LiveLTL, we introduce the obligation property. Definition 5.4 (Obligation property) A linear-time property P obl over AP is called an obligation property if for all words σ ∈ P obl there exists a good prefix, i.e., for every σ ∈ P obl there exists a word σ [0, m] s.t. ∀x.x ∈ (2 AP ) ω : σ [0, m]·x ∈ P obl .
Obligation properties coincide with the class of co-safety properties (having the same definition as P obl ), which is natural outcome of the LiveLTL semantics. To obtain the open obligations with constant cost during runtime, the construction of a monitor tracking the obligations provides a space bounded solution. The monitor is meant to be constructed simultaneously to the initial system. To define the obligation monitor, we consider the formulas ϕ, ψ to be in the same proper equivalence class [ϕ] p = [ψ] p (cf. [5]), if the formulas are equivalent based on propositional logic. The obligation monitor for an arbitrary LTL formula is then defined as follows: is the initial state, ϒ = 2 AP is the set of directions, after is the transition function defined over T and ϒ, and o(t) = stri p(t) is the labeling function.
Since the state space of OM ϕ corresponds to the state exploration of ϕ, converting the formulas to obligations is achieved by stri p and stored in the labeling function. This can be interpreted as the obligations that have to be satisfied by the update system if an update is initiated in this state. The obligation monitor only tracks states and does not guarantee that every reachable state corresponds to a reachable state of a correct implementation of ϕ. We justify this property by assuming T S I is correct. Figure 3a displays the obligation monitor for ϕ 1 = (m 1 → i 1 ) of our running example with one base station. The monitor starts in an obligation free state corresponding to the state before the system is started and contains one direction for every element of 2 AP . Note that we denote directions symbolically. Whenever m 1 is received on an edge, the obligation i 1 is raised. From the i 1 state, we differentiate between m 1 and ¬m 1 leading to another raise of the i 1 obligation together with i 1 or only i 1 , respectively. Returning to the obligation is only possible if i 1 is set to and m 1 is ⊥ in the same step.

Example 5.2
We explore the following properties of an obligation monitor OM ϕ for an LTL formula ϕ: Proof The authors of [5] proved that if ϕ has n proper subformulas, then the number of reachable ϕ from ϕ is at most 2 2 n . Therefore, the proper equivalence avoids an unnecessary blow-up by propositionally equivalent formulas. Function T is exactly the reachable states under the proper equivalence class, s.t. the number of states in OM ϕ is bounded by 2 2 |ϕ| . The bound for obligation formulas follows directly from the state space of OM ϕ combined with dom(stri p) ≥ img(stri p): We obtain at most 2 2 |ϕ| different obligations and performing the function stri p can only decrease the size. The third part of the theorem is known by combinatorial logic.

Theorem 5.2 (Size of OM ϕ ) The number of states of OM ϕ is bounded by 2 2 |ϕ| and the number of obligations for ϕ is
Note that an offset between initial system and obligation monitor is created. While transitions of the initial system consider environment inputs and states correspond to system outputs, elements of the state space of the obligation monitor are formulas and the transitions are defined by inputs and outputs combined. Residing in a state in the obligation monitor can be interpreted as taking a transition in the system and not yet reaching the next state. Figure 3a shows a monitor for a specification, where the implementation is unknown during construction and the obligation monitor needs to overapproximate the reachable states of the implementation. If known, one can limit the reachable states of the monitor to the paths in the transition system. Indeed, in regard to completeness, unreachable obligations need to be eliminated from the obligation monitor during verification.

Example 5.3
The obligation monitor for the relay station cropped to the two rightmost states is shown in Fig. 3b. We combine the two states with the obligation monitor for the formula ϕ 1 (cf. Fig. 3a) to compute the exact reachable obligation states. For readability, we discard all transitions leading out of that cycle. Assuming that we start with as initial obligation represented by the initial state, we follow the transition ¬m 0 ∧ m 1 to the obligation monitor state i 1 , the top left state in the implementation. To give an example for the offset of the monitor and the transition system, if we take the loop ¬m 0 ∧ m 1 , we stay in the same state but change the obligation: The future system has to satisfy i 1 ∧ i 1 . The obligation monitor consists of five different states with four different obligation properties, whereas the implementation only has two states. The monitor is deterministic and cut to the reachable states and transitions of the implementation.
The construction of obligation monitors is useful in multiple scenarios. For the practical use of verified finite trace updates, the obligation monitor gives a bound for the additionally consumed space needed to verify live updates, whereas storing a finite trace can increase arbitrarily. Moreover, obligation monitors can be adapted to any live update semantics and implicitly build the state space of possible obligations. We delineate two possibilities to obtain the obligations a live update needs to be verified against: Tracking the obligations during execution of the system with after and stri p and building the obligation monitor before starting the system and running it in parallel. The tradeoff between a huge monitor and an unbounded computation of after and stri p while running the system is left open to the user. In the following, we solve the live update model checking and live update synthesis problems for LiveLTL.

Model checking and synthesis
In this section, we solve the problems of model checking live updates and synthesis of live updates, i.e., live synthesis. We explore finite trace and universal updates for the problems and show the complexity of each result and multiple parameters.

Model checking live updates
Model checking a transition system T S against an LTL formula ϕ corresponds to answering the question if TS satisfies ϕ, i.e., T S ϕ. For live systems, the evaluation of the update transition system starts with the initial finite execution and switches to the update system afterward. Model checking the update system is therefore a language inclusion check of the traces of the transition system combined with η against the LiveLTL semantics. Definition 6.1 (Model checking finite trace live updates) Let T S U be an update system, ϕ be an initial specification, ψ be an update specification, and η be a finite trace. The problem of model checking finite trace live updates is defined as η · T races(T S U ) ⊆ Words(ϕ, ψ, η).
The model checking problem can be split into two separate parts, directly identifying the newly introduced conditions for live systems with the operators |η|,I and |η|,U . In addition to that T S U combined with η needs to satisfy the update semantics of LiveLTL. Since both tasks can possibly be performed in isolation of each other, the overhead given by the live update semantics under the assumption of an update system already verified with LTL is an interesting topic but left open for future work. The complexity of the problem is stated w.r.t. the length of the trace and the combination of initial and update formula: Complexity in ϕ + ψ, and η) The model checking problem for finite trace live updates is PSPACE-complete in |ϕ| + |ψ| and in NL in η · T S U .
The proof is subsumed by the proof of Theorem 6.2. The universal live update is verified independently of specific initial traces. The condition is stronger than for finite trace updates, and the number of compatible initial and update systems is smaller. Given that the context is unknown, the executions starting in the initial state of T S U need to satisfy every possible open obligation. Universal updates are relevant if neither the trace nor the obligation monitor are stored and computed, respectively. Given the initial system, model checking universal update compatibility obtains the same complexity as finite trace updates.

Definition 6.2 (Model checking universal live updates) Let
T S I be an initial system, T S U be an update system, ϕ be an initial specification, and ψ be an update specification. The problem of model checking universal live updates is defined as ∀η ∈ FinTraces(T S I ) : η · T races(T S) ⊆ Words(ϕ, ψ, η).
The implicit update points in T S I allow for the connection of both transition systems and model checking with a linearly increased formula.

Theorem 6.2 (Complexity in ϕ + ψ, and T S I · T S U )
The model checking problem for universal live updates is PSPACE-complete in |ϕ| + |ψ| and NL in T S I · T S U .
Proof We obtain the lower bound by initializing ϕ with and T S I with an empty system. Model checking with LiveLTL semantics is then verifying the update system against the update formula. For the upper bound, we concatenate both, the specifications and the transition systems. T S I and T S U are connected by a duplicate of every edge in T S I annotated with a newly introduced atomic proposition update. update is controlled by the environment and switching the systems also obtains the inputs from the environment in this step. The new atomic proposition also encodes the end of the initial system in the formula: Every occurrence of release receives the limitation to update. The construction follows the equi-satisfiability proof of [18] for LTL on finite traces (LT L f [12]). We therefore obtain a formula that is co-safe if the environment assumption update holds. To initialize the formula of the update system, update also spawns ψ which has to hold after starting the update system. We combine all formulas and obtain one LTL formula and one system that are both linear in the size of the source formulas and transition systems. Since we base the reduction on known LT L f results and simple concatenation of transition systems, we can use LTL model checking for LiveLTL model checking. Therefore, we obtain the complexity results from LTL [25] for ϕ + ψ and T S I · T S U .

Live synthesis
In this section, we introduce the problem of live synthesis and show the complexity of synthesizing live systems. Synthesis of live updates during the runtime of the initial system promises correct-by-definition updates that can substitute the executed system instantaneously. In contrast to model checking, the synthesis procedure returns an implementation or unrealizable, proving that the finite trace or initial system and initial specification are incompatible with the update specification. We begin with live updates for an explicit finite trace of the initial system -the update system needs to react to the explicit context and open obligation. The definition follows the model checking problem, but searches for a transition system satisfying the live update.

Definition 6.3 (Finite trace live synthesis)
Let ϕ be an initial specification, ψ be an update specification, and η be a finite trace. The finite trace live synthesis problem is the computation of a transition system T S s.t. η · Traces(T S) ⊆ Words(ϕ, ψ, η).
We additionally call a live update realizable if there exists a transition system that satisfies the finite trace live update. The complexity of the update synthesis is expressed w.r.t. ϕ and ψ and aligns to existing LTL synthesis bounds. ϕ and ψ) The finite trace update synthesis problem is 2EXPTIME-complete in |ϕ| and |ψ|.

Theorem 6.3 (Complexity in
Proof The hardness proof follows the Proof of Theorem 5.1 from LTL to LiveLTL. We reduce LiveLTL to LTL to show completeness: The finite trace update is synthesized for ϕ, ψ, and η. The formula ϕ that we synthesize the update for is an LTL formula and similar to the proof of Theorem 5.1. This formula contains the encoded trace η, ϕ restricted to the semantics of LiveLTL, i.e., every release formula can be released by the system AP update, and the shifted version of ψ to position |η|. Furthermore, we add the AP update to the last position of the trace encoding of η. The synthesized strategy follows the trace η until update, and then satisfies the obligation of ϕ and ψ. The formula ϕ is constant in ψ and linear in ϕ, and we therefore obtain the same complexity in ϕ and ψ as for LTL [25].
The universal update is again of interest if the context of the live update is unknown. Synthesizing a transition system that satisfies the universal live update enables the user to plugin the new system at any time-step without further analysis.

Definition 6.4 (Universal live synthesis)
Let ϕ be an initial specification, T S I be an initial system, and ψ be an update specification. The universal live synthesis problem is the computation of a transition system TS s.t. ∀η ∈ FinTraces(T S I ) : η · Traces(T S) ⊆ Words(ϕ, ψ, η).
Again, we call the problem of the existence of a solution realizability. In general, the universal update obtains a conjunction of double exponentially many conjuncted obligations. To avoid the expansion of the update system, we combine the parity games of the initial and update system. Again, the initial formula conducts the impact on the update system and provides the complexity results. Theorem 6.4 (Complexity in ϕ and ψ) The universal update synthesis problem is 2EXPTIME-complete in |ϕ| and |ψ|.
Proof The hardness proof follows the proof of Theorem 5.1 from LTL to LiveLTL. To show the completeness, we reduce LiveLTL to LTL. Assume the universal update from ϕ to ψ with initial system T S I . Let ϕ be obtained by limiting all release formulas in the formula ϕ to the environment AP update, i.e., all occurrences of ϕ 1 R ϕ 2 are replaced by (update ∨ ϕ 1 ) R ϕ 2 . We build the parity game of ϕ ∧ (update ∧ ψ) (cf. [6]), where update is enforced to only occur once but will eventually hold. We introduce the following changes to the game: The first part of the game (ϕ ) is restricted to the edges that can be taken in T S I and all edges are controlled by the environment. This is a simple unrolling of the edges in T S I . Therefore, the environment can move arbitrarily in the first game and build any obligation possible, as in the obligation monitor. Solving the game synthesizes a universal update for the triple T S I , ϕ, ψ regarding the LiveLTL semantics. Since the reduction is linear in |ϕ| and |ψ|, we obtain the complexity results from LTL [25] for ϕ and ψ.

Case study
We explore the live update problems on benchmarks from the reactive synthesis competition [17] and robot control communities [21]. Our goal is a qualitative analysis of pairs of specifications that can be updated live according to the finite trace live update and the universal live update. In more detail, we aim to answer the following questions: For specifications that can potentially be updated to each other, does the LiveLTL semantics state universally updatable obligations? And if not, in how many obligation states is a finite trace update possible?
A prototype for the live synthesis procedure is implemented on top of BoSy [8], a tool that synthesizes implementations for LTL formulas. 1 We use Spot [4] for LTL formula manipulation and implemented the obligation monitor construction for arbitrary LTL formulas. For our experiments, the following structure is used: BoSy synthesizes a system for the initial specification which is used to build the obligation monitor. Therefore, the result of the synthesis query, i.e., a transition system satisfying the formula, is parsed and cut with the obligation monitor to eliminate unreachable states.
Since the result of BoSy may differ per execution, we may obtain different sizes of the obligation monitor for different benchmark runs. Based on the obligation monitor, we perform explicit trace live synthesis for every monitor state label and universal live synthesis for all monitor states combined. Therefore, we build the conjunction of obligation monitor state labels and update formula and execute BoSy to check realizability. Note that this algorithm does not satisfy the upper bound of Theorem 6.4, as each obligation has up to exponential size in the initial formula (cf. Theorem 5.2), which is the input of the synthesis algorithm. To compare the performance of LiveLTL synthesis to general LTL synthesis, obtaining the obligations has to be included in the synthesis tool. Nevertheless, the current prototype has the benefit of explicitly stating the obligations and is compatible with arbitrary synthesis tools.
For the benchmarks in Sect. 7.1, Table 1 shows multiple results: The number of obligation monitor states built by the initial system and specification, the number of finite trace updates that are realizable, and the result of the universal update. Despite the finite trace live update stating updates from every possible finite execution of the initial system, we use the state representation of the obligation monitor to symbolically represent every execution. Table 2 compares the sizes of the update systems synthesized with and without LiveLTL semantics. The systems are represented in the Aiger [2] format, the columns #lat. and #gat. shows the number of latches and gates, respectively. The runtime in seconds

Benchmark families
The upper part of Table 1 shows the results for live updates from specification patterns introduced by Menghi et. al. [21], where Reactivity implements additional interaction with the environment. The specifications define the behavior of a robot that is able to travel between n different locations and needs to satisfy different specifications on the way. Our second set of benchmarks is taken from the annual synthesis competition SYNTCOMP [17]. The results for live updates in the reactive synthesis setting are shown in the lower part of Table 1.
-Visit, Seq. Visit, and Patrolling enforce the robot to visit every location once, in a sequence, and infinitely often, respectively. -Reactivity The reactivity specification forces the robot to react to an event after two steps at latest by driving to a delineated location, e.g., for refueling. The reactivity specification can be added to arbitrary specifications. -Relay station The running example of this paper. The relay station communicates with n satellites and forwards the message if clients acknowledged. -Arbiter An arbiter controls the access of multiple clients to a shared resource. It ensures that every request to the resource is eventually granted. We consider three variants of arbiter, a simple arbiter (s) only iterating over grants, a full arbiter (f) only granting access if requested beforehand, and a prioritized arbiter (p) that prioritizes the requests of client 0. -ABP. The alternating bit protocol consists of a receiver ABPReceiver and a transmitter ABPTransmitter specifying the data link layer in the OSI communication network. -Load balancer The load balancer distributes workload over n worker.
In addition to the specifications, we denote updates with an increased parameter with n → n + 1. This property is of interest if the parameter may change during the execution, e.g., increasing the number of clients of an arbiter.

Observations
Throughout all experiments, the minor runtime overhead of the universal update synthesis shows that the additional cost for live update correctness is feasible. The robot specifications provide insight of obligations raised during execution. Since most of the benchmarks obtain the same structural behavior, i.e., the robot visits the locations under some restrictions, the universal live updates are realizable. Even when adding requests, e.g., the robot has to refuel in two steps after requested, the live update is realizable by satisfying the open obligations after the update. Changes to the visiting sequence or infinitely often reaching a location with patrolling increases the size of the obligation monitor (#OM-States) but does not lead to unrealizability. Nevertheless, the sizes of the obligation monitors indicate that tracking the behavior of the system is necessary to obtain the correct obligation. Altogether, our results show that although robot specifications raise obligations, synthesizing correct live updates is often feasible due to the absence of conflicts between the specifications. Most interestingly for the reactive systems benchmarks are arbiter live updates. Changing a specification to a simple arbiter is realizable since the arbiter does not additionally restrict the behavior. However, live updates to full arbiter are only possible from some obligation monitor states, shown by the difference of #OM-States and #finite trace updates. Unrealizability follows from obligation states forcing a grant -an unrequested grant of the update system would be spurious. Since the prioritized arbiter does not include non-spuriousness, a live update from and to this arbiter is realizable. The relay station can be universally updated to the one more and one less base stations. Once computed, the obligations can be satisfied in finite time-steps and synthesizing a solution that reacts to all obligations is possible. The sizes of the solutions vary in the number of latches and gates needed to realize the specifications. Table 2 shows that we only observe a minor increase in complexity in the synthesized circuit, for some examples even no increase at all. This changes depending on the complexity of the obligations stated from the initial system. The experiments answer the questions stated at the beginning of this section: Specifications that are meaningful live updates state obligations for the update system, shown by the large number of states of the obligation monitors. Realizability of the update system depends on the restrictiveness of the specification, even if the universal update is unrealizable, our results show that in all benchmarks, some finite trace live updates are realizable.

Related work
The necessity of live updates in always-on systems is long known and was introduced as [7,10]. Dynamic updates for programming languages, e.g., in C++ [16] and Java [14], enable developers to update dynamic classes during runtime and are called dynamic software updates (DSU). The proposed frameworks implement functionality and are unable to ensure temporal correctness of the updates. Live kernel patches received huge attention in the operating system community [1,13], where bug-fixes and features of the kernel can be deployed without reboot. Recent work in live updates for operating systems achieved real-life implementations, e.g., for Linux [19] and Android [3] kernels. Implementations of dynamic updates raised the need for verification: Following the idea of observability by the user, Hayden et. al. [15] introduce client-oriented specifications (CO-specs) to define and verify against client-visible behavior. Closest to our work are dynamic updates in controller verification and synthesis. Ghezzi et.al. [11] introduce a controller synthesis approach based on modal sequence diagrams (MSD). The update is a synthesized MSD that takes over the execution when a safe state is reached. While reaching a safe state is also necessary in [20], the authors omit the obligations of the previous system. Where [11] also relies on the existence of a safe state for the live update, [23] also proves the reachability of the update state. Therefore, the condition of the handover between the systems is defined as LTL specification. The main difference is stating the correctness as LTL formula and not observing the update condition semantically from the initial formula.

Conclusion
We introduced live synthesis, a synthesis framework for dynamic updates in reactive systems. We identified obligations of a running system as the currently open co-safety formulas and defined LiveLTL to specify the correct handover between two systems. The presented obligation monitor enables tracking of obligations during system execution and continuously shows the open obligations. We explored synthesis and model-checking for two update problems, finite trace live updates and universal update, which consider full information and zero information of the currently open obligations, respectively. Our case study on robot specifications and reactive synthesis benchmarks show that it is necessary to verify live updates in always-on systems and live synthesis is able to automatically generate correct update systems if realizable. We believe that live updates play a crucial role in high-availability system verification and can benefit from existing techniques for reactive systems.
Funding Open Access funding enabled and organized by Projekt DEAL.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecomm ons.org/licenses/by/4.0/.