{'fraction_non_alphanumeric': 0.032019861851970206, 'fraction_numerical': 0.0069614807895577785, 'mean_word_length': 4.34028197117278, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 69, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Automated Synthesis of Controllers for Search and Rescue from Temporal Logic Specifications

In this thesis, the synthesis of correct-by-construction controllers for robots assisting in Search and Rescue (SAR) is considered. In recent years, the development of robots assisting in disaster mitigation in urban environments has been actively encouraged, since robots can be deployed in dangerous and hazardous areas where human SAR operations would not be possible. In order to meet the reliability requirements in SAR, the specifications of the robots are stated in Linear Temporal Logic and synthesized into finite state machines that can be executed as controllers. The resulting controllers are purely discrete and maintain an ongoing interaction with their environment by changing their internal state according to the inputs they receive from sensors or other robots. Since SAR robots have to cooperate in order to complete the required tasks, the synthesis of controllers that together achieve a common goal is considered. This distributed synthesis problem is provably undecidable, hence it cannot be solved in full generality, but a set of design principles is introduced in order to develop specialized synthesizable specifications. In particular, communication and cooperation are resolved by introducing a verified standardized communication protocol and preempting negotiations between robots. The robots move on a graph on which we consider the search for stationary and moving targets. Searching for moving targets is cast into a game of cops and robbers, and specifications implementing a winning strategy are developed so that the number of robots required is minimized. The viability of the methods is demonstrated by synthesizing controllers for robots performing search and rescue for stationary targets and searching for moving targets. It is shown that the controllers are guaranteed to achieve the common goal of finding and rescuing the targets.


Introduction
Robot-assisted Search and Rescue (SAR) has received increased public attention after the 1995 Hanshin-Awaji Earthquake in Kobe, Japan, and the attacks in the same year on the Murrah Federal Building in Oklahoma City, USA [80]: The RoboCup-Rescue project, started in 1998 at several Japanese universities is one of the first reactions of robotics researchers to the aforementioned earthquake, encouraging the development of robots assisting in disaster mitigation [86].
The US Federal Emergency Management Agency gives the following definition: Urban search-and-rescue (USAR) involves the location, rescue (extrication), and initial medical stabilization of victims trapped in confined spaces. 1 A recent survey by Goodrich et al. [31] extends the application of SAR operations from confined urban spaces: Wilderness search and rescue (WiSAR) operations include finding and providing assistance to humans who are lost or injured in mountains, deserts, lakes, rivers, or other remote settings.
Thus, SAR entails searching for people that are in distress or in need of medical support and providing relief to their situation. In an abstract sense, SAR includes the searching of any kind of problematic object and alleviating the situation. This requires teams of trained personnel, a well-managed organizational structure and management of equipment logistics.

Motivating Robot-Assisted SAR
Consider the scenario of a burning building, or the aftermath of a devastating hurricane. Usually there is only limited information available about whether there were people in the affected area at the time of the incident and what the imminent dangers to the rescue personnel are. Deploying SAR teams exposes personnel to the dangers of the site, and rescue efforts might be slow and costly.
Supporting the SAR efforts by robots has several advantages. Robots can be deployed in hazardous areas where human operations would not be possible. A major issue during disasters is the physical exhaustion and lack of sleep of SAR personnel, resulting in an increased susceptibility to misjudgements. Robots do not suffer from this kind of fatigue, even though their power supply needs regular recharging. Also, the precision of the sensors and speed of robots can by far outmatch those of humans. This is usually partially alleviated by caninesupported or mounted SAR teams, with the obvious limitations in hazardous or physically demanding environments.
As SAR robots obtain higher levels of autonomy, it can also be expected that the number of human operators per robot can be decreased. For each SAR robot that was employed during the operations after the September 11 attacks on the World Trade Center in 2001, at least two or more operators were needed, even though the robots had only very basic reconnaissance capabilities. Current examples of autonomous vehicles with greater operational capabilities are deployed in military applications, and require even a larger number of operators, e.g. 180 for the General Atomics Predator (but here the degree of autonomy is partially limited due to legal constraints). 2 Automated synthesis for a particular class of specifications can be done efficiently in polynomial time. This could even allow feasible on-the-fly synthesis of controllers if the configuration changes during a field operation, e.g. by attaching a new sensor or by changing the means of locomotion [63]. In this case, it is merely required to add the appropriate rules to the specification, as highlighted in the discussion of incremental modification at the beginning of Section 3. However, the main limitation of synthesis approach is the large state space size of the resulting controllers. Hand-coded controllers are less prone to this problem (see the comparisons in Bloem et al. [11]), but cannot be scaled to arbitrary size and complexity.

Contributions
In this thesis, the development of controllers for autonomous SAR robots is investigated. In order to act autonomously, a robot must be enabled to make decisions about the actions it performs, based on its observations about the environment and the other robots.
We consider purely discrete controllers for SAR robots that maintain an ongoing interaction with their environment by changing their internal state according to the inputs they receive. The specification of such controllers consists of a set of rules or guarantees such as "each location in the search area is visited repeatedly," while allowing assumptions about the environment to be made, such as "targets cannot move faster than 3 mph." Such statements are be expressed in a formal high-level specification language which closely matches how humans would naturally express such properties.

ROBOT-ASSISTED SAR SCENARIOS
Instead of merely verifying properties, we are concerned with synthesizing controllers that are correct by construction. Using such an approach shifts the validation effort to the specification. However, expressing the specifications in a high-level language can greatly simplify this process.
SAR is typically performed using several agents that have to coordinate and communicate. We therefore need to consider the synthesis of controllers that together achieve a common goal. This is called compositional (or distributed) synthesis, and is in general undecidable [76]. The compositional synthesis problem therefore cannot be solved in its full generality, but we introduce a set of design principles that help to develop appropriate specifications that can be synthesized. Communication and coordination are resolved by introducing a standardized control protocol and preempting negotiations between robots.
The viability of our methods is demonstrated by synthesizing controllers for robots performing search and rescue for stationary targets and searching for moving targets. A four-phase handshake protocol is used to communicate commands between the agents. When interpreting the controllers in real-time, our main motivation is not to attain temporal efficiency, but to develop controllers that are proven to be reliable. We show that the controllers are guaranteed to achieve the common goal of finding and rescuing the targets and provide simulation results demonstrating the validity of the controllers.

Robot-Assisted SAR Scenarios
In this section, we consider two paradigms for robot-assisted SAR and outline the scenarios. The stationary target search in USAR and the moving target search in WiSAR guide our development of the specifications that are synthesized to be executed as controllers on SAR robots.

USAR
Robots assisting in USAR can be deployed for a variety of tasks, like inspecting damaged or collapsed buildings for imminent danger to human rescuers. Robots can also be used to monitor the temperature and air quality in a burning building or provide comfort to victims by establishing a two-way audio connection to rescue personnel. Casper and Murphy [15] provide a survey of such tasks related to the September 11, 2001 attacks on the World Trade Center.
We study controllers for USAR to develop an understanding of the tasks of searching and rescuing when a central coordinating authority exists. In USAR we can assume that injured or entrapped persons or objects are not able to move. It is therefore sufficient to develop methods for stationary target search, which considerably simplifies the controllers.

WiSAR
While USAR is mostly concerned with small to medium scale sites such as burning or collapsed buildings, WiSAR entails searching over large regions in often rugged remote areas [31]. Robot-assisted WiSAR often combines several types of Unmanned Air-and Ground Vehicles in order to find a target that might be moving in order to get to safety itself.
The search strategies required for WiSAR are fundamentally different from those sufficient for USAR. This is mainly because the targets are assumed to be able to move. In this case, the number of robots required for reliable search depends on the topology of the environment. Also, the search radius has to increase with time, since a target might try to move away from the location at which it is initially expected to be, trying to reach safety itself. In this thesis we concentrate on developing a reliable distributed search strategy for a constant search radius.

Challenges in Robot-Assisted SAR
There are several challenges in developing and deploying SAR robots. The most critical ones are summarized below.

Unknown Environment Topology
In a typical SAR scenario, little is known about the topology of the environment in which the robots are operating. In USAR, even if building plans are available to a robot, passages and corridors might be blocked, voids might be opened and in a collapsed building the entire structure might be changed. Also, in a WiSAR application, the terrain might be unknown, and in particular, accurate elevation data is not always available. This is exacerbated by the need to expand the search radius as time progresses.
Searching an unknown environment can be accomplished by first obtaining an internal representation of the topology in which the robot is operating. The main drawback of this approach is that time is wasted on building this internal map that could be dedicated to rescuing. An alternative is to learn the map of the environment concurrently while searching [87,88]. These approaches obtain a probabilistic representation of the environment and are therefore not applicable to the controller framework considered in this thesis.

Changing Environment Topology
Even if the robot has an accurate and reliable representation of the environment topology at some point in time, in a real-world scenario this knowledge has to be updated continually. An example of an application in which this capability is necessary is USAR in a burning building in which hallways and staircases might collapse. Another example is WiSAR after natural disasters such as landslides, floods or earthquakes in which the landscape keeps changing. Thus SAR robots

CHALLENGES IN ROBOT-ASSISTED SAR
need a way of detecting the environment topology and adapting their movements through the SAR site accordingly.
This adds another layer of complexity to the task of synthesizing controllers that are correct by construction, since it has to be taken into account that the "knowledge" a robot has at each point in time might be changing. Synthesis guaranteeing such epistemic (knowledge-based) properties has been considered before [81] but not in the input-output driven way that is required for controllers.
Due to the problems with unknown and changing environment topologies, in this thesis we assume a constant environment and that an accurate and reliable representation of the environment topology is known at specification-time, i.e. when the specification is written for the SAR robots.

Cooperation and Communication
Often a SAR task requires the cooperation of many agents. For example, finding a moving target can be done reliably by a single robot only in a very limited number of cases, see Section 4.3. In order to cooperate, agents must be able to share relevant information about their own actions and adapt their strategies accordingly.
Communication between robots is governed by protocols which must be encoded in the specification. However, this introduces circularity: A robot has to guarantee to satisfy its part of the protocol's contract only if the robot with which it communicates satisfies its own part. A naïve formalization of this principle would allow the robots to exhibit any behavior in the case that no robot satisfies its guarantees initially. Resolving these circularities requires to impose restrictions on the specifications pertaining to communication, giving rise to assumption/guarantee specifications [36] and the corresponding composition rules, see Section 3.2.

Realizability and Synthesizability
Synthesis of correct-by-construction controllers has the obvious advantage that the specification is guaranteed to be satisfied. However, there exist specifications that cannot be realized (or satisfied) by any controller. Thus, if the specification is unrealizable, no controller can be generated from it, independently of the synthesis method used.
Not all specifications that are realizable can also be synthesized into a controller, depending on the synthesis method used. When choosing the synthesis method, there is a tradeoff between the generality of the specifications supported and the efficiency of the synthesis and of the resulting controllers.
The realizability of some specifications depends on the topology of the environment. For example, the property "each location in the search area is visited repeatedly" requires that the topology can be represented by a strongly

PREVIOUS WORK
connected graph, see Section 4.1.1. Deciding realizability and synthesizing controllers for a particular topology can be handled reasonably well by existing methods. However, controllers that provide guarantees for all graphs classified by some user-specified properties (such as connectedness or Hilbertness) pose a much harder problem and is not treated here.

Integration and Human-Robot Interaction
One of the main challenges in developing robots assisting SAR is that they have to be integrated in existing organizational structures. This includes technical aspects such as the tasks that a robot is capable to perform, and the improvements that this yields over not deploying the robots alongside human SAR personnel. However, legal considerations such as liability in the case of failure or lack of trust of team leaders in the robots' capabilities may prevent SAR robots from being deployed even when there are no technical difficulties or limitations.
Moreover, the interaction of humans with the robots must be taken into account. One major concern is the need for trained operators that must dispatch, control and maintain the robots. Also, automatic detection of victims is not yet reliable enough for completely autonomous SAR, so human operators are required to interpret the sensor data [15]. While those aspects mainly concern the search for the victims, automated on-site rescue and medical treatment poses a variety of new challenges.

Previous Work
The previously mentioned RoboCup-Rescue project initiated a surge of research in robot-assisted SAR. However, even as early as 1984, computer assistance to SAR has been considered by Belardo et al. [8]. Early attempts to robot-assisted SAR include supportive technologies for robot deployment [10], coordinating robots to perform rescue-like tasks [5,58] and combining this with cooperative search [35].
The RoboCup-Rescue project and other similar projects simulate USAR scenarios in which several robot-developing teams can test their devices and hold competitions. With the advancements from such early research projects, several SAR robots were deployed during the World Trade Center rescue response in 2001 [15]. While robot deployment time was limited, this unfortunate incident provided valuable information for further development for SAR robots. 3 Recent research into robots assisting in tasks connected with SAR has demonstrated several successful implementations. Several types of robots such as tracked, legged and flying vehicles, snakes and even shape-shifters have been 3  developed that allow access into damaged buildings, hazardous areas and confined spaces [19,25,34,63]. Some of these robots have already been deployed in actual SAR tasks [15,54,62].
Instead of focusing on the physical properties of the SAR robots, this thesis is predominantly concerned with the control of teams of robots. This has been considered previously, e.g. for building inspection and searching [37,88]. However, often these teams need to perform complex tasks that can be described quite straightforwardly in a rule-based way, but are hard to implement manually into a discrete controller that obeys all the rules at the same time. A promising approach is to automatically synthesize correct-by-construction controllers from high-level descriptions [47].
The synthesis of correct-by-construction controllers has been considered since the 1960's for example by Church, Büchi, Landweber, and Rabin. Initially, the results were developed for very general properties, leading to a pessimistic outlook on the computational complexity of synthesis. Also, only recently have methods been developed that are directly applicable for controller synthesis [71]. This seminal work by Piterman et al. enabled efficient synthesis of controllers from temporal logic specifications and forms the basis of synthesis tools developed at the California Institute of Technology and the University of Pennsylvania [47,91]. The respective research groups augment the discrete controllers resulting from the temporal logic specifications with continuous controllers. Other approach to synthesizing such hybrid controllers that are not based on the work by Piterman et al. were developed by Kloetzer and Belta [40] and Loizou and Kyriakopoulos [55]. An overview of current techniques is given in the work by Belta et al., which goes beyond the techniques covered in this thesis [9].
Several successful examples and implementations of controllers that have been synthesized from high level specifications have been developed [27,68,89]. Toy examples of robots moving in buildings and completing tasks include a conceptual implementation of USAR [46]. Controller synthesis has also been suggested to be used for vehicles competing in the DARPA Grand Challenge but for such a large-scale application several hurdles have to be overcome first [14]. Still, modelling and synthesizing controllers from high-level specifications for symbolic control and planning is becoming increasingly powerful [9], and several software front-ends for synthesis of discrete and hybrid systems such as TuLiP [91], LTL-Con [43], LTLMop [27] and PESSOA [59] have been developed since.

Theoretical Background
We consider the synthesis of controllers for SAR robots that are guaranteed to satisfy their specifications by construction. Besides the synthesis procedure, a formal description language of the resulting controllers as well as a formal specification language have to be introduced.
In Section 2.1 we introduce an abstract model of discrete reactive controllers and how to reason about their properties. The synthesis procedure of a single correct-by-construction controller from its specification is outlined in Section 2.2. Since several agents cooperate in an SAR scenario, compositional synthesis is introduced in Section 2.3.

Reactive Systems
A controller must maintain a continuous interaction with its environment and the system it controls. The system can be controlled by changing set points of actuators, but the environment may only be sensed and not influenced by the controller. The system keeps a state that is changed according to the behavior of its controller and its environment. The controller maintains its knowledge about the system's state and thus the controller is simply considered to be part of the system. 1 A traditional computer program can be regarded as relation between a set of initial states and a set of final states, acting as state transformers. However, this paradigm is not appropriate for describing the program of a controller, since it has to refer to the controller's ongoing behavior. A controller reacts to changes in its inputs and its program is therefore called a reactive system [73]. The behavior of a reactive system can be described by a (possibly infinite) sequence of states of the system. This sequence can be influenced by the environment via events or shared variables, which can be modelled by incorporating appropriate atomic propositions into the specification language.
We consider a controller as a reactive system in discrete time. Since in this thesis the synthesized controllers are simulated as if they were running directly on digital microprocessors, this temporal abstraction is sensible. Moreover, we are mainly concerned with specifying and synthesizing controllers that decide on a robot's high-level moves, similar to the moves in a game of chess, rather than the robot's continuous trajectories.

Fair Discrete Systems
A reactive system can be represented as a Finite State Automaton (FSA) that captures how the system state evolves over time. Piterman et al. suggest the use of a Fair Discrete System (FDS) 2 as an abstract computational model for reactive systems [71]. We make the inputs, the outputs and the state space explicit, as it will later simplify the description of systems consisting of several FDS's.

Definition 1.
A Fair Discrete System M is a tuple (V, X , Y, Q, Θ, ρ) consisting of the following components: denote the set of all possible valuations of all variables in V , called the alphabet of M. • X ⊆ V is the set of environment variables that are controlled by the environment. They are also called inputs. • Y = V \X is the set of system variables that are controlled by the system (i.e. the actuator set points). They are also called outputs. • Q ⊆ V(V ) × N 0 is the set of states. A state q ∈ Q is a valuation with a unique identifier, so there can be two distinct states corresponding to the same valuation. We write q[u] to denote the value of the variable u ∈ V in the state q, i.e. q[u] ∈ V(u). A state q satisfies a propositional formula ϕ, written q ϕ iff ϕ holds when for each occurrence of u, the corresponding value q[u] ∈ V(u) is substituted. • Θ is the initial condition, a propositional formula characterizing the initial states of M. A state q ∈ Q is initial iff q Θ. • ρ is the transition relation defining the behavior of the FDS. It is a function ρ : Q → 2 Q that takes the current state q ∈ Q and produces a set of new states Q ′ ⊆ Q. Note that this formulation allows for nondeterministic transition relations by producing sets containing two or more states. If q ′ ∈ ρ(q) this is also written as q → ρ q ′ .
An FDS describes how the values of the variables in V change over discrete time. The concept of how time evolves and relates to real time is described in detail in Section 2.1.2. As an FDS proceeds from state to state, a sequence over Q is generated. In order to reason about the behavior of an FDS, we introduce the concept of a computation: Here |q| denotes the length of the sequence q: it is ℵ 0 if the sequence is infinite, and n for a finite sequence q = q 0 q 1 . . . q n . Thus, the length of a computation is the number of transitions made. We also introduce the concatenation of two sequences σ 1 = s 0 s 1 . . . s n and σ 2 = s n+1 s n+2 s n+3 . . ., where σ 1 must be finite, to be the sequence σ 1 σ 2 = s 0 s 1 s 2 . . ., i.e. concatenations of sequences are written just by concatenating the symbols.
We are only interested in reactive systems that maintain an ongoing interaction with their environment, hence only infinite computations will be considered. FDS's for which all maximal length computations are infinite are called nonblocking and are characterized by the additional requirement that in each state the transition relation allows the FDS to enter a next state: (NB) Nonblocking Property: ∀q ∈ Q . ρ(q) = ∅.
Moreover, any physical system has an initial state. To reflect this in our definition of an FDS, the following property is added: Definition 3. Define the (overloaded) operator V W : Q → V(W ) to map states to their corresponding valuations. That is, for a state q = (v, n) ∈ Q, V W (q) = v ∈ V(W ). If W in V W is understood from context, we simply write V.
The V-operator can also be used for sets, sequences and sets of sequences of states, mapping each element to its corresponding valuation. Moreover, V is used to map variables to their domains, so it is "overloaded" to yield the domain V(u) for a variable u. The sets of valuations of sets of variables V , X and Y are also defined using V as V(V ), V(X ) and V(Y).
Definition 4. The set of all finite nonempty sequences over a set S is denoted by S + , and the set of all infinite sequences over S is denoted by S ∞ .
Note that by (SP) all computations of an FDS M are nonempty, as M must have an initial state satisfying (C1). The set of infinite computations of an FDS M is then denoted by C(M) ⊆ Q ∞ , and the corresponding set of infinite sequences of valuations, called the language of M is V(C(M)) ⊆ V(V ) ∞ . To simplify notation, we denote the language of M by L M = V(C(M)). If X is nonempty, a change in the any of the environment variables in X requires a transition to be made. Since X is not controlled by the FDS, the nonblocking condition (NB) is no longer sufficient to ensure that there is always a valid transition available. The stronger requirement that in every state a transition is possible independently of the inputs is sufficient to ensure that an FDS always maintains an ongoing interaction with its environment. However, often this requirement is too strong for the specification to be realizable. This issue is addressed by introducing assumption/guarantee specifications in Section 3.1.3.
By moving from state to state, an FDS can represent the behavior of a microprocessor. While an FDS can be considered as the "program" running on the microprocessor, it abstracts away from any specific hardware model. As long as a microprocessor implements the behavior of an FDS, it is sufficient to reason about the FDS -the results will hold for the actual implementation as well.
Indeed, we will later show how to simulate an FDS and use this to test the synthesized implementations.
While the behavior of reactive systems can be accurately modeled using FDS's, only very basic reactive systems can be hand-coded in a manageable amount of time. In order to handle large systems, a high-level system specification language is used to describe the operation of an FDS. Synthesis from a correct high-level description yields a correct-by-construction controller in the form of an FDS. Correctness of a system can then be methodically verified in the specification language without having to explicitly reason about its semantics in the foundation logic.

Temporal Logic
Temporal Logic (TL) is a well-established formalism that can be traced back even to the ancient Greeks [32]. It has been formalized as Tense Logic by Prior in 1962 [79] and introduced as a formal specification language for reactive systems by Pnueli in 1977 [72]. A statement in propositional logic is interpreted to make a statement over the state at one given time (the present). However, with TL also statements about the past and the future can be made.

The Concept of Time
The natural concept of time is that it proceeds continuously and at a constant rate. In temporal logic, this concept of real-time is abstracted away in two ways.

REACTIVE SYSTEMS
Firstly, time in TL proceeds in discrete steps, that might be aligned to clock ticks or other external events. The present is considered to be at time zero. A propositional formula p just talks about the present: However, with a temporal formula , statements about several points in time can be made. For example, with the "always" operator, p we can express that p is an invariant over time (in the future): And with the "eventually" operator, ♦ p it can be expressed that the proposition p will hold at some unspecified future point in time: Other temporal operators express similar properties. Several forms of TL are in use, but here we only consider Linear Temporal Logic (LTL). It is called "linear" because LTL formulae are interpreted over sequences of states, where each point in time is associated with an element in the sequence. Thus for a sequence of states s 0 s 1 s 2 . . ., the element s 0 is said to occur at time zero, s 1 is said to occur at time one and so on. These times can be the ticks of a clock. However, there is no correspondence to a real-time axis, which is the second abstraction step. Thus only the order and perhaps the number of repetitions of states in a sequence has semantic significance.
After discretizing and abstracting away from real time, the "past", "present" and "future" get their meaning from the part of the sequence under consideration. A propositional formula talks about a particular instance in time, a past formula talks about (non-strictly) smaller time indices, and a future formula talks about (non-strictly) greater time indices. Time moves strictly forward, so the elements of a sequence are considered one after the other, without repetitions.
By interpreting the abstract time in our real-world notion of continuous time, it can be defined what it means to execute an FDS on a microprocessor. The processor clock generates a sequence of ticks t 0 t 1 t 2 . . . that trigger the transitions of an FDS. A clock-triggered FDS M is executed by starting in an initial state q 0 Θ at clock tick t 0 . Then, before every clock tick t i , i > 0, the current values x i−1 ∈ V(X ) of the input variables X are read from the environment's state and a transition is made from denotes the restriction to the variables in X . Note that the current values of the environment are only visible in the next state.

Syntax
The syntax of an LTL formula ϕ over the variables V is given by the BNF definition ϕ : where p is an atomic proposition relating a variable u ∈ V to a subset of its is a constant and is one of =, =, ≤, <, ≥ or >. For a boolean variable u, the atomic propositions "u = True" and "u = False" are abbreviated simply by u and ¬u respectively.
The operator is called weak next or just next and U is called strong until or just until. Next and until are called temporal operators, while ¬ and ∨ are called propositional operators. Other propositional operators can be defined in the usual way: A formula only containing atoms and propositional operators is called a propositional formula. The following additional temporal operators can be defined: The operator ♦ is called eventually, is called always, U is called weak until and ⊙ is called strong next. Additionally, the temporal past operators and can be introduced, which will be used in Section 3.2.1. However, it can be shown that past operators do not add expressivity [53]. A formula that contains no past operators is called a future formula, while a formula that contains only propositional and past operators is called a past formula. Operator precedence and associativity are summarized in Table 2.1.

Semantics
Let L(V ) denote the set of syntactically correct LTL formulae over the variables V , i.e. the language generated by (2.1). We now define a compositional semantics of LTL via the satisfaction relation between a tuple (σ, j) ∈ V(V ) ∞ × N 0 and an LTL formula ϕ ∈ L(V ). Since the semantics is defined over sequences of valuations V(V ), LTL formulae are not tied to a particular FDS with its corresponding state space Q. If two states q and q ′ correspond to the same valuation, i.e. V(q) = V(q ′ ), then there is no way to tell them apart in an LTL formula.
Given a finite or infinite sequence σ = s 0 s 1 s 2 . . . ∈ V(V ) ∞ ∪ V(V ) + and an index j ∈ N 0 , the relation is defined as follows: The semantics of the past operators and is given by The formula ϕ is said to hold at position j of the sequence σ ∈ V(V ) ∞ iff (σ, j) ϕ.
In this semantics ϕ means that if there is a next state, it satisfies ϕ. In contrast, ⊙ ϕ means that there exists a next state and it satisfies ϕ. If only infinite sequences are considered, these two operators are equivalent. In this thesis we will always use , since only nonblocking FDS's are considered that can always react to a well-behaved environment. Note also that for infinite sequences commutes with ¬ and distributes over binary propositional operators.
Further, ϕ U ψ means that ϕ holds until ψ holds, and ψ will eventually hold, justifying the name strong until. In contrast, ϕ U ψ does not require ψ to eventually hold (i.e. ϕ holds forever) and is therefore called weak until.
An FDS M is said to (initially) satisfy a formula ϕ ∈ L(V ) iff all sequences σ ∈ L M (initially) satisfy ϕ. A formula ϕ ∈ L(V ) is called (initially) valid for an FDS M iff every sequence σ ∈ L M (initially) satisfies ϕ. If M initially satisfies ϕ, or ϕ is initially valid for M, then this is written as M ϕ.
Specification: ϕ   A formula ϕ ∈ L(V ) is said to be (initially) valid iff all sequences σ ∈ V(V ) ∞ (initially) satisfy ϕ. If ϕ is initially valid, then this is written as ϕ.
An LTL formula thus can be seen as specifying a set of sequences that initially satisfy it. LTL is called "linear" because it can only make statements about paths along the transitions in an FDS.

Other Temporal Logics in Use
In contrast to the linear-time LTL, branching time logics such as CTL can make statements about entire transition trees in an FDS [21]. in particular, this includes nondeterministic choices. There are properties that can be expressed in CTL but not in LTL and vice versa. Both specification languages are subsumed in a more general temporal logic called CTL* [22]. Several other logics for specifying reactive systems exist. Some are tailored for hardware, others for software. Interval Temporal Logic makes reasoning about periods of time explicit [61]. Atomic propositions in LTL make statements about variables at one point in time, but in the Temporal Logic of Actions introduced by Lamport in 1994 atomic propositions can be made over changes in variables that are termed "actions" [51].

Model Checking and Deductive Proof Systems
In order to make use of specifications, it must be possible to determine whether a reactive system, in form of an FDS M, satisfies a given specification ϕ. Model checking determines whether ϕ is (initially) satisfied by M. The outline of this process is shown in Figure 2 Moreover, it is often useful to prove properties about a specification, without even considering the reactive system it will be applied to. Deductive proof systems require an LTL specification ϕ to be supplied and will attempt to derive whether ϕ holds independently of a particular FDS, i.e. ∀M . M ϕ. This process is outlined in Figure 2.2.

Model Checking
In order to check the (initial) validity of an LTL formula ϕ over a fixed FDS M, a model checker can be employed. The model checker in Figure 2.1 is provided with ϕ and M and returns true if 3 all sequences σ ∈ L M in the language of M, (initially) satisfy the specification ϕ. The techniques and algorithms for model checking are manifold and can be found for example in [18]. In this example, the partition of V into X and Y is not relevant, and we may (rather arbitrarily) choose to have X = ∅ and Y = V . The arrows represent the transition relation: There is an arrow from a state q to a state q ′ iff q → ρ q ′ . There is an arrow without a source to a state q iff q Θ. Then, model checking could for example establish that the following specifications hold for this FDS: Model checking can also be useful when synthesizing an FDS from its specification. First, the correctness of the synthesis can be verified. Also, if the synthesis algorithm does not support a particular specification (e.g. the until operator, U is not supported by the synthesis procedure we are using), then it can still be verified post-hoc whether the unsynthsesizable properties are satisfied by the resulting FDS, even though not taken into account explicitly during synthesis.

Sequent Calculus for LTL
Sequent calculus is a deductive proof system that allows to prove tautologies in the specification language independent of a particular FDS. Proofs can even be automated up to a certain extent, e.g. using tools such as Isabelle [64].
This can be employed for example to prove the equivalence of LTL formulae, allowing for simplifications and translations between syntactic forms. Also, when modeling assumptions on the environment, it may be proved that they are satisfiable, avoiding the "false implies everything" problem. However, the satisfiability problem for the fragment of LTL that we consider is PSPACE complete, and is NP complete for the fragment of LTL supported by the synthesis procedure that we use ( [84], Figure 3, see the entries for L(F, X) andL(F, X) respectively).
Sequent calculus for LTL allows to derive temporal formulae by applying axioms and transformation rules [32]. A temporal formula ϕ that can be derived in such a way is called a theorem, written ⊢ ϕ. The proof system consisting of axiomatic sequents and rules should be sound, meaning that it is only possible to derive valid LTL formulae. Thus the soundness of a proof system can be expressed by the implication ⊢ ϕ ⇒ ϕ. It is also desirable that the proof system is complete, meaning that it is possible to derive all valid formulae. This can be expressed by the implication ϕ ⇒ ⊢ ϕ.
Theorems can be derived by purely syntactic means using sequent calculus [12,29,32]. This establishes a set of rules to derive theorems. Usually these rules are applied backwards, starting at the theorem to be proved and working towards axioms such as ⊢ True.
The modus ponens is an example of a sequent calculus rule: This rule says that q can be derived by first deriving p ⇒ q and p separately. Both p and p ⇒ q must be similarly derived by rules in the sequent calculus, until one arrives at axioms such as the already presented one.

Synthesis
Synthesis is the automatic construction of programs and (digital) designs from logical specifications. It has been investigated already since the 1960's for example by Church, Büchi, Landweber and Rabin. The choice of the synthesis algorithms depend on which specification language is used. For example, synthesis of open reactive systems from LTL has been considered by Pnueli and Rosner in 1989 [75], and again by Piterman et al. in 2006 [71] and Klein and Pnueli in 2011 [39].
Other specification languages have been considered. So far, synthesis from branching time logic is impractical, as the general problems of synthesis from CTL and CTL* specifications are in the complexity classes 2EXPTIME and 3EXPTIME 4 respectively [49], and to our knowledge, no methods are available that perform better on a reduced set of specifications, although an interesting approach is suggested by Antoniotti and Mishra [4]. Synthesis of open controllers from Probabilistic CTL [3,7] is in NP ∩ co−NP [16].
We consider the synthesis problem to be to find an FDS M that initially satisfies a given LTL specification ϕ, i.e. ∀σ ∈ L M . σ ϕ. This is shown in Figure 2.4, where the synthesizer is only provided with the specification.
Typically, synthesis is preceded by deciding realizability of the LTL specification, which amounts to checking whether there exists an FDS M initially satisfying ϕ, see Figure 2.5.

Game Theoretic Approach
We use the synthesis tool by Piterman et al. [71] which solves the synthesis problem by viewing it as the solution of a two-player game. The synthesized FDS is the controller of the system and acts against its adversary, the environment. The output variables of the FDS directly control the system and thus it is viewed as part of the system. The game is then between the controller and the environment with the utility function being formulated in terms of the behavior of the system: The goal of the game for the system is to satisfy its specification, which the environment tries to prevent. For an introduction into game theory see for example the book by Nisan et al. [65]. Consider the FDS M in Figure 2.6. It represents the synthesized controller with inputs X (the environment variables) and outputs Y (the system variables). The environment and the controller are allowed to influence exclusively the environment and system variables respectively. From the point of view of the controller, these can be seen as the measured state of the system and the inputs to the system respectively. Thus the controller can "react" to its observed changes in the environment variables by changing the system variables.
The controller and the environment are taking turns in the game. Due to the adversarial nature of the environment it is assumed to always take the worst possible move evaluated against the utility function of the controller. The environment is also thought of as having perfect knowledge about the controller's state and strategy, i.e. its transition relation. However, the controller only knows the current observable state of the environment, and possibly the history of environment states that the controller has stored.
The utility function of the controller can only take one of two values, corresponding to satisfying and violating its specification. The synthesis procedure therefore tries to find a winning strategy for the controller, implemented as an FDS, that maximises this utility by ensuring that the specification is never violated. Such a winning strategy only exists if the specification is realizable. The possible solutions are equilibria in which both the controller and the environment cannot improve their outcome by changing their respective strategy (i.e. Nash equilibria). However, these strategies are by no means unique, and thus several FDS's implement the same specification.

Closed and Open Systems
A system that does not interact with its environment is called closed. The computations of such a system do not depend on the environment, and therefore this is modelled by having an empty set of environment variables X . A system that generates its inputs nondeterministically by itself can also be regarded as a closed system.
In contrast, a system interacting with its environment is called open. This is modelled by having a nonempty set of environment variables X . For the system to be open it is necessary that it does not control its environment, in the sense that it cannot directly influence its environment variables.
For the synthesis of an open system, it is irrelevant how the variables in X are controlled -they might be controlled partially or entirely by another FDS as shown by P in Figure 2.7. However, all the variables that are not controlled The controller M with its environment, P. Note that P does not need to be an FDS.
by the system are considered to be part of one single environment. One way to close an open system, which is necessary for simulation (see Section 5.1.1), is by synthesizing an FDS (or a set of FDS's) obeying the environment assumptions and connecting it to the system. This is explained in detail in Section 2.3

Computational Considerations
Synthesis of LTL formulae for general specifications is 2EXPTIME-complete [71]. However, for a subset of assume-guarantee specifications called Generalized Reactivity [1] (GR [1]), synthesis can be performed in cubic time in the number of conjuncts in the specification and in the number of possible valuations of the system and environment variables (Theorem 1, [71]). GR [1] formulae are explained in detail in Section 3.1.4.
While the implementation of an FDS would typically be run on an embedded processor with lower computational power, a high-performance computer can be used for synthesis. Thus, efficiency of executing an FDS is often more important than how much time and memory it takes to synthesize. Once an FDS is loaded into memory, transitions can be performed in O(1) time.
One of the main considerations is therefore the space requirements of the synthesized FDS. The larger the state space, the more memory is required for storage. In the worst case, the space requirements grow quadratically with the size of the state space. This is the case when the graph representing the FDS's transition relation is dense, i.e. when there are transitions between almost any two states. Sometimes this can be alleviated by strengthening the assumptions on the environment, since then the transitions can be removed that are precluded by the assumptions, and would never be taken under correct execution.
Note that if an environment variable changes so that no transition is available, the FDS blocks. This can only be the case if the environment assumptions are violated, and so the specification still holds even in that case. While this is important to be able to reduce the amount of available transitions during synthesis, such behavior of course is not useful in practice.

Synthesis Software
The synthesis tool used in this thesis is based on the work by Piterman et al. [71]. Synthesis of an LTL specification proceeds in several steps.
First, a Game Structure is constructed from the specification, separating the initial conditions, the formulae specifying the transition relation, and the formulae for the game's goals. Then, the realizability of the specification is checked by solving a µ-calculus formula [45] that corresponds to the Game Structure [38]. This can be done by the Temporal Verification System (TLV), a software tool for computer-aided verification [78]. Once the µ-calculus formula has been successfully solved (which can only be done if the specification is realizable), the intermediate values from the solution process can be used to construct an FDS satisfying the specification, which is again done by invoking TLV. Piterman et al. describe the details of these back-end activities [71].
The front-end that we use is TuLiP, a Python-based software toolbox for the synthesis of embedded controllers developed by Wongpiromsarn et al. [91]. Given an LTL specification, it provides the appropriate inputs for the synthesis to TLV. Its backend is based on JTLV, a Java-based implementation of TLV [77]. TuLiP supports the synthesis of FDS's from GR [1] specifications. This restricts the set of realizable formulae to those that are in this particular syntactic form. Also, the JTLV backend works with Binary Decision Diagrams that sometimes cannot resolve formulae that are in the form ♦ p.
The specifications that we develop in this thesis were encoded into the appropriate format for TuLiP to process them. TuLiP is then invoked simply by Python function calls.

Compositional Synthesis
In the previous section, the synthesis of a GR [1] formula into a single FDS has been considered. In this case, the synthesis is based on a two-player game of the system against the environment. However, it may sometimes be necessary to synthesize several reactive systems that together satisfy one global specification ϕ. This is called compositional synthesis. It is required when several players need to coordinate with each other in order to "beat" the environment.

Motivations for Compositional Synthesis
An FDS represents the program of a physical or logical entity. For example, an FDS might be executed as a thread on a processor. If there are several FDS's that are connected with each other, they are also called components.
The connections between the components are described by an architecture, which is formally defined in Section 2.3.3. When considering one component in the architecture, all other components will be called its peer components or simply its peers.

COMPOSITIONAL SYNTHESIS
Specification: ϕ  The specification ϕ provided to the synthesis procedure is an LTL formula over variables in some set V which is partitioned into X and Y, the global environment variables and the global system variables respectively. Synthesizing a single FDS means that all system variables in Y can be freely manipulated without any constraints. If there are several components, then the components may only manipulate disjoint subsets of Y. This avoids inconsistencies by allowing each variable in Y to be manipulated by at most one component. However, each variable in V may be read by several components.
A specification ϕ need not refer to all variables in Y. It might be necessary to introduce additional variables that are only relevant locally to the individual components (cf. Section 2.3.5) in order to implement communication protocols between the components. Such protocols are of no concern in the global specification and hence are abstracted away. Still, it is necessary that these additional variables are treated as system variables, and thus are in the set Y.

Game Theoretical Approach
Compositional synthesis can be seen as solving a multi-player game by finding a set of strategies that obey both the game's rules (the global specification) and the topology of communication (the architecture). The players should cooperate with each other in order to beat an adverse environment.
Synthesizing such cooperative strategies is hard and in general undecidable [76]. Another way to approach this problem is to recast it into a set of two-player games in which each component acts against all other components and the environment. Since cooperation can be achieved by negotiating according to predefined protocols, the set of realizable global specifications is limited.
Negotiation is part of a strategy and thus can be treated using the same kind of specifications as in the rest of the strategy. It is required to establish cooperation patterns such as deciding which robots should rescue a target and which ones should keep searching. When synthesizing strategies for multiple two-player games, the negotiation channels, i.e. who negotiates with whom and for what, must be explicitly encoded in each component's specification. This limits the scope of negotiation, but will lead to a substantial reduction of the state space. This is because the components can make local decisions that together satisfy the global specification, and thus lead to the system maximizing its utility. This is ensured by decomposing the specification appropriately before synthesis. Thus the decomposition into multiple two-player games is not done by the synthesis procedure, as, in fact, this would still be undecidable.

Computational Considerations
The two main considerations in compositional synthesis are realizability and the size of the state space. A specification might be realizable for a single FDS, but not for a distributed architecture. This results from the restrictions on which variables can be controlled by each individual component, which may severely limit the extent of coordination between the components that can be mustered to beat the environment.

State Space Reduction
Compositional synthesis is a reasonable approach to the state space explosion If m is small enough, this can result in fewer states per component. However, if each component receives full information about the state of each of its peers, m has to be large and this might cause even more states in each component. This is because in this way each component has full global information and additional variables are required for reliable transmission, and hence the decomposition does not result in a reduction of the state space. By fixing negotiation patterns, it is actually possible to satisfy the global specification by using only local information.
Therefore, it might sometimes be desirable to decompose an FDS even if no physical communication restrictions are present. In fact, this might be the only way to practically synthesize a specification within reasonable time and for a given amount of memory.

Realizability
When reasoning about the realizability of a specification in compositional synthesis, the required architecture has to be taken into account. The architecture imposes constraints on the variables that each component can manipulate and thus not all global system variables can be arbitrarily influenced, as is the case in a centralized design.
Realizability of a specification depends primarily on the architecture and how the components communicate. If the architecture is in form of a "pipe", i.e. a purely serial interconnection in which only the first component receives inputs from the environment, then realizability can be decided. However, even for architectures not much more complicated, for example those involving feedback, realizability is undecidable [56,76].
That does not mean that no feedback communication is realizable, but that no algorithm can be expected to decide realizability for any given specification and architecture. By performing the decomposition into specifications satisfying the architecture before synthesis, many global specifications can be realized, even if distributed synthesis of the global specification is undecidable.

Architectures
Compositional synthesis requires not only a global specification ϕ, but also information on how to split up the tasks between the players and their means of communication. This is captured by an architecture A . The synthesizer therefore gets both the specification ϕ and the architecture A , and outputs a whole set of FDS's M = {M 1 , M 2 , . . .} that together satisfy the specification and the architecture. This is illustrated in Figure 2.8.
where I ⊆ N is a finite set, indexing the components, for which the following restrictions hold: , all variables in the architecture are global.
, no variable is controlled by more than one FDS.
The sets X i and Y i represent the environment and system variables respectively of each FDS in M. Still, each component may have some of its environment variables controlled by the global environment, and some by peer components. The variables controlled by the global environment will be denoted E i ⊆ X i . The environment variables of a component M i controlled by its peer M j will be denoted by T i,j and are called transmission variables. 5 Given an architecture, the state variables are V = i∈I (X i ∪Y i ), the global environment variables can be obtained from X = i∈I X i \ i∈I Y i , and the global system variables The variables in S i are controlled by M i and represent the system variables that are relevant in the global specification.
and symmetrically

Composition
An architecture merely describes the connections between the individual components. As stated above, compositional synthesis has to produce a set of components that satisfy both the architecture and the global specification ϕ. So far, we have only defined what it means for a single FDS to satisfy its specification. Therefore a formal description of the behavior of a set of components is required. The idea is to compose the FDS's in M into one larger FDS M that generates computations over the variables V . This FDS is called the composite FDS.
In a synchronous composition, the FDS's proceed in lock-step, i.e. they all make a transition at the same time. This would be reflected by the composite FDS M making a transition if and only if all FDS's in M make a transition.
Considering that typically each FDS is executed on an individual processor, this requires their clocks to be precisely synchronized and communication to be implemented with negligible latency. These assumptions can usually not be satisfied in practice, but still this form of composition is often a topic of theoretical interest [20,76].
Instead, in an asynchronous composition the execution does not have to be in lock-step and therefore no synchronization is required. Communication is still assumed to be with negligible latency, but this can often be relaxed when adapting the local specifications accordingly. The composite FDS M then proceeds even if only a single FDS in M makes a transition. 6 In order to simplify notation, the following definition of an asynchronous composition is only stated for two FDS's, but it can easily be extended for an arbitrary number of FDS's.
The asynchronous composition of the FDS's where the transition relation is a function ρ : Note that in order to model asynchrony, the values of the transmission variables T 1,2 and T 2,1 are only equated between q 1 and q 2 in a transition of M 1 and M 2 respectively.
The asynchronous composition is in this thesis also referred to simply as composition. Composition is both associative and commutative. That is, and M 3 with appropriate environment and system variables. Thus, the parentheses are usually dropped and an arbitrary (finite) number of components can be composed to obtain a composite FDS.
Defining the composition of FDS's to be an FDS in its own right has one major advantage: Since LTL specifications are statements over sequences, the global specification ϕ can directly be used to make statements about the composition. For example, for the composite FDS M = M 1 | M 2 | · · · | M n , the statement M ϕ is already defined to mean that ∀σ ∈ L M1 | M2 |··· | Mn . σ ϕ.
The definition of an architecture allows some variables to be system variables of one component and environment variables of its peers. These transmission variables are used in communication protocols and the behavior of the composite FDS M depends on when a change in these variables is seen by the peer components.

Decomposition
Distributed synthesis is based on a single global specification ϕ and an architecture A . The specification describes how the asynchronous composition of all components in the architecture has to behave, but makes no explicit statements about the behavior of the individual FDS's.
The compositional synthesis problem is to find a set of FDS's so that their asynchronous composition satisfies the global specification. If the architecture defines decoupled or weakly coupled components (i.e. there are no or few transmission variables), this can be done without introducing too many additional states in the synthesized components. Since general compositional synthesis is very hard and might even be undecidable, compositional synthesis algorithms are typically built around the synthesis of a single FDS from its local specification. A separate decomposition algorithm is used to obtain the FDS's satisfying A from the global specification.
Two principal approaches for decomposition exist: In postdecomposition, the global specification is synthesized into a single FDS which is then decomposed according to the architecture (see Figure 2.10). In predecomposition, the global specification is decomposed first into several local specifications that are then synthesized separately (see Figure 2.11). Both post-and predecomposition require the resulting synthesized components to satisfy the architecture.
The approach that is adopted in this thesis is predecomposition. Let ϕ be the global specification, and A be an architecture. A set of local specifications {ϕ i | i ∈ I} is a predecomposition of a global specification ϕ iff any set of FDS's M = {M i | i ∈ I} that satisfies the architecture A and for which M i ϕ i for all i ∈ I, the asynchronous composition M 1 | M 2 | · · · | M n satisfies the global specification ϕ. That is, the local specifications ϕ 1 , ϕ 2 , . . . , ϕ n must satisfy

COMPOSITIONAL SYNTHESIS
Architecture: A FDS's: Local Specifications: FDS's: The decomposition of a global specification into such local specifications is discussed in Section 3. To our knowledge no general systematic approach has yet been developed. The undecidability of compositional synthesis for almost all architectures makes a fully automated approach unlikely. This is why in the next chapter we develop approaches to manually decomposing the global specification. While we consider the restrictions imposed by the architecture on the global system variables that occur in the global specification, the architecture may be enhanced with additional transmission variables if this is needed.
The reactive controllers of the SAR robots decide on the actions of the robots in order to find and rescue the targets. As described in Section 2.2.1 and Section 2.3.1, the controllers are thought of as players in a game that is subject to a set of rules, has a goal and an initial configuration, similar to a board game. However, board games are usually described informally in prose, which is prone to ambiguities, contradictions and omissions.
Instead, formal specifications can be used to precisely describe the behavior of software and hardware systems [11,33,82]. The two most common scenarios are to use the specification to verify a given system (see Model Checking in Section 2.1.3) or to synthesize a system that satisfies a specification by construction (see Section 2.2).
A specification language should facilitate the development of specifications satisfying the following requirements [74]: Incremental Modification Once a specification is finalized, it should be easy to add another requirement, or relax an existing one.
Consistency There should exist at least one system that can actually satisfy the implementation. This property does not, however, state that such a system can be found in a straightforward manner.
Completeness A specification should include all important properties the system has to satisfy.
Validation From a specification, it should be possible to check whether an implementation satisfies the designer's intentions. This is not the same as verification, since an implementation that satisfies a formal specification might still not do what the designer wants. Validation is an informal process, and so the specification language should be semantically closely related to the specification-relevant subset of natural language.
Scalability The specification language should be suitable for large systems.
Incremental modification, consistency and validation are all viable in LTL. However, the completeness of an LTL specification is very difficult to verify, which also restricts the scalability of specifications. Notwithstanding these limitations, LTL has become a common way to express properties of reactive systems. We therefore investigate how to use LTL as a specification language for controllers that fit into the game-theoretic paradigm, as well as taking into account the input-to-output characteristics of standard controllers.
A specification for an FDS M = (V, X , Y, Q, Θ, ρ) is an LTL formula ϕ ∈ L(V ) over the variables V . Similarly, a program then satisfies the specification if ϕ is valid for any FDS M describing the program. Note that there might be several FDS's describing the same program and vice versa.
A property over the variables V is a subset of the sequences in V(V ) ∞ . An LTL formula ϕ ∈ L(V ) then expresses the property {σ ∈ V(V ) ∞ | σ ϕ}. Not every property can be expressed by an LTL formula, since the properties expressible by LTL are countable, but the set of all properties, 2 V(V ) is not. 1 Also, the expressivity of LTL is limited by the (bounded) nesting depth of the next operator [48].
Since we are only concerned with properties expressible in LTL, we use the terms property and formula fairly interchangeably if the context is clear. Also, given a formula ϕ, the corresponding property can be found by forming the set In this and the following chapters, intervals of integers are denoted in the following way: Often, integer variables are used to represent data storage. To represent that a storage is empty, the integer −1 may be used. For better readability we use ǫ as a synonym for −1, and so the intervals [ǫ, n) and [ǫ, n] are the same as [−1, n) and [−1, n].

Classification of Formulae
Specifications for reactive systems typically consist of both safety and liveness formulae. This classification was first introduced by Lamport in 1977 [50]. Later, Manna and Pnueli gave an entire taxonomy in the form of a "hierarchy" to classify different formulae [57].
This classification also contains elaborate formulae such as assumption/guarantee (A/G) and GR [1] specifications, which are introduced in Section 3.1.3 and Section 3.1.4 respectively. One important attribute "orthogonal" to the classification between safety and liveness is whether the sequences satisfying a formula are invariant under finite repetitions of elements, which is discussed in Section 3.1.5.

Safety and Liveness Properties
Informally, a safety property states that "nothing bad will ever happen." In the specification of control systems, safety properties ensure that constraints are never violated. A formula ϕ S expressing a safety property then states that all finite prefixes of a computation σ satisfy some propositional formula p.
According to Sistla [83], ϕ S is a safety formula iff all sequences σ for which all finite prefixes can be extended to an infinite sequence satisfying ϕ S , satisfy ϕ S . Denoting the set of finite prefixes of a sequence σ by pref (σ), this statement can be written as Any safety formula can be written in the form p, where p is a past formula.
Deciding whether a given set of sequences is a safety property is PSPACEcomplete ( [83], Theorem 5.5). However, it has been shown that safety formulae are closed under ∧, ∨, , U and ( [83], Theorem 3.1). Of course, then safety is also preserved under weak until U, but not necessarily under strong next ⊙ for finite sequences. These syntactic properties provide an efficient way to decide whether a given formula expresses a safety property.
A liveness property states that "something good will eventually happen." Therefore, a liveness formula ϕ L expressing a liveness property requires that every finite squence σ can be extended to satisfy ϕ L . That is, if σ ϕ L then there exists a possibly infinite sequenceσ so that the concatenation of the two sequences σσ satisfies ϕ L . Formally, ϕ L is a liveness formula iff Liveness formulae are necessary in the specification of reactive control systems in order to ensure that the controller maintains an ongoing interaction with its environment. If no liveness formula is included in a specification then it can be satisfied by sequences consisting only of the initial state (or a finite number of states.) This becomes an issue when synthesizing an FDS from such a specification not containing a liveness formula, since the synthesis algorithm will try to generate the simplest possible FDS, which does not need to be nonblocking in this case.

Derived Classes
Several important and widely-used classes can be derived from the safety and liveness classification [57,90]. We present these classes using past formulae p and q. However, since we only consider future formulae for synthesis, p and q are propositional formulae (which are both past and future formulae).
A guarantee formula is of the form ♦ p. It is therefore a liveness formula and expresses that the system must eventually satisfy the formula p, e.g. termination in a total correctness specification of a program.
An obligation formula is a combination of safety and liveness formulae of the form p ∨ ♦ q. Such formulae can specify the behavior in exceptional circumstances. For example, ¬p ∨ ♦(p ↔ q) ensures that either the exception p never happens and if it does, it is handled correctly by q.
The class of obligation formulae strictly contains the safety and liveness formulae and so a general obligation formula cannot be specified by either a safety or a liveness formula. Every boolean combination of safety and guarantee formulae is an obligation formula.
A progress or recurrence formula is of the form ♦ p and expresses that p has to be satisfied at infinitely many positions. If p is a propositional formula, then a progress formula is a liveness formula. However, if p is allowed to be any past formula, then the class of progress properties is strictly greater than that of obligation, safety or liveness properties.
A response formula is of the form (p → ♦ q) and ensures that the formula q will hold at some point in the future whenever p is satisfied. Response formulae are progress formulae, and if both p and q are propositional formulae then they are even liveness formulae, since they ensure that q is always asserted as a reaction to p.
A stability or persistence formula ensures that once a proposition p holds, it will never be violated in the future. Such a formula is of the form ♦ p. It can be understood as requiring the system to enter into a stable state characterized by p, and remaining there. The class of stability properties is strictly larger than the class of obligation, recurrence and persistence properties.
A reactivity formula is of the form ♦ p ∨ ♦ q and is a combination of a progress and a stability formula. The class of reactivity properties is strictly larger than any of the abovementioned classes. An even larger class of properties is that of the general reactivity properties, which contains sequences satisfying finite conjunctions of reactivity formulae. Thus a general reactivity formula is of the form n i=1 [ ♦ p i ∨ ♦ q i ] where p i and q i are past formulae. Every formula specifiable in LTL can be expressed as a general reactivity formula [57].
The format of general reactivity formulae gives the idea for the classification of GR [1] specifications introduced below in Section 3.1.4. Since every LTL formula is expressible as a general reactivity formula, also GR [1] formulae are surprisingly expressive, even if the restrictions imposed on p i and q i are quite severe.

Assumption/Guarantee Specifications
When synthesizing open controllers from LTL specifications, a two-player game is considered, in which the controller plays against an adversarial environment. The controller tries to win by satisfying its specification while it assumes that the environment always tries to falsify the specification with the moves it is allowed to make.
Since the environment is considered to be adverse, it may always do the worst possible move from the controller's point of view, open controllers cannot be expected to satisfy their specification in all environments. An open controller interacts with an environment it cannot influence, so the assumptions it has about the environment do not actually constrain the environment. The controller cannot prevent the environment from violating the assumptions but in this case it is allowed to also violate its goals.
The synthesis procedure only supports the synthesis of an FDS satisfying a single specification ϕ, without any explicit assumptions on the environment. However, since the environment and system variables play different roles in the synthesis algorithm, the specification ϕ can be written in a format that makes explicit what is assumed of the environment and what is guaranteed by the controller.
Let ϕ e be the environment assumptions, i.e. the formula describing exactly what the system may assume about the environment. Let ϕ s be the system goals, i.e. the specification that the controller is supposed to satisfy given that the environment satisfies its assumptions. It is then sufficient for the synthesized FDS to satisfy the specification ϕ e → ϕ s . Such a specification is called an assumption/guarantee specification (A/G specification for brevity,) and was first introduced by Misra and Chandy in 1981 [60]. The controller is implemented to satisfy ϕ s given ϕ e , but has no knowledge about the actual implementation of the environment. It cannot assume that an actual FDS is controlling X according to ϕ e . If there was such an FDS, ϕ e would never be violated, so it would not be necessary to even include it in the original specification. In contrast, the system only needs to satisfy ϕ s as long as the environment satisfies ϕ e and if ϕ e is violated, the system is allowed to exhibit any behavior.
A/G specifications are mainly used to specify open controllers that communicate with each other. The environment assumptions of components that communicate with each other can be thought of as specifying a communication protocol. A component assumes that its peers comply with the protocol, and only if this is the case is it required to also satisfy the protocol itself. If the environment violates the protocol, the component also is not required to be able to satisfy it.

GR[1] Specifications
A/G specifications are very useful in defining open reactive systems. However, since we are concerned with synthesizing FDS's from their specifications, the class of formulae that we can use is restricted by the capabilities of the synthesizer. Thus, even a realizable specification (i.e. one for which an FDS exists) might not be synthesizable.
Synthesis of general reactivity formulae is 2EXPTIME-complete [76], but there exist smaller classes of formulae that can still express a large class of useful properties but exhibit better computational complexity for synthesis. The class of A/G formulae supported by the JTLV synthesizer is called Generalized Reactivity [1] (GR [1]). Synthesis and checking realizability of such formulae can be done in polynomial time, see Section 2.
where the superscripts e and s stand for the environment assumptions and the system goals respectively. A GR [1] formula thus states that only if some assumptions on the environment ϕ e = ϕ e init ∧ ϕ e t ∧ ϕ e g are satisfied, then it is required that the controller satisfies the specification ϕ s = ϕ s init ∧ϕ s t ∧ϕ s g . In particular, if the environment violates ϕ e , then no restrictions on the controller apply. Moreover, once a safety property is violated, it cannot be satisfied in any future state.
In the above definition, ϕ e init and ϕ s init are propositional formulae over X ∪ Y and characterize the initial states of the environment and the controller respectively. Synthesizing an FDS from a GR [1] specification will determine the initial condition Θ, assuming that the environment initially satisfies ϕ e init . Since by the startup property (SP) each FDS has an initial state satisfying Θ, it is necessary Further, ϕ e t and ϕ s t are safety formulae of the form i∈I B i , where B i is a boolean combination of atomic propositions p over variables in X ∪ Y and of expressions of the form p, where p is an atomic proposition over variables in X for ϕ e i and over variables in X ∪ Y for ϕ s i . With this part of the GR[1] formula it is possible to constrain or force transitions of an FDS by using the next operator. Note however, that in the environment assumptions nothing can be said about the next values of the system variables Y.
Lastly, ϕ e g and ϕ s g are liveness formulae of the form i∈I ♦ B i where the B i are propositional formulae over variables in X ∪Y. These properties can be used to ensure that the controller is not idle as long as the environment is making transitions.
While GR [1] formulae might seem restrictive at first sight, they allow the expression of many useful properties of reactive systems. Let be a formula composed of safety, guarantee, obligation, progress, response and stability formulae, where p k,j , q 3,j and q 5,j are propositional formulae over the variables in V . Further, let be a formula composed of safety and progress properties, where p k,i are propositional formulae over the variables in X , and let φ init be a propositional formula over V . It has been shown that any formula of the form (φ init ∧φ e ) → φ s can be translated into a GR [1] formula ( [90], Proposition 1). For example, a response property (p → ♦ q) that has to be satisfied by the system can be translated into a GR [1] formula by introducing an auxiliary boolean variable t and letting The variable t is called a trigger, because it triggers q to be asserted eventually. The trigger is asserted as long as there is no obligation to assert q. Thus, when t is lowered, the system must assert q. Initially, "t = True" holds unless p ∧ ¬q, the only case in which there is an obligation to eventually raise q. The three conjuncts of ϕ s t ensure that t is only changed appropriately. (((¬t ∨ p) ∧ ¬q) → ¬t) ensures that t is lowered when p is asserted but q is not, and that t stays low as long as "q = False" holds. The formulae (¬t ∧ t → q) and (t ∧ ¬t → p) ensure that the trigger is only raised when q is high and lowered only when p is high. Finally, the progress formula ϕ s g ensures that the system will always eventually reach a state where it is no longer under an obligation to raise q.

Stutter-Invariance
Stuttering is a phenomenon connected with the repetition of states in the computations of an FDS. Two sequences a = a 0 a 1 a 2 . . . and b = b 0 b 1 b 2 . . . are said to be stutter-equivalent if there exist two infinite sequences of strictly increasing indices 0 = i 0 < i 1 < i 2 < · · · and 0 = j 0 < j 1 < j 2 < · · · such that for every k ≥ 0, the sequences [69]. An LTL formula ϕ is stutter-invariant if for any two stutterequivalent sequences a and b, either both a ϕ and b ϕ or both a ϕ or b ϕ. 2 Informally, if a sequence satisfies a stutter-invariant formula, the same sequence with any element duplicated any number of times also satisfies the same formula.
Stutter-invariance can be an important feature of specifications of an FDS. In a clock-triggered FDS, at each clock tick the values of the environment variables are read, and the next state is selected so that the environment variables have exactly these values. However, it might be the case that the values of the environment variables have not changed from one clock tick to the next. This is called environment stuttering.
In an asynchronous composition of several components, it is possible that one component proceeds more than once while all its peers as well as its environment stay in the same state. The inputs are observed to be repeated. When the

CLASSIFICATION OF FORMULAE
components are executed on different processors or as different threads on the same processor, this situation occurs naturally from thread scheduling, different clock speeds and clock rate drift [44].
A clock-triggered FDS must therefore be invariant to environment stuttering, requiring the environment assumptions to be stutter-invariant. However, even if the system goals are stutter-invariant, the synthesis algorithm always tries to minimize system stuttering, since this would increase the state space.
Peled and Wilke have shown that stutter-invariant properties in (future) LTL are exactly those that can be expressed without the next operator (i.e. the only allowed temporal operator is the until operator) and that stutter-invariance is decidable ( [69], Lemma 2 and Corollary 6). Moreover, PSPACE methods exist for determining stutter invariance [70].
To obtain stutter-invariant environment assumptions, it is therefore sufficient to avoid the next operator. However, the synthesis method used in this thesis only supports the temporal operators always, eventually and next. Since the until operator is not supported, it is sometimes necessary to express formulae using the next operator. However, careful construction of these formulae might still render them expressible without the next operator.
For example, consider the formula expressing that x may only be cleared if y is asserted in the next state. This is a synthesizable property as it can be included in either ϕ e t or ϕ s t in a GR [1] specification. Moreover, it can be expressed without using the next operator 3 by and is therefore stutter-invariant.

Specification Example
In order to illustrate the specification concepts above, a toy example is presented. A GR [1] specification is given that is synthesized by TuLiP into an FDS.
The controller has one boolean environment variable x and two boolean system variables y 1 and y 2 . First the guarantee part of the specification is given. The system should start with both y 1 and y 2 cleared and then respond to an input x by raising y 1 : This can be translated into a GR [1] formula by the method shown in Section 3.1.4. Note that this will introduce another boolean system variable, called a trigger that we denote by t in this example. We demand that y 1 may only be raised if y 2 is high. This is expressed by the guarantee To prevent y 2 from being raised arbitrarily, x is required to be cleared as a prerequisite: This specification consisting of just these three guarantees is unrealizable. This is because x might be asserted initially, requiring y 1 to be raised eventually. But if the environment never clears x, then y 2 cannot be raised, which is required for y 1 to fulfill the response formula.
In order to make the specification realizable, an assumption on the environment has to be included. Assuming that x is always cleared eventually turns out to be sufficiently strong. It is expressed by the progress formula ♦ ¬x.
The symmetric assumption that x will always be asserted eventually is included as well, because the environment should never just keep x low at all times: Thus, the complete GR [1] specification is This specification is synthesizable and gives rise to an FDS M ϕ with seven states, shown in Figure 3.1. Recall that the extra system variable t has been introduced as a trigger to express the response property as a GR [1] formula.
The initial states of M ϕ are all those for which ¬y 1 , ¬y 2 and ¬t hold (compare with the translation of the response formula into a GR [1] formula). The restrictions on the rising edges of y 1 and y 2 can be verified by tracing the corresponding arrows in the FDS. Thus (¬y 1 ∧ y 1 → y 2 ) is verified by noting that q 1 → q 2 and q 1 → q 3 are the only transitions for which ¬y 1 ∧ y 1 holds and that "y 2 = True " holds in q 0 . (¬y 1 ∧ y 1 → y 2 ) can be similarly verified.
The response property (x → ♦ y 1 ) is also satisfied, but only provided that both the environment assumptions ♦ x and ♦ ¬x hold. 4 To see this, consider all wvut pqrs states in which "x = True" holds: In q 6 , "y 1 = True" holds, so the property is immediately satisfied. In q 3 , there is a transition to q 4 which will satisfy the property. But there is also a self-transition that keeps "y 1 = False". However, since by ♦ ¬x the environment has to clear x eventually, this self-transition cannot be taken infinitely many times, and so q 4 must be entered eventually.
In q 0 , the same assumption ♦ ¬x forces M ϕ to eventually enter q 1 , but there "y 1 = False" still holds. However, using both ♦ ¬x and ♦ x, M ϕ must eventually enter either q 4 or q 6 , both satisfying "y 1 = True" and thus the response property holds.

Specifying Distributed Systems
As explained in Section 2.3, it is often necessary to synthesize a set of reactive systems that together satisfy a given global specification. Compositional synthesis requires both a global specification and an architecture. It has already been mentioned that compositional synthesis for almost all architectures is undecidable. In this section we present principles that facilitate designing synthesizable local specifications and reasoning about the composition of the corresponding components in the architecture in order to establish that the global specification is met.
We consider predecomposition, i.e. decomposing the global specification into several local specifications that satisfy the architecture before passing each of them to the synthesizer separately. The main challenge is to perform this de-composition in such a way that the asynchronous composition of the FDS's synthesized from the local specifications satisfies the global specification. It is therefore necessary to have a mathematically sound way of reasoning about the asynchronous composition of the components in an architecture. Neglecting accuracy at this stage would render the efforts in synthesizing correct-byconstruction controllers useless.
Several attempts have been made at providing tools for the decomposition and reasoning about the composition of specifications. Misra and Chandy were among the first to reason about the composition of A/G specifications [60].
Abadi and Lamport provide a formalism for reasoning about decomposing and composing A/G specifications in TLA [1,2]. In response to this, a purely syntactic formalism for LTL specifications was developed by Jonsson and Tsay [36], providing a stronger composition rule.

Composing Specifications
Before principles for decomposing specifications can be stated, it is necessary to introduce the necessary framework to reason about their composition. We present the preconditions that have to be satisfied for a set of local specifications to satisfy a global specification. For notational convenience, these conditions are stated only for two components, but the extension to more components is straightforward.
We present the Feedback Interconnection Refinement Rule stated by Ozay et al. [67]. It is a specific case of the Composition Theorem proved by Abadi and Lamport [2]. We employ this version because it uses LTL and GR [1] specifications, although it is not the most general composition rule available. The proof of Abadi and Lamport's theorem covers several pages but the simplified version by Ozay et al. is straightforward to prove by induction on the length of the computations of the relevant FDS's ( [67], see the proof of Proposition 3). However, they do not take into account that the environment assumptions have to be stutter-invariant for the rule to hold for an asynchronous composition. The Composition Theorem by Abadi and Lamport implicitly includes this assumption, since every property expressible in TLA is stutter-invariant.

Architecture
Let X and Y be the global environment and system variables respectively, i.e. the variables that occur in the global specification ϕ. These sets are necessarily disjoint, because the environment variables X cannot be controlled by any component which controls Y.
The local environment and system variables of the synthesized components M 1 and M 2 are then subsets of X ∪ Y so that even feedback between the components can be introduced (see Figure 2.9). Since all global system variables Y must be controlled by exactly one component, Y is partitioned over the two components. Thus, the system variables of M 1 are Y 1 ⊆ Y, and the system variables of M 2 are Y 2 = Y\Y 1 .
The environment variables of M 1 can consist of variables from the global environment, but also from the system variables of Symmetrically, X 2 ⊆ X ∪ Y 1 . In Figure 2.9, we would have E 1 = X 1 \Y 2 and T 2,1 = X 1 ∩ Y 2 and the symmetrical relations This choice of variables defines the architecture for which we now develop the specification format and the hypotheses for the composition rule.

Specification Format
Suppose that a global specification ϕ e → ϕ s is a GR [1] formula, where ϕ e ∈ L(X ) and ϕ s ∈ L(X ∪ Y). This is the specification that must be satisfied by the asynchronous composition of M 1 and M 2 .
Let ϕ e 1 ∈ L(E 1 ) and ϕ e 2 ∈ L(E 2 ) be stutter-invariant LTL formulae that will be part of the environment assumptions of M 1 and M 2 respectively. One of the conditions that these two formulae must satisfy is that any sequence σ that satisfies the global environment assumptions also satisfies both ϕ e 1 and ϕ e 2 . Thus Note that ∧ distributes over , so when verifying this property it can alternatively be shown that ϕ e → ϕ e 1 and ϕ e → ϕ e 2 hold individually.
In an asynchronous composition, the transitions of the components M 1 and M 2 may be triggered by two independent clocks and thus may react to changes in environment variables at different times. In particular, the transitions are not synchronized to the environment's changes of the variables it controls. It is therefore necessary for ϕ e 1 and ϕ e 2 to be stutter invariant so that (P1) is sufficient in an asynchronous composition of M 1 and M 2 .
The specifications ϕ e 1 and ϕ e 2 only allow to assume properties over the global environment variables X and not over the other component in the composition. We therefore introduce the safety formulae φ e 1 ∈ L(X 1 ) and φ e 2 ∈ L(X 2 ), called refinement formulae. They are added to the local specifications and so the environment assumptions of M 1 and M 2 become φ e 1 ∧ ϕ e 1 ∈ L(X 1 ) and φ e 2 ∧ ϕ e 2 ∈ L(X 2 ) respectively.
The intuition behind separating these assumptions is that the refinements φ e 1 and φ e 2 can also contain variables from Y 2 and Y 1 respectively, while ϕ e 1 and ϕ e 2 can only contain variables from X 1 \Y 2 and X 2 \Y 1 respectively. The refinements will thus make environment assumptions about a component's peers and will therefore somehow have to be satisfied by the system goals of the peers.
Let ϕ s 1 ∈ L(X 1 ∪ Y 1 ) and ϕ s 2 ∈ L(X 2 ∪ Y 2 ) be LTL formulae for the local guarantees. When these two specifications are satisfied by M 1 and M 2 respectively, they should together imply the global guarantee, that is We now also refine the guarantee part of the local specifications by the safety formulae φ s 1 ∈ L(X 1 ∪ Y 1 ) and φ s 2 ∈ L(X 2 ∪ Y 2 ). Thus the components M 1 and M 2 must satisfy their respective specifications: Note again that φ e 1 , φ e 2 , φ s 1 and φ s 2 are safety formulae and ϕ e 1 , φ e 1 , ϕ e 2 and φ e 2 are stutter-invariant.

Circular Reasoning
Including the system variables of the peer component in the refinement formulae gives rise to circular dependencies: M 1 only has to guarantee φ s 1 if its environment assumptions ϕ e 1 ∧ φ e 1 are satisfied. This requires M 2 to satisfy φ s 2 which in turn only has to be guaranteed if ϕ e 2 ∧ φ e 2 is satisfied. The circularity comes from φ e 2 requiring φ s 1 to be satisfied by M 1 (or symmetrically, φ e 1 requiring φ s 2 to be satisfied by M 2 ).
In order to establish sufficient conditions on the local specifications so that their composition satisfies the global specification, it is necessary to resolve this circularity. This is done by imposing the appropriate conditions on the refinement formulae φ e 1 , φ e 2 , φ s 1 and φ s 2 . We require that for any sequence σ satisfying the global environment assumptions ϕ e , if a prefix can be extended to satisfy the local guarantee part of one component, then the same prefix and the next element in σ still must be able to be extended to satisfy the local environment assumptions of the other component.
It is important to require that the prefixes of sequences satisfying the global guarantees can be extended to satisfy the local guarantees, because the components must be prevented from entering a "one-way street" in their computations. 5 Consider for example a sequence s 0 s 1 s 2 . . . = σ ϕ e and a prefix s 0 s 1 . . . s n =σ ∈ pref (σ) of σ that can be extended to satisfy φ s 1 , the local guarantee refinement of the component M 1 . That means that M 1 can make a finite number of transitions in order to satisfy φ s 1 . If M 1 is currently in state q n with V(q n ) = s n and it makes a transition q n → ρ1 q n+1 s.t. V(q n+1 ) = s s+1 then the requirement thatσ extended by the element s n+1 in σ can be extended to satisfy φ s 1 simply means that by choosing to make this transition, M 1 actually makes such a transition in the "right direction".
Also, the assumption must hold for one further element in the sequence, because it allows to prove properties about the transition from one state to the next in a component without needing to assume anything about the next state of its peers. This resolves the circular reasoning. The resolution in the proof is based on induction, so for the base case the first element in σ has to be able to be extended to satisfy the local guarantee parts of both components.

Bad Prefixes and Closure
The extensibility property introduced above can be formalized by defining the concept of bad prefixes, i.e. finite sequences that cannot be extended to satisfy a given formula.

Definition 7.
A finite sequence of statesσ ∈ V(V ) + is a bad prefix of an LTL formula ϕ ∈ L(V ) iff for all infinite sequences σ ∈ V(V ) ∞ , the concatenation σσ does not satisfy ϕ, i.e.σσ ϕ. The set of bad prefixes of ϕ is denoted by badpref (ϕ). Then for a sequenceσ ∈ V(V ) + , We call a formula ϕ 1 stronger than another formula ϕ 2 iff ϕ 1 → ϕ 2 .
Definition 8. For an LTL formula ϕ, its closure C(ϕ) is the strongest safety formula implied by it. That is, C(ϕ) is the strongest safety property s.t. ϕ → C(ϕ).
The sequences that satisfy C(ϕ) are exactly those sequences σ s.t. each prefix of σ is a prefix of some sequence satisfying ϕ. In other words, σ satisfies C(ϕ) iff any of its prefixes can be extended to an infinite sequence satisfying ϕ. Note that σ C(ϕ) ⇔ ∀σ ∈ pref (σ) .σ ∈ badpref (ϕ).
Jonsson and Tsay give a syntactic definition of closure in LTL using past operators [36]: where ϕ[x/x] is the formula ϕ with the valuesx substituted for the variables x, and the existential quantifier ∃ over finite sets V(X ) is defined by The existential quantification in the definition of the closure is over all valuations of the variables in the environment variables X , or in other words, the free variables. This definition is used to prove the four-phase handshake protocol which is introduced below in Section 3.2.3.

Feedback Interconnection Refinement Rule
We can now state the Feedback Interconnection Refinement Rule: , Proposition 3) Given the architecture and the restrictions on the specifications outlined above, it holds that Proof sketch. Take a computation σ ∈ L M1 | M2 of M 1 | M 2 . If σ ϕ e , then the specification ϕ e → ϕ s is automatically met. So we assume that the environment assumptions ϕ e are satisfied. Then, by (P1), σ also satisfies both local environment assumptions ϕ e 1 and ϕ e 2 . Now (P4) ensures that the environment refinement formulae φ e 1 and φ e 2 are satisfied for the initial state and both components can proceed infinitely from this initial state (because of the no bad prefix property). Therefore, for the initial state, ϕ e 1 ∧ φ e 1 and ϕ e 2 ∧ φ e 2 are satisfied. By (P3), the local guarantees ϕ s 1 ∧ φ s 1 and ϕ s 1 ∧ φ s 1 are satisfied for the initial state as well. Then (P2) allows to conclude that ϕ s is satisfied by the initial state.
Because of (P4), the environment refinement formulae φ e 1 and φ e 2 are always satisfied for one further state than the system refinement formulae φ s 1 and φ s 2 . Since ϕ e 1 and ϕ e 2 are satisfied by σ anyway, σ also satisfies ϕ e 1 ∧ φ e 1 and ϕ e 2 ∧ φ e 2 , not just for the initial state. By a similar argument as for the initial state using (P3) and (P2), σ satisfies ϕ s .

Verifying the Hypotheses
In order to be able to use the Feedback Interconnection Refinement Rule, techniques are required to verify the hypotheses (P1)-(P4) that are required to deduce that the composition of the individually synthesized components satisfies the global specification.
The hypotheses give semantic conditions on the GR [1] specifications, which are harder to verify than syntactic conditions that are used e.g. in the work of Jonsson and Tsay [36]. The latter approach is not adopted because it requires the introduction of past operators and existential quantification into the temporal logic, which are not supported by the synthesis procedure based on JTLV.
Given ϕ e 1 , ϕ e 2 , ϕ s 1 and ϕ s 2 , the properties (P1) and (P2) can be derived syntactically by using sequent calculus rules for LTL, see Section 2.1.3. The property (P3) is satisfied by construction from synthesis. Verifying (P4) in its full generality is more challenging. The simplest case is to just have ϕ e ∧ φ s 1 → φ e 2 and ϕ e ∧ φ s 2 → φ e 1 , which can also be verified by sequent calculus.

Communication
For a coordinated action of the components to satisfy the global specification, it is often necessary to enable some form of information exchange [42]. One way to handle communication is proposed by Kloetzer and Belta [40,41], but their approach does not involve the encoding of the communication protocols directly in LTL, allowing it to fit in the framework used in this thesis.
An approach more appropriate for our purposes is to define communication protocols directly in LTL [11,23]. The refinement of the local specifications by safety formulae that can contain system variables of the peer component allows some limited form of information exchange.
However, in order to obtain reliable communication, it is required to introduce handshake protocols between the components. Their specification requires system variables to occur in the environment assumptions as well, which is not handled by the composition rule presented above. The stronger composition rules by Abadi and Lamport [2] and Jonsson and Tsay [36] support this but have the disadvantage that they introduce operators into LTL that the synthesis does not handle.
We will therefore identify where the Feedback Interconnection Refinement Rule fails to hold when system variables are allowed in the local environment assumptions and resolve them for the particular case of the four phase handshake protocol that is also used by Bloem et al. [11].

Glitches
The symmetric situation to stuttering is when one FDS misses one or several transitions of its peers or the environment. When viewing shared variables as communication lines, then this may cause information to be lost and environment assumptions to be violated, even though the environment behaves appropriately. This is illustrated in Figure 3 These problems occur when the environment assumptions contain the next and the eventually operator. In particular, environment assumptions like where x and y are system and environment variables respectively, are not permissible. No environment can guarantee that it will have asserted y the next time an FDS is observing it. This is because there can be a delay between x being asserted and this information reaching the environment. The above formula is neither stutter nor glitch invariant. Also, is not glitch invariant, even though it is stutter invariant. The problem is that the environment may satisfy this assumption by asserting y for only one step and then clearing it again. This might be missed by an FDS that makes this environment assumption.
It is therefore important to formulate specifications to be robust to such glitches. If a finite number of transitions are missed, correct operation must still be guaranteed.

The Four-Phase Handshake Protocol
Consider the case of transmitting an integer δ ∈ [0, n) from a sender M S to a receiver M R . The sender controls a request signal r ∈ [ǫ, n). If r = ǫ, this indicates that no data should be transmitted. If r = ǫ, then the data that is to be transmitted is δ = r. The receiver controls a boolean acknowledgement signal a. The request signal r appears as an environment variable r ∈ [ǫ, n) at the receiver. Similarly, the acknowledgement signal a appears as a boolean environment variable a at the sender. Thus, the architecture that contains the sender M S and the receiver M R can be visualized as in Figure 3 The four-phase handshake protocol can be informally described as follows. The sender M S initiates a transfer by setting r = δ. Once M R detects this, it may use the transferred data somehow, and then raises a. When M S sees that a has been asserted, it resets r = ǫ. After M R detects this, it clears a, completing the transmission of δ. This is outlined in Figure 3.3.

Sender Specification
The sender assumes one liveness and two safety properties about the receiver. It is assumed that if the request is reset, the acknowledgement will be cleared eventually, allowing for a new request to be made: The assumed safety properties assert that the acknowledgement signal does not change in a way that is not allowed by the protocol. There is no acknowledgement without a request: Also, the acknowledgement may only be cleared if the request has been reset before: III (a ∧ ¬a → r = ǫ).
The sender guarantees three safety properties. No liveness property is guaranteed, because the sender may just remain idle. However, a system using this protocol will have to contain a liveness property that implicitly guarantees liveness in the protocol. Also, as long as the request is not acknowledged, it must stay at the same value: The request may only be reset to ǫ:

SPECIFYING DISTRIBUTED SYSTEMS
Lastly, the sender responds to an acknowledgement by resetting the request: IX (a → (r = ǫ)).
Note that this last guarantee also ensures that the sender may only initiate a transmission if the acknowledgement signal is low. This could be expressed by the additional guarantee (r = ǫ ∧ (r = ǫ) → ¬a), but clearly this is already implied by IX.

Receiver Specification
On the receiver side, one liveness and two safety assumptions are made. The receiver assumes that each acknowledgement eventually results in the request to be cleared: IV (a → ♦(r = ǫ)).
It also assumes that the request reacts appropriately to the acknowledgement. Similar to guarantee VII, no transmission is initiated if the acknowledgement is still high: Also, the request may only be cleared if it has been acknowledged: The receiver guarantees that each request will be acknowledged: And it guarantees that the resetting of the request results in the acknowledgement to be cleared: XII (r = ǫ → ¬a).
Moreover, the acknowledgement may only be raised on a request: Lastly, the acknowledgement may not be cleared unless the request is reset:

Reliability of the Four-Way Handshake Protocol
It now remains to show that the four-phase protocol reliably transmits data from the sender to the receiver. To show this, we introduce a boolean variable t into the environment variables of the sender M S , which will act as a "trigger" to a message being sent. The data will just be a single constant δ ∈ [0, n).
Similarly, introduce an integer variable s ∈ [0, n) into the system variables of the receiver, which will act as a "sink" where the sent data will be stored for later use. We add the response property to the guarantees of the sender, which ensures that the data will eventually be sent, once the transfer has been triggered by "t = True". Similarly, the response property XV (r = δ → ♦(s = δ)) will be added to the guarantees of the receiver. Note that while in XV the eventually operator might be substituted by a next operator, this cannot be done in X, since changing r is restricted by a, which is not controlled by M S .
The full local specifications are shown in Figure 3.5. The global specification is (t → ♦(s = δ)), requiring that once a transmission is triggered by t being asserted, the data δ eventually arrives correctly at the sink s. We thus want to prove the following: Proof. We make use of the Composition Theorem of Abadi and Lamport ([2], Theorem 3), which in our particular case is: Note that we only use a nesting depth of the next operator of one in the GR [1] specifications, so the explicit translation to TLA is omitted. For the closure required for the Composition Theorem, the above LTL definition by Jonsson and Tsay will be used.
For the preconditions (A1) and (A2), consider the closure of ϕ e S , which is (∃t,ā . (t = t ∧ā = a) ∧ (ϕ e S [t/t][ā/a])) and the closure of ϕ e R , which is (∃r . (r = r) ∧ (ϕ e R [r/r])). We consider the individual cases for values oft, a andr to deal with the existential quantification, which, by definition, is just a shorthand for disjunction.

Note that
ϕ ↔ ϕ and ϕ ↔ ϕ for any LTL formula ϕ, which helps to simplify the closures of the formulae we are considering.

Case 1.t = True,ā = True:
Evaluating the conjuncts for these valuations yields (r = ǫ) from IX and ♦(r = δ) from X. These two formulae can never hold together and thus in this case the closure of ϕ s S is simply false. As false implies everything, both (A1) and (A2) hold in this case.

SPECIFYING DISTRIBUTED SYSTEMS
Case 2.t = True,ā = False,r = ǫ: Here the conjunct resulting from X is ♦(r = δ), but we also have (r = ǫ) due to the existential quantification. Thus, again the antecedent is false and so both (A1) and (A2) are implied.
Case 3.t = True,ā = False,r = δ: Evaluating the conjuncts in the closures for these variables yields the conjunct ♦(s = δ) for XV. Moreover, the conjuncts (t = True), (a = False) and (r = δ) are in the closures from the existential quantification.
For (A1) we need to deduce I-VI from these conjuncts. I and VI follow from (r = δ) and II-V follow from (a = False).
In order to resolve the existential quantification, we again consider both truth values oft. However, since we are now proving the closure as a consequent, we only need to exploit one value oft for which the closure of (t → ♦(s = δ)) is implied by the antecedents. Lett = True. Then the closure becomes (t = True) ∧ ♦(s = δ). The first conjunct follows simply from (t = True) from the closure of ϕ s S . The second conjunct follows from XV, i.e. ♦(s = δ). Evaluating the conjuncts for these variables yields the conjuncts (a ∨ ¬a) from XIII and (¬a ∨ a) from XIV. These two conjuncts already yield a contradiction, and so (A1) and (A2) are both satisfied.
Case 5.t = False,ā = True,r = ǫ: The conjunct in the closure resulting from XII is ¬a. This stands in contradiction with the conjunct (a = True) from the existential quantification. Thus both (A1) and (A2) are satisfied. Case 6.t = False,ā = True,r = ǫ: The conjunct in the closure resulting from X is (r = ǫ), but the existential quantification requires (r = ǫ). This leads to an immediate contradiction, so both (A1) and (A2) are satisfied. To prove (A1) we again need to be able to deduce I-VI from the conjuncts of the closure. I-IV follow from (a = False) while V and VI follow from (r = ǫ).
Case 8.t = False,ā = False,r = δ: For the preconditions (A1) and (A2) the conjuncts from the existential quantification are sufficient: I-V follow from (a = False) and VI follows from (r = δ). Moreover, in the same way as in Case 6, (A2) follows from (t = False).
This covers all cases and so the preconditions (A1) and (A2) have been established. The result follows from the Composition Theorem (3.1) stated at the beginning of this proof.
Note that we had to use (3.1), a stronger result than the Feedback Interconnection Refinement Rule in order to be able to incorporate the system variables in the environment assumptions, and to include liveness formulae in the specifications.
When using the four-phase handshake protocol in the form just proved several things should be noted. It is always possible to use weaker assumptions, as long as the specification remains synthesizable. In particular, omitting conjuncts in ϕ e S or ϕ e R does not change the correctness of the protocol. However, the guarantees ϕ s S and ϕ s R must be provided in a specification. They need not occur in the same syntactic form, but can be strengthened to an arbitrary degree without affecting correctness of the protocol.

Chapter 4 Searching
One of the main challenges in SAR is to locate the targets that need to be rescued. In order to avoid ambiguities, the physical environment of the robot, such as a building in USAR or a landscape in WiSAR, is referred to as topology. The controllers are specified and synthesized with a two-player game in mind, which then can be thought of as taking place on a graph representing the topology. Assuming that a SAR robot can detect the presence of a target if it is in the same vertex of the graph-representation of the topology, the problem is to detect the vertex the target is in.
The solution depends on the capabilities of the robots and the targets, as well as the amount of information they have. Here we differentiate searching for a stationary and a moving target. When the target is stationary, it is sufficient to ensure that each vertex in the graph is eventually visited by at least one robot. 1 When the target can move, we formulate a pursuit-evasion game, in which an evader (the target) tries to avoid being captured by one or more pursuers (the robots). The controller specifications are developed from the winning strategies for the cops of this game.

Preliminaries
Before presenting the search strategies for the different scenarios, we make precise the concept of the graph representation of the topology and the way sensors are incorporated in our specification framework from Section 3.

Graph Representation of the Topology
In order to reason about the movement of the robots in an SAR task, the topology must be represented internally in a way that admits LTL specifications about the positions of the robots. The topology is partitioned into discrete "cells" that are typically polygonal shapes. The robots move from one cell ?>=< 89: ; into another cell using continuous control, which is discussed e.g. in the work of Kloetzer and Belta [40], Kress-Gazit et al. [47] and Topcu et al. [90]. After subdividing the topology into, say n such cells {C 0 , C 1 , . . . , C n−1 }, we are only concerned with controlling the discrete moves between cells, represented by changing the integer system variable cellID ∈ [0, n) of the robot, which thusly holds its position.
The changes of cellID are constrained by the topology, which can be represented by a directed graph G = (V G , E G ). Each vertex in V G = {v 0 , v 1 , . . . , v n−1 } corresponds to a cell. The possible transitions between the cells are the edges E G . An edge e going from the vertex u ∈ V G to the vertex v ∈ V G is an ordered pair (u, v) ∈ V G × V G . The edge e = (u, v) is an in-edge of v and an out-edge of u.

Definition 9. A path is a sequence of vertices
an edge for all indices i ∈ [0, l − 1). A simple path is a path with unique vertices, i.e. it contains no cycles. The i th element of the path p is also denoted by p(i) = v i , and we say that p is a path from p(0) to p(l − 1) = p(|p| − 1).

Definition 10.
A graph G = (V G , E G ) is strongly connected iff there exists a path from every vertex v ∈ V G to every other vertex u ∈ V G . Denote the set of all strongly connected directed graphs with n vertices by S n .
We require the graph G representing the topology to be strongly connected, that is, it is possible to get from every vertex to any other vertex of the graph. If a graph is not strongly connected, there may be cells that the robots are not able to access, depending on their initial positions. Targets located in such inaccessible cells could never be found with any strategy.
The constraints on cellID are incorporated in the guarantee part of a robot's GR [1] specification. Consider for example the graph shown in Figure 4.1, which is strongly connected and therefore qualifies as a valid basis for synthesis. A robot is always allowed to stay at a vertex, so the self loops are included implicitly. For notational convenience, we use the boolean variables X i instead of explicitly writing cellID = i, i.e. X i = True ⇔ cellID = i. Further let 4.1. PRELIMINARIES n = |V G | be the number of vertices in G. Then, for the graph in Figure 4.1 the corresponding specification is where the last line is a mutual exclusion formula, preventing the robot to think that it is in two cells at the same time. This ensures that (cellID = i ↔ X i ).

Generating Random Strongly Connected Graphs
The methods developed in this chapter are tested on randomly generated graphs. We use the Erdős-Rényi Model in order to generate random directed graphs that are strongly connected [24].

For this purpose, we represent a graph
We require that a graph contains all self-loops, so the diagonal of Adj (G) for any graph G that we are considering contains only nonzero elements. Since any nonzero entry in Adj (G) represents an edge, the adjacency matric can also be used to store state information of edges by using different nonzero values. This is used for example for the moving target search, see Section 4.4.1.
To generate a random graph G with n vertices, we select a constant P such that Further, let X be a continuous random variable that is uniformly distributed over the range {x | 0 ≤ x < 1} ⊆ R. Next, we draw one sample for each pair of vertices from X, yielding the n 2 samples e 1,1 , e 1,2 , . . . , e 1,n , e 2,1 , e 2,2 , . . . , e n,n . For all i and j, if e i,j < P then let the i, j th element of Adj (G) be one and zero otherwise. Thus, a matrix of ones and zeros is generated that defines the graph G.
With this choice of P , the resulting graph G almost surely contains one "giant" component, i.e. a subset of vertices covering almost the entire graph in which each vertex is reachable by a path from each other vertex in the same set. However, we still need to check, whether G is indeed a strongly connected graph. This can be done by self-multiplying Adj (G) n times and testing whether or not all elements in Adj (G) are nonzero. The process of generating a random graph is repeated until this test yields a positive result, confirming that the graph is strongly connected.

Sensors
So far, the input variables of an FDS were considered to be controlled by an abstract environment. When an FDS is executed on a microprocessor, the input variables are abstractions e.g. from inputs received from sensors or data transfer lines connected to the processor. For example, a boolean environment variable may be the abstraction of the input received from a sensor detecting the state of a switch.
When considering an FDS to be the controller of a robot that moves on a graph G, sensors can be differentiated between gathering information from the entire graph or just a subgraph of G. In the former case we speak of global information, while information from a subgraph in the vicinity of the robot is called local. In the extreme case, a robot may only obtain sensor inputs from the vertex it is on.
Thus, sensor inputs, e.g. represented by an environment variable s, depends on the system variable cellID . However, the robot does not know about this dependency. Therefore, when simulating the FDS, we must ensure that the state of the graph is maintained globally, but only the appropriate local information is available to the robot by changing s accordingly. This is further discussed in Section 4.5.2 and is implemented through connectors as explained in Section 5.1.1.

Stationary Target Search
In an USAR application, taking place for example in a collapsed building, the targets are usually assumed to be stationary, and thus the search only involves visiting each vertex by a robot until the target is detected. A global specification therefore requires that once a vertex contains a target, it is eventually visited by at least one robot. Here we present the concept of stationary target search by considering only a single target at a time in the graph. In the implementation presented in Section 5.1, several targets can be rescued at the same time.

Global Specifications
Let G = (V G , E G ) be a directed graph with n = |V G | vertices. In order to formulate the global specification, we introduce the global integer environment variable t ∈ [ǫ, n), which indicates whether and where a target needs to be rescued. If t = ǫ then no target is in the graph, but if t = ǫ then a target is located on vertex v t , i.e. the vertex with index t. This represents the actual state of the target, but the robots have no direct information about the value of t. Rather, the robots are equipped with sensors that provide local information about the vertex the robot is currently on. Thus the robot only sees the value of t when it is on the vertex v t .
Assume there are m robots {R 0 , R 1 , . . . , R m−1 } searching for the targets, each with a unique index j ∈ [0, m). The position of robot R j is controlled via the

STATIONARY TARGET SEARCH
system variable cellID j ∈ [0, n). For notational convenience, we use the boolean variable X j i instead of explicitly writing cellID j = i.
The main global system goal therefore can be stated as follows: This expresses that once a target is at vertex v i , at least one robot will find it, i.e. at least one robot will eventually move to the vertex v i . In order for this to be realizable, we have to at least assume that the target stays at the vertex until it is discovered. This is the stationarity assumption, and it can be expressed by the global environment assumption which says that in order for v t to change from a value that is not ǫ, at least one robot has to be at the target's vertex. A different way of expressing the global system goal isφ s = (t = ǫ → ♦(t = ǫ)), which makes the actions required for the target at t to be rescued implicit. In order forφ s to be realizable, the environment assumptions must indicate how t reacts to the actions for the robots, i.e. how the system variables can be changed in order to clear t. For example, t can be cleared if a robot moves to the vertex v t , which is expressed by the environment assumption Note that the two specifications here might not be synthesizable and not even realizable. They are merely shown to illustrate the principle behind specifying stationary target search globally.

Compositional Specifications
The specification ϕ e → ϕ s (orφ e →φ s ) might not be complete or realizable, but it expresses the main idea behind globally specifying a distributed search in a graph. If a synthesis algorithm existed for general compositional synthesis, this specification could directly be used to synthesise a reactive controller for each robot in the architecture, s.t. together the robots would implement the global specification. However, since no such algorithm exists, the specification must be decomposed manually.

Minimal Specification
Each robot can have a simple local specification stated here for the robot R j . Note that the robot knows nothing about the location t of the target and no sensor information is used. This way of searching assumes that the target reacts automatically to the robot being in the same cell by becoming rescued. Note however that in order to actively engage in the rescue of a target, the robot needs to react to a sensor input that indicates that it is in the target's cell.
In this specification, there is no coordination between the robots, and so the search might be inefficient. However, we are not so much concerned about efficiency of our controllers as with their correctness. 2 Synthesizing a controller from this specification would indeed satisfy the global specification given above. However, when not one, but several robots are required to find a target, a different approach is needed. With stationary targets this is not hard to implement, since a robot can just stay with the target until a second robot arrives, requiring the robot to have information from a sensor that it is in the target's cell.

Circular Search
Another approach is to explicitly encode the paths that the robots have to take through the graph in order to visit each vertex at least once. This again does not allow for coordination between the robots. It has however one decisive advantage over the previous approach: It is explicitly known to the robot when the search is finished. In the previous approach, only the finiteness of the state space of the synthesized FDS induces a bound on the time to complete searching the graph. 3 The paths are extracted from the graph by finding a shortest cycle that contains all vertices, which can be done by the algorithm FindCyle in Table 4.1. The algorithm is provided with a starting vertex u and returns a shortest path p that starts at u and ends at a vertex v, such that there exists an edge (v, u) ∈ E G and p contains each vertex in V G at least once.
In the specification, the robot can explicitly be instructed to follow the path p returned by FindCycle. Since the cycle formed by the edges connecting the vertices in p might not be Hamiltonian 4 , it is not sufficient to just encode this with guarantees such as (X j p(0) → X j p(1) ). This is because some vertices might need to be visited several times and at such vertices the choice of the next vertex depends on the current position in the path. By introducing a counter system variable c ∈ [0, |p|) and letting the robot visit the elements on the path in order it is possible to keep track of the elements in p already visited.
The search is started with the counter at zero and the robot being at p(0) = u: 2 Arbitrary efficiency bounds cannot be provided in GR [1] specifications that have a limited nesting depth of the next operator and lack the bounded until operator U ≤k . In fact, the allowed nesting depth of is just one in GR [1] specifications. 3 We assume that the topology of the environment does not change, so it is a valid solution to explicitly encode a path for the robot. However, if the topology is unknown or changing, this approach is no longer appropriate. 4 − 1), v) ∈ E G then newpath = p extended with v append newpath to paths return paths Table 4.1: Algorithm to find cycles containing all vertices in a graph. Calling Find-Cycle(u) on some starting vertex u ∈ VG yields a list of vertices p that induces a cycle in G. Assuming list operations to be O(1), the runtime complexity of this naïve implementation of FindCycle is O(n · n!) for dense graphs, and O(n 4 ) for sparse graphs with O(|EG|) ∼ = O(|VG|).

MOVING TARGET SEARCH
Note that X j p(0) is a synonym for cellID j = p(0), so all variables X j i with i = p(0) necessarily valuate to "False". The counter is restricted to only increase, unless it has to be reset to zero in order to loop when the path is completed. Define nextval(γ) = (γ + 1 + |p|) mod |p| to be the next value of the counter when the current value is γ, where mod is the infix operator for the remainder of integer division. Then this rule can be written as: The robot moves along the path, increasing the counter by one each step: This way of searching a graph is used in the implementation of moving target search, since there it is necessary that the robot knows when the search is finished, which is indicated by c = |p| − 1. A full specification of this type of search is given in Section 5.2 when searching for particular vertices in the topology.

Other Search Methods
Searching a graph can also be implemented as a depth-first-search or as another exploration algorithm. The specification of such algorithms is not straightforward, but can be done using counters and storing information in the vertices similar to the approach presented in Section 4.5 under the heading "Global Storage", which ensures that the state space does not explode.
A depth-first search can handle an unknown environment topology of finite extent, if the vertices are able to store information for the robot and provide the robot with information of its neighboring vertices. However, synthesis from an LTL specification might not be the best approach to implement such an algorithm that has already been proved to work in a standard implementation.

Moving Target Search
When the target is moving, such as in a WiSAR application, it is no longer sufficient to visit each vertex eventually, like in the stationary target search. For most topologies, a fixed number of robots might never be able to find a moving target. Consider for example the situation in Figure 4.2, where a single robot (•) is trying to find a moving target (•) by moving on the same vertex in the topology. The target can evade the robot by always going to the opposite vertex at the same time as the robot moves. If the target knows the robot's strategy, it can always evade the robot.
It is therefore necessary to implement a search strategy that ensures that even a moving target cannot escape the robots. This problem has been considered before and successfully implemented, for example in the work of Vidal et al. [88]. These implementations use probabilistic methods to find the target; we use a different approach in this thesis, and consider the problem of finding a winning strategy for a game of the robots against the targets on the graph representing the topology.

Game Theoretic Approach
Trying to find a moving target can be seen as a form of a pursuit-evasion game in which the target tries to evade its pursuers, the SAR robots. The objective of the game in its original formulation is to find the minimum number of robots necessary to guarantee that the target is eventually found. Depending on what moves are allowed for the robots and the targets, the robots must implement different strategies in order to reliably find the target. A recent survey by Chung et al. provides a taxonomy of properties for pursuit-evasion games [17].

Cops and Robbers Game
We consider a particular form of pursuit-evasion game called the cops and robbers game first introduced by Nowakowski and Winkler [66]. A number of cops and robbers take turns in moving on a directed graph by traversing edges from vertex to vertex. A cop captures a robber if they find themselves on the same vertex or edge. Cops can move one edge at a time, but the robbers can move with infinite speed, i.e. in each turn they can move along any number of edges. However, they cannot pass through vertices that are occupied by cops.
To align with standard formulations, a robber may hide either on a vertex or on an edge.
The cops win the game if the robber is eventually captured, while the cops lose the game if any of the robbers are able to evade the cops forever. The robbers are supposed to be adverse and always choose the worst possible move against the cops. They also know exactly where the cops are and their strategies, while the cops have no information on the position or strategy of a robber, unless it is captured. The game is considered as a two-player game between C , the central coordinating authority of the cops against the adverse robbers, modelled as a single player R.
A strategy for the cops defines the moves of the cops on the graph depending on the observations about the targets. A winning strategy for the cops is a strategy that guarantees that all robbers are found in a finite number of moves. The game is solved by finding the minimum number of cops for which a winning strategy exists for a given graph.
Note that the terms robot, cop and pursuer can be used interchangeably, as is the case for target, robber and evader. Unless the context demands otherwise, we use "robot" and "target" throughout the rest of this section.

Cop Numbers
Most graphs require more than one robot to capture the targets, see for example Immediately the question arises how to compute c(G) for a given graph. Another problem is to give sufficient properties for a graph G so that c(G) has a fixed value. In this thesis we are not concerned with answering these questions but rather how to find a winning strategy for c(G) robots for a class of graphs that is as general as possible. Such a winning strategy clearly exists for c(G) robots by definition.

Computational Considerations
For general graphs and if the robots have no information about the positions of the targets, finding the cop number is NP-complete ( [13], Figure 1). Even when both robots and targets have complete information about the positions of all robots and targets, computing c(G) in an undirected graph, which is a simpler problem than the one we are considering here, is EXPTIME-complete ( [30], Theorem 3).
It was shown before that the synthesis of a GR [1] specification ϕ can be done in polynomial time in the size of ϕ. However, we do not try here to solve an NPcomplete problem by a polynomial time algorithm. When formulating a GR [1] specification ϕ for a winning strategy, ϕ must explicitly contain the system variables that control the robots, i.e. cellID j for all j. Therefore, the number of robots that is available to pursue the targets is already explicitly encoded in ϕ.
With such a specification, GR [1] synthesis merely decides whether a given number of robots is sufficient to win the game. However, this does not mean that the cops and robbers game is solved, which consists in finding c(G). This must be done at the time of formulating the specification, because the system variables must be able to independently control at least c(G) robots.
From this discussion we conclude that the cops and robbers game cannot be solved by GR [1] synthesis: An NP-complete problem cannot be solved by the polynomial time algorithm for GR [1] synthesis. However, realizability of a specification ϕ of a winning strategy that explicitly includes the number of robots, can be decided by GR [1] synthesis. This is shown constructively in Section 5.2 by synthesizing controllers implementing a winning strategy.
Since GR [1] synthesis cannot be used to find c(G) and a GR [1] specification must have the number of robots encoded explicitly, we assume that the cop number c(G) is provided alongside a graph G.

Moving Target Search Strategies
Instead of solving the cops and robbers game, we are interested in finding winning strategies for a given set of m robots {R 0 , R 1 , . . . , R m−1 }. Clearly, no such strategy exists if m < c(G). We first categorize the winning strategies given that a central authority C can directly control the moves of all robots, called globally coordinated winning strategies.
Thus the player C implements its strategy as an FDS M C , which is specified by a GR [1] specification ϕ C . The environment variables of M C are controlled by the player R. However, no FDS implementation M R of the targets' strategy is synthesized. The targets are simply assumed to always perform the worst possible moves for the robots.
The central authority C controls the system variables cellID j for all j. This is the standard formulation found in the literature. However, we go on to identify globally coordinated winning strategies that can also be specified by several GR [1] specifications that are synthesized into a set of FDS's that together implement the globally coordinated strategy. This corresponds to reformulating the two-player cops and robbers game into a game where several robots C 1 , C 2 , . . . , C m play against the adverse targets R. The winning strategies of the robots are based on local information in the graph only, and they must negotiate with each other in order to cooperate or share information. Therefore, such strategies are referred to as locally coordinated winning strategies.
Note that the requirement to provide sufficiently many robots means that the cop number must be known at specification time. It turns out, that the cop number is not even required to be included in the local specifications, but is used only to build the architecture for sufficiently many robots.

The State of a Graph
We define the state of a graph to indicate to the robots whether the target can be said with certainty to not be on a particular edge or vertex. If the target cannot be on an edge, then the edge is contaminated, and the same notion is introduced for vertices and graphs in the following definitions: Definition 11. An edge e ∈ E G in a graph G = (V G , E G ) can either be contaminated or cleared. Initially, all edges of the graph are contaminated. A contaminated edge e = (u, v) from u to v can be cleared by a robot either by placing a guard robot on u and sliding down the edge from u to v with another robot, or if all in-edges of u are already cleared by simply sliding down the edge from u to v with a robot, without requiring a guard on u.

Definition 12.
A vertex is cleared if all its in-edges and out-edges are cleared, partially cleared if all its in-edges are cleared and at least one of its out-edges is contaminated, contaminated if at least one of its in-edges and all of its out-edges are contaminated and no robot is guarding it, and critical otherwise. A contaminated vertex can be a start vertex, a concept which is introduced below.
The state of an edge e ∈ E G is S e (e) ∈ {ecl, eco}, where ecl and eco correspond to "cleared" and "contaminated" respectively. Similarly, the state of a vertex v ∈ V G is S v (v) ∈ {vcl, vpc, vcr, vco} where vcl, vpc, vcr and vco correspond to "cleared", "partially cleared", "critical" and "contaminated" respectively. The state of a graph is the set of all states of its edges and vertices.

Definition 13.
A graph is cleared if all its vertices are cleared, partially cleared, or are guarded by a robot, it is contaminated if all vertices and edges are contaminated, and it is critical if it is neither cleared nor contaminated.

Graph Clearing Sequences
A strategy defines a set of moves of the robots depending on the observations about the targets, which are obtained by querying the state of the graph, e.g. using sensors, see Section 4.1.3. We define strategies for the cops that assume that a central authority can control the movement of the robots. A list of robots R that are available to move is maintained as well as an auxiliary list of cops G that keeps track of the guarding robots. Given that there are m robots Definition 14. Given a graph G = (V G , E G ) and sufficiently many cops in R, a clearing move g is defined as a sequence of movements of robots that satisfies the following procedure: (S1) if R = ∅ then select R ∈ R and remove R from R else select a guarding robot R from G Place R as a guard on a contaminated vertex v ∈ V G and put R in Slide R ′′ from p to q along (p, q). This clears the edge (v, u) (S4) if v is cleared then place R back into R This procedure is satisfied by a sequence of robot moves if the statements are completed sequentially, i.e. (S1) precedes (S2), (S2) precedes (S3), (S2.1) precedes (S2.2) and so on. Note that the dots indicate a hierarchy, so (S2) is completed only if (S2.1) and (S2.2) are. The contaminated vertex v ∈ V G selected in (S1) is called the start vertex of the clearing move.
The procedure presented in the above definition does not deterministically specify the moves of each robot at every time. The sources of nondeterminism are the following: • There is no specific order according to which robot should be chosen from R in (S1), (S2.1) or (S3.1).
• There is no specific order according to which the guarding robot should be chosen from G in (S1), (S2.1) or (S3.1).
• Any contaminated vertex may be chosen in (S1).
• The partially cleared vertices may be chosen in any order in (S3).
• Robots that are in R or not in G, and not sliding down an edge in (S2.2) or (S3.2.1) may move around on the graph freely.
• The order in which the edges are cleared on the sliding moves is not specified in (S2) and (S3.2).
• Only the order of necessary moves is specified, but there could be an arbitrary number of actions interleaved into the given sequence that do not violate the procedure (i.e. guards may not move).
While a clearing move does not completely specify all robot moves, it completely specifies the change in the state of the graph, depending only on the choice of the start vertex v in (S1) and the choice of the robots R, R ′ and R ′′ in (S1), (S2.1) and (S3.1) respectively. We adopt the convention that G acts like a first in first out (FIFO) queue so that the robot that was first selected as guard will be the first robot to be selected to move away from the vertex it is guarding. The effect of a sequence of clearing moves g 0 g 1 . . . g n on the state of the graph is therefore uniquely specified by the start vertices of the clearing moves.
Definition 15. A graph clearing sequence (GCS) for a graph G = (V G , E G ) is a sequence of clearing moves Γ = g 0 g 1 . . . g l such that at the end of the clearing move g l the graph is cleared.
if no guarding robot on v and v cleared or contaminated then for each out-edge e = (v, u) ∈ E G of v do contaminate e recontaminate = True  When a guarding robot moves away from a critical vertex (i.e. a vertex with some cleared out-edges), there is the possibility of recontamination [52]. An edge e = (u, v) ∈ V G is recontaminated if it has been previously cleared but the vertex u is no longer guarded, cleared or partially cleared. The recontamination of an edge can cause vertices to change their state, and thus further edges to change their state, possibly causing a cascade of recontaminations in the graph. The state of the graph can be updated using the procedure in Table 4.2.
This procedure is used in the implementation of the global storage, cf. Section 4.5.2. It can be shown that no recontaminations are necessary to clear a contaminated graph G with no less than c(G) robots: Theorem 2 ([52], Theorem 2). Given a contaminated graph G = (V G , E G ) with cop number c(G), at least c(G) robots in R and a GCS Γ of G, the set R will always be nonempty at steps (S1), (S2.1) and (S3.1) of any clearing move in Γ. That is, no guarding robot ever has to be removed and no recontaminations occur.
Theorem 3. Given a graph G = (V G , E G ), c(G) robots in R, and a GCS Γ for G, the graph is cleared by Γ independently of the initial state of G.
Proof sketch. Denote G and R at the beginning of Γ byĜ andR respectively. 5 LetĜ be the set of the guarding robots at the beginning of Γ (some robots must be guarding, otherwise the graph must be cleared and Theorem 1 yields the result).
When executing Γ onĜ, at steps (S1), (S2.1) and (S3.1), the robots inĜ will be chosen before the robots that have been removed previously fromR in step (S1). On using the guarding robots fromĜ, recontamination may happen. By Theorem 2, during the execution of Γ, no guarding robots other than those inĜ are required in steps (S1), (S2.1) or (S3.1). Therefore, recontamination never affects edges that have been cleared during the execution of Γ in steps (S2.2) and (S3.2.1) and so Γ clears G independently of the initial state of G.
Corollary 1. Given a contaminated graph G = (V G , E G ), c(G) robots in R, a GCS Γ for G, and a finite sequence of clearing moves Γ ′ = g 0 g 1 . . . g n , the concatenation Γ ′ Γ is also a GCS for G.
Proof. LetĜ andR be G and R at the end of Γ ′ respectively. At the end of Γ ′ ,Ĝ is either contaminated, critical or cleared, and |R| ≤ c(G). The result follows from Theorem 3.
Corollary 1 states that the set of graph clearing sequences is closed under prefixing with clearing moves. When developing a globally coordinated winning strategy for the robots, it is therefore sufficient to ensure that the sequence of robot moves it entails eventually ends in a GCS. As mentioned above, it suffices to specify the order of starting vertices of the clearing moves. Thus, a winning strategy can be defined by a function from the state of the graph to the next starting vertex.
Since we are ultimately interested in finding a locally coordinated winning strategy, the choice of the next start vertex should not depend on the entire state of the graph, because in a real implementation this information is not available to the robots without a central authority to coordinate them. Therefore, let V i G be the set of vertices for which a robot can observe the state before the i th clearing move. It is defined to be V G for i = 0 and for i ≤ 0 by That is, before the i th clearing move g i in Γ, a robot can observe the state of a vertex v ∈ V G iff v is the destination or source of an edge f that goes to a vertex u ∈ V G which itself is the destination or source of a cleared edge e. Hence, the robots have a limited visibility radius of the graph state (while still only being able to sense a target in the same cell).

Definition 16.
Let E i G be the set of cleared edges before the i th clearing move g i in Γ and E i G the graph induced by the edges in E i G . Let C i G ⊆ V i G be the set of critical or contaminated vertices in V s G that have at least one contaminated in-edge.
is a µ i -clear-candidate if it has exactly µ i contaminated in-edges before the i th clearing move g i in Γ.
Definition 18. Let ν i be the maximum number of contaminated out-edges to µ i -clear-candidates of any vertex in V i G if µ i < ∞, and let ν i = −∞ otherwise. A vertex is a ν i -start-candidate if it has exactly ν i out-edges to µ i -clearcandidate vertices before the i th clearing move g i in Γ.
The start vertex v i ∈ V G of the i th clearing move g i in Γ is selected according to the following heuristics, denoted by H. The six criteria are listed in order of decreasing priority: (H1) The vertex v i is contaminated.
(H2) The graph E i+1 G must be connected (but not necessarily strongly connected).
(H3) If it exists, select a ν i -start-candidate vertex v i ∈ V i G which is not a µ iclear-candidate.
(H4) Otherwise, if it exists, select a ν i -start-candidate vertex v i ∈ V i G which is also a µ i clear-candidate.
(H5) Select the vertex with the minimum number of in-edges.
(H6) Select the vertex with the maximum number of out-edges.
Note that even after (H6) there still might be several possibilities of choosing v i in which case the start vertex is chosen nondeterministically.

Evaluation of the Strategy
With these heuristics, the i th start vertex is selected from the contaminated vertices in V i G . This is a local decision in order to solve the global problem of finding the best starting vertex. This requires to make assumptions on the graph that permit the local heuristics to always lead to a global solution, i.e. choosing the start vertices according to the local heuristics successfully clears the graph G with exactly c(G) robots. 6 When choosing the start vertices according to the above heuristics H, it is hoped that a GCS results. However, this is not true for all graphs. One possible counterexample is the graph in Figure 4.3. This is a planar graph with just five vertices, but still the heuristics do not necessarily produce a GCS. A GCS would arise from choosing to guard v 1 and v 4 (in any order). However, the heuristics may choose from any of the following sequences of start vertices: However, the former two require four robots, while the cop number of the graph is just three.
The heuristics would be easy to fix for this graph by adding another criterion (H7) In a tie, sum up the contaminated out-edges of the destinations of each vertex and choose the vertex with the maximum such number.  Even if this would give rise to a GCS for this particular graph, it does not however solve the general problem: We try to find a simple solution to a provably hard problem, i.e. solving a global problem using only local information.
In general, the larger the graphs get, the more likely it is to encounter graphs that cannot be cleared using the heuristics with just c(G) robots. Table 4.3 presents the results of simulations for a number of small graphs. For various counts of vertices, random graphs have been generated and the number of instances in which H does not result in a GCS are listed as counterexamples. The larger the graphs, the more likely it is for H to not yield a GCS. In the worst case of the explored examples in Table 4.3 even c(G) + 4 robots are required.

Reformulation as Optimization Problem
Finding the minimum number of robots required to clear a graph can be formulated as an optimization problem. In order to evaluate the cop number of a graph with n vertices, we consider an objective function cn n (G, δ) : S n × V + G → N from graphs G ∈ S n and sequences of starting vertices δ ∈ V + G to the number of robots required to clear the graph when placing them on the start vertices δ in (S1) of the clearing moves. 7 The function cn n is potentially a very complicated function, and, as the results presented in Section 4.3.2 show, requires exponential time to compute in the number of vertices n.
We now minimize cn n over the sequences of starting vertices for some given graph G ∈ S n . When all sequences of starting vertices are feasible, then the minimum will be equal to the cop number c(G) by definition: δ).
Encoding the graph G as an adjacency matrix Adj(G) and δ as a vector may yield a combinatorial optimization problem. Solving this is of course NPcomplete, corresponding to the complexity of computing the cop number. Now, the heuristics can be interpreted as constraints on the set of feasible sequences of starting vertices. Here we denote a heuristics simply by a propositional function h(G, δ) : S n ×V + G → B that is true iff the δ satisfies the heuristics h in the graph G. Finding the number of robots under a heuristics h can thus be reformulated as the optimization problem Showing whether a heuristics h is optimal, in the sense that it always chooses the best start vertex so that only c(G) cops are required to clear the graph is equivalent to proving that for all graphs G, the solutions to the optimization problems P 1 and P 2 yield the same value. This can be written as: h optimal ⇔ ∀G ∈ S n . min δ∈V + G cn n (G, δ) = min δ∈V + G cn n (G, δ) s.t. h(G, δ) = True (4.4) Table 4.3 clearly shows that the heuristics H we developed is not optimal. However, even if we could develop an optimal strategy, verifying this using (4.4) would be a nontrivial task.

Locally Coordinated Strategies
So far we assumed that a central coordinating authority exists that can directly control the robots. However, we are interested in developing a locally coordinated winning strategy. Several questions must be answered: How to adapt the globally coordinated winning strategy to a locally coordinated one? How is authority negotiated between the robots, i.e. how do the robots coordinate? Where is the information about the state of the edges and vertices of the graph stored and how is it accessed or observed by sensors? This section is dedicated to answering these questions, and a complete specification is presented in Section 5.2.

Negotiations
Given a graph G and its cop number c(G), we would like to find c(G) strategies, one for each robot, that together implement a winning strategy for G. No central authority is used, and so the robots must somehow cooperate in order to eventually find the targets. The required communication protocol has already been presented in Section 3.2.2.
Coordinating their movements on the graph restricts the authority each individual robot has. For example, a guarding robot may not move from a vertex v while another robot is engaged in sliding down the out-edges of v. This requires the robots to be able to negotiate for authority over each other, so that one robot can, at least temporarily, control the other.
Instead of implementing sophisticated negotiation algorithms in the specification, we fix the structure of authority. Thus, each robot has a master and a slave, resulting in a circular structure of authority. Indeed this is necessary when recontamination occurs and the robot that was the first guarding robot in the GCS is told to move by its master.
This results in symmetrical specifications of the robots, where each robot provides the same services to its master and may expect the same services from its slave. We therefore develop only one local specification ϕ and merely change the names of the variables specific to a robot. In practice, ϕ is synthesized once and the architecture ensures that the communication channels are set up correctly, see Section 5.2.1.
Thus, negotiation is decided at specification time and no longer has to be taken account in the specification. Communication is then merely used to transfer the commands from masters to slaves. The data, i.e. the state of the graph, can directly be obtained from the global storage discussed next.

Global Storage
Our implementation of the locally coordinated strategy for the cops and robbers game does not require the robots to have knowledge about the entire state of the graph. Instead, the robots are only provided with the information that is immediately required to form a local decision about the next move. This is achieved by storing the entire state of the graph in a data structure that can be accessed by all robots, but only provides local information to each robot.
Keeping the state outside of the searchers is current practice in SAR and is not a new idea. For example, the United Nations INSARAG marking system defines a set of shapes and letter used to mark a building's status to aid the SAR operations. 8 Similar techniques could be implemented for the SAR robots, but we only consider the abstraction to the graph state introduced above.
In order to formally state a specification of a distributed solution, we must define how to access the global state. A robot will only ever have access to the state of the vertex it is currently on. We thus include the system variable cst j ∈ {cl, pc, cr, sv} in the system variables of robot R j , indicating the current state of the vertex the robot is on. From the point of view of the robot this acts like a sensor that reads the relevant aspect of the environment.
The variable cst j takes the value sv if R j is on a start vertex and (S1) is being executed. In (S1), R j is placed on a contaminated vertex v, for which S v (v) = vco. However, R j may only choose a start vertex according to the heuristics H. Whether a contaminated vertex is a start vertex is indicated to the robot by the global storage. Thus, if S v (v) = vco, but v is not a start vertex, then cst j = cr from the point of view of the robot R j if it is on v. However, if v is a starting vertex and R j is on v, then cst j = sv. Otherwise, cst j takes the values cl, pc and cr if S v (v) = vcl, S v (v) = vpc and S v (v) = vcr respectively. This will later be used in the specification of the controllers in Section 5.2.2.
In an implementation, it has to be ensured that the robot indeed gets the current state of the vertex on which it is. This requires in particular that the state of the graph is updated appropriately. Initially, all edges of the graph are contaminated. The state of the vertices only changes with the state of the edges to which they are connected, and the state of the edges changes depending on the movement of the robots on the graph. Thus, the global state of the graph changes only when a robot slides down an edge in steps (S2.2) or (S3.2.1) or the graph is recontaminated. In the latter case the procedure in Table 4.2 is executed.
Keeping the state of the graph outside the robots has several advantages: The robots do not need to communicate the local information they have to each other, reducing the need for system and environment variables for communication. Furthermore, the state space of the robots decreases significantly by only querying the immediately relevant local information of the graph. Note that the state of a graph with n = |V G | vertices is uniquely defined by the states of its edges, giving rise to O(2 n 2 ) configurations in dense graphs.

Multi-Stage Specification
The local specifications must ensure that all robots together execute a sequence of movements that satisfies a GCS, i.e. a sequence of clearing moves. Thus a robot may be in one of four modes corresponding to the possible movements necessary to implement a clearing move. The robot R j with index j therefore has a system variable M j ∈ {cs, gu, sp, sl} keeping track of the mode of the robot. If M j = cs, the robot is searching for a (contaminated) starting vertex in (S1). If M j = gu, the robot is guarding a vertex in (S1). If M j = sp, the robot is searching a partially cleared vertex in (S3). And if M j = sl, the robot is sliding down the out-edges of a vertex in (S2.2) or (S3.2.1).
All robots except one are initialized to guard some arbitrary vertex in the graph, i.e. they are in mode M = gu. The remaining robot is initialized on some arbitrary vertex but is searching for a starting vertex, i.e. it is in mode M = cs. For reference, a summary of the environment and system variables of the robots is given in Table 5.8 and Table 5.9 respectively.

Searching for Start Vertices: M = cs
A robot R j in mode M j = cs searches for the contaminated vertex that is to be the next start vertex in the sequence of clearing moves Γ that constitutes a GCS for the graph G. The robot searches all vertices, querying their states until a start vertex is found, indicated by cst j = sv. This search is done in a circular fashion as outlined in Section 4.2.2. Using a circular search, the robot knows when all vertices have been visited and no contaminated vertex is in the graph. In this case, the graph is known to be cleared already.
If a contaminated vertex v is found that matches the six criteria in the heuristics H, it is selected as start vertex. Consequently, the robot enters guard mode M j = gu and stays at v until called by its master to move away. On entering guard mode, the robot's slave, with index j ′ , is instructed to also move to v and start sliding down the out-edges of v to clear them. Thus the slave is forced to enter the search for a partially cleared vertex with M j ′ = sp.

Guarding: M = gu
A robot R j in mode M j = gu is guarding the vertex v on which it is currently positioned. Note that v must necessarily be a start vertex. R j thus stays at v until instructed by its master R j ′′ to move away. The only way the master R j ′′ can force robot R j to leave v, is to be guarding a vertex w itself and to then instruct robot R j to enter the clearing mode M j = sl and clear all out-edges of the vertex w guarded by the master.

Searching for Partially Cleared Vertices: M = sp
This mode is very similar to searching for start vertices. However the difference is that the robot R j reacts to finding a partially cleared vertex v by directly entering the clearing mode M j = sl. A partially cleared vertex does not need to be guarded, and thus in this case the robot that finds such a vertex does not need to instruct its slave to help clearing the out-edges of v.

Clearing: M = sl
In the clearing mode M j = sl, robot R j is using sliding moves to clear the outedges of a partially cleared or guarded vertex v i . The vertex v i is stored in the robot's system variable store j = i, which is set on entering the clearing mode.
The out-edges of v are cleared one at a time, which is specified in the guarantees of the robot's specification. Since the order of edges to be cleared by sliding is arbitrary in the definition of a clearing move (see the discussion of sources of nondeterminism below the definition), it is perfectly admissible to fix the order at specification time.
To keep track of which out-edges of a vertex have already been cleared, the robot keeps a system variable c j , which is a counter that is initialized to zero when the clearing mode is entered, in addition to setting store j to the index i of the vertex v i . Whenever the robot slides down an out-edge of v i , c j is increased by one. This is guaranteed by properties similar to the following: whereγ i is the number of out-edges of the vertex i and w i γ is the (unique) vertex such that there is an edge e from i to w i γ and e is the γ th out-edge to be cleared by the robot.
After clearing an edge, the robot has to return to the stored vertex in store j again, which is guaranteed by properties similar to The full specifications that follow the ideas developed in this section are given in Section 5.2.

Implementations
In this chapter, we present two implementations of controllers for SAR robots, one for stationary target search in an USAR application, and the other for moving target search in a WiSAR application. In the stationary target search, a central authority, called the "allocator" is responsible for dispatching the robots to the vertices in the graph where a target needs to be rescued. In the moving target search, a distributed solution is adopted, where the authority structure among the robots is already negotiated in advance, cf. Section 4.5.1.

SAR of Stationary Target
In USAR, the targets are mostly considered stationary. We develop specifications to build controllers for a team of robots that is managed by a central allocator. The goal is to find all targets in the affected area and rescue them. A robot that is at the location of a target may engage with it by performing a rescue task like providing medical support. In this scenario, we will consider a target to be rescued ifᾱ = 2 robots have engaged with it for a sufficient amount of time.
The allocator is responsible for gathering information about the targets' status and location, and coordinating the action of the robots by dispatching them to the location of a target. If a robot is not dispatched, it may move around freely. The topology is represented as a graph, which is explained in Section 4.1.1. It is optimistically assumed that the entire graph is known to the robots at synthesis time and that it does not change during the SAR task.
When the allocator dispatches a robot to a vertex, it merely asserts the index of a target's vertex on a transmission variable to the respective robot. The robot is then expected to move to this vertex on its own account, so the allocator does not need to know the topology. The allocator knows about a target's needs by receiving a message, or a "flag" associated with the location of the target. Targets will be assumed to be stationary since an injured or trapped person will not move.
Communication between the allocator and the robots is assumed to be layered on top of some reliable wireless protocol. Delivery of data is guaranteed eventually in finite time, messages are not corrupted, no reordering takes place, no messages get lost -comparable to a data-layer protocol. Thus the communication is based on the four-phase handshake protocol developed in Section 3.2.3.

Architecture
We synthesize the controllers for a set of robots and the central allocator. The asynchronous composition of the reactive systems resulting from the synthesis must satisfy the global specification of rescuing each flagged target, see Section 4.2.1.
In order to be able to simulate the reactive systems, it is necessary to close them as explained in Section 2.2.1. This is done by also synthesizing a reactive system for each vertex or "cell" in the topology. These reactive systems control the flags according to the environment assumptions of the allocator, which gathers the information about the targets. The complete architecture is shown in Figure 5.1 and the individual parts are explained below.

Allocator and Queues
At the heart of the architecture is the allocator, denoted by AMM . It is connected to the robots, {R 0 , R 1 , . . . , R m−1 }. The cells are also included in the figure to show how the closed-loop system would be controlled. They are shown as FDS's {C 0 , C 1 , . . . , C n−1 }.
The allocator is informed about whether a target needs to be rescued by the boolean flags f 0 , f 1 , . . . , f n−1 , each associated with one cell. Similarly, the allocator knows about which robots are ready by receiving the boolean variables r 0 , r 1 , . . . , r m−1 , each associated with one robot. If a robot is ready and a vertex has been flagged, the allocator must dispatch a robot to the vertex that has been flagged for the longest period of time.
If there are n vertices and m robots, the allocator would need at least 2 n+m states to account for the n flags and m ready signals of the robots. However, in order to reduce the allocator's state space, two FIFO queues FIFOf and FIFOr are implemented as separate components that maintain which target and robot has been waiting for the longest period of time respectively. Thus the environment variables of FIFOf are the flags f 0 , f 1 , . . . , f n−1 and the environment variables of FIFOr are the ready signals r 0 , r 1 , . . . , r m−1 .
The allocator receives a flag-index F ∈ [ǫ, n) from FIFOf , and a robot-index R ∈ [ǫ, m) from FIFOr indicating which robot may be dispatched to which cell. If FIFOf holds f i at its head, then it offers F = i to the allocator, and symmetrically if FIFOr holds r j at its head, then it offers R = j. Moreover, the allocator may request the next flag index from FIFOf by sending a dequeue signal DEQf , which is acknowledged by DEQf ACK . The queue FIFOr does not have such a dequeuing capability, since this is not required in the specification.
The allocator can dispatch robots by setting the dispatch variable D ∈ [ǫ, m) to the value in F . This indicates to the robot which is currently selected by R that it has to go to the vertex in D. Internally, AMM maintains a counter variable c ∈ [0,ᾱ] of the number of robots that have already been dispatched to the cell with index F . If possible,ᾱ = 2 robots will be dispatched to a cell, but never more, becauseᾱ is the number of robots that are required to clear the flag.
We do not provide specifications for the queues since they are not synthesized in the way explained above. With n inputs a FIFO FDS would have O(2 n n!) states, making synthesis futile even for modest n. This number results from the O(n!) configurations the internal store of the queue can be in (corresponding to the system variables Y) and the O(2 n ) configurations the boolean inputs can be in (corresponding to the environment variables X ). Hence, we consider FIFO's as standard components and use a Python implementation for simulation.

Robots
For stationary target search, the number of robots required is only as high as the number of robots required to rescue a target, i.e.ᾱ. However, we may include an arbitrary number of robots in the architecture to complete the rescue operation more effectively. For example, withᾱ = 2, if there are two targets and four robots, the robots can be dispatched in teams of two and rescue both targets at the same time. We synthesize one controller that is used on all robots and simply rename the variables with indices to indicate which variable belongs to a particular robot.
A robot R j maintains its own position on the topology both in cellID j ∈ [ǫ, n) and in the boolean variables X j 0 , X j 1 , . . . , X j n−1 . As explained above, the two representations are merely introduced for notational convenience in the specification. Another variable, store j ∈ [ǫ, n), stores the destination cell if the robot has been dispatched.
The robot R j knows that it is dispatched from the dispatch signal D sent by AMM , if the associated robot index R from FIFOr satisfies R = j, indicating that AMM sends D to R j . However, the robot is not interested in whether any other robot is dispatched or not. Therefore, in order to decrease the state space of the robot, auxiliary environment variables d 0 , d 1 , . . . , d m−1 over the domain [ǫ, n) are introduced, one for each robot. Robot j receives d j = i from the allocator if it is dispatched to vertex v i . On reaching the vertex v i , the robot checks its boolean sensor signal flag j whether there is still a target on this vertex. The environment variable flag j is true iff there is a target on the vertex the robot is currently on. If a target is detected at the vertex to which the robot is dispatched (recognized by cellID j = store j ∧ flag j = True), the robot asserts a boolean engage signal e j to indicate to the allocator that it has successfully reached the target's vertex.

Connectors
The communication between the individual components in the architecture is shown by the arrows between the individual components. Some environment variables of the robots and cells are functions of the system variables of their peers. For example, the environment variable E i of cell C i is a function of the variables cellID j and e j for j ∈ [0, m). One way to incorporate their relationship into the design would be to have E i as a system variable and cellID j and e j for j ∈ [0, m) as environment variables in C i . Then the guarantee (E i = j (e j ∧ X j i )) can be added to the specification of C i . Note that the summation interprets "True" as "1" and "False" as "0". While this would produce the desired result, it introduces many environment variables into the design of the cells. If they cannot be suitably restricted by assumptions in the specification, this will lead to a considerable increase in the number of states in each cell's FDS.
To overcome this, these functions are implemented externally to the FDS's in the form of connectors. A connector is an invariant proposition of the global state space. It is of the form ϑ = π(ϑ 0 , ϑ 1 , ϑ 2 , . . .) where ϑ is an environment variable of an FDS M, called a connector variable, ϑ 0 , ϑ 1 , ϑ 2 , . . . are system variables of peers of M and π is some proposition over ϑ 0 , ϑ 1 , ϑ 2 , . . . with the additional condition that ϑ is not a system variable of any component in the architecture and ϑ is an environment variable only of M. Thus, a connector introduces a new variable to the global state variables.
When proving properties over the composition of the specifications, these invariants can simply be assumed to hold at all times. In a simulation, these invariants are ensured by calculating the values of a connector variable ϑ whenever it is accessed by an FDS.
In our implementation of stationary target search, there are three types of connectors, shown as rectangles in Figure 5.1. There is a connector for the engage signal E i of a cell C i that indicates how many robots are engaged on vertex i. This is expressed by Another connector is for the flag signal flag j of a robot R j that indicates whether the vertex i = cellID j the robot is currently on contains a target, i.e. f i = True. This expressed by The third type of connectors is for the dispatch signal d j of a robot R j . Robot R j is dispatched to the vertex i iff d = i and r = j, i.e. if the robot that is offered to the allocator is R j and the allocator decides to dispatch a robot to the vertex i. This is expressed by

Global Specifications
The composition of all components in Figure 5.1 has to satisfy the global specification for stationary target search discussed in Section 4.2.1 in a form that corresponds to the problem setting considered here. A target on vertex i is indicated by the flag f i being asserted, and the goal of the allocator is the to getᾱ = 2 robots to arrive at the vertex i. This can be expressed analogously to (4.1) by We now state the specifications of each component so that the asynchronous composition fulfills this global specification. This can be verified for example by using the Feedback Interconnection Refinement Rule in Proposition 1, but here we only note that the simulation yields the desired result.

Allocator Specification
The state variables of the allocator are shown in tables Table 5.1 and Table 5.2.
The following specifications are for the FDS AMM in Figure 5.1.
Initially, no robot is ready, so FIFOr offers no robot and R = ǫ. Moreover, FIFOf doesn't have a dequeue request to acknowledge, so DEQf ACK is low: FIFOr keeps track of the robots that are ready, and so, if available, presents a robot to the allocator that can be dispatched. This robot will not change unless the formerly presented robot has been dispatched: Once a vertex is flagged, it is not unflagged unless a robot is dispatched to this cell, i.e. no target can rescue itself. More precisely, the flag offered by FIFOf may only change if a robot is dispatched or a dequeue signal is sent to the queue: The dequeue acknowledgement stays high as long as the dequeue request stays high: ϕ e A,4 = (clear (DEQf ACK ) → ¬DEQf ).

Guarantees
Initially, the dequeue signal is low, the counter is zero and no robot is dispatched: Once the allocator has dispatched a robot, it monitors the ready signal it receives from FIFOr . As long as this does not change, it does not clear the dispatch signal: However, if FIFOr presents a different robot to the allocator, this means that the robot to which the dispatch signal has been sent is no longer ready and has successfully reacted to the dispatch request. Thus dispatch is cleared: If the allocator gets offered a flag F = i from FIFOf and a robot is offered by FIFOr , it may dispatch a robot to vertex i by asserting D = i. In this case the counter c must be increased by one: The dispatch signal may only be asserted if the counter c is not saturated, some robot is ready and a cell is flagged: If a robot is dispatched and the dispatch signal is changed, it must be reset: Moreover, dispatching a robot requires the dispatch signal to be clear: The counter may only increase by one if a robot has been dispatched: Also, the counter may not decrease (unless it is reset), and it may only go up by one at a time. This requirement is captured by 0 ≤ (ᾱ+γ ′ −γ) modᾱ ≤ 1, where γ and γ ′ are the values of the counter at the current and next step respectively: This formulation forbids certain changes of the counter c. A positive formulation that ensures that c only changes in a permissible way can also be used but results in exactly the same synthesized FDS.
If no robot is dispatched, the counter must not change: The counter is only reset on a raising edge of the acknowledgement received from FIFOf: Conversely, if the counter is saturated and a raising edge of the acknowledgement is observed, then the counter is reset: If enough robots have been dispatched to the vertex currently offered by FIFOf , then the counter c is saturated. The allocator must then ask FIFOf to offer the location of the next target, if available. For this purpose, the dequeue signal DEQf is raised if no acknowledgement is currently received: The vertex the robot is dispatched to flag j B Indicates whether the vertex the robot is on is flagged The dequeue signal may only go high if the acknowledgement is low: Also, the dequeue signal must stay high until an acknowledgement is received from FIFOf: ϕ s A,15 = (clear (DEQf ) → DEQf ACK ).

GR[1] Specification and Communication
The above formulae are composed into the specification of the allocator: [1,4] ϕ e A,α → β∈ [1,15] ϕ s A,β , which can be translated into a GR [1] specification. and ϕ s A,13 , given that there are at leastᾱ robots offered by FIFOr . The property X is not guaranteed from the specification itself, but is required for the communication protocol to be valid. However, model checking the synthesized FDS of the allocator M A ϕ A reveals that also M A (DEQf ACK → DEQf ). Thus the allocator satisfies the requirements to be a sender in the four-phase handshake protocol.
The allocator communicates with a robot also using the four phase handshake protocol. The request signal that is sent by the allocator is a combination of the index R offered by FIFOr and the index of the target's vertex in D. In the notation of Section 3.2.3, (r = i) ⇔ (D = i ∧ R = j) for the request signal to robot R j . The acknowledgement from robot R j is the signal r j being cleared. However, r j is not received as an environment variable by the allocator, so the robot index R offered by FIFOr is used to extract this information: When R = j changes, then robot j has acknowledged the dispatch request. In the notation of Section 3.2.3, a ⇔ clear (R = j). Thus ϕ s A,2 and ϕ s A,6 correspond to VIII and IX respectively, while X is implied by ϕ s A, 3 and ϕ e A,2 .

SAR OF STATIONARY TARGET
Name Domain Description r j B Indicates whether the robot is ready e j B Indicates whether the robot is engaged store j [ǫ, n) Stores the current target vertex cellID j [ǫ, n) Stores the current position of the robot Stores the current position of the robot

Robot Specification
The environment and system variables of the robot R j are given in tables Table 5.3 and Table 5.4 respectively. In the following specifications, the suband superscripts with the robot's index j are omitted.

Assumptions
Initially, it is only known that the robot is not dispatched. This is a consequence of the robot also not being ready when it is started up (see guarantees): The allocator must wait for the robot to become ready before it can be dispatched: ϕ e R,2 = (clear (d = ǫ) → r). If the allocator sends a dispatch signal, this must remain the same until the robot acknowledges this by clearing its ready signal. Then FIFOr deletes this robot out of its list of robots that are ready, which in turn is (possibly) received by the allocator which only then may clear the dispatch signal:

Guarantees
Initially, the robot is not engaged, not ready and has no target stored: The robot becomes ready when no target is stored and it is not ready. From this time on, it will turn out that the atomic propositions r = True and store = ǫ are equivalent, because the robot is ready exactly if no destination is stored: If the robot receives a dispatch signal when it is ready, it fills its target storage with the appropriate destination:

SAR OF STATIONARY TARGET
Moreover, a target may only be stored if the robot is ready. As a result of this, the robot must clear the ready signal r: The target store may only be cleared to ǫ, and only if the robot is at the target location and no flag is detected. Then also the robot must assert that it is ready: When a destination is stored then the robot eventually reaches the required cell: If the robot arrives at the correct cell and the flag is still up, then it engages: If the robot arrives at the correct cell but the flag is already cleared, then the store is cleared, the robot goes back to ready and disengages: The robot may only engage if it is in the correct cell and the flag is still sensed: Disengaging requires the target storage to be cleared. Note that this implicitly also includes all that is required to clear the target storage: The robot is free to move as long as it is not engaged.
The allowable moves of the robot depend on the graph G on which the search is performed. Since G is given at specification time, the restrictions due to the topology are encoded as presented in Section 4.1.1, and the formula ϕ G is included in the robot's specification.

Name Domain Description
The number of robots engaged on this cell System f i B Indicates whether the cell is flagged
The robot R j may receive dispatch signals from the allocator via the dispatch signal d j . It acknowledges such a request by clearing its ready signal r j . The allocator does not directly receive r j but only the signal R from FIFOr , which must be taken into account when reasoning about the correctness of the communication protocols. Thus the acknowledgement signal is equivalent to r j = False, i.e. when the robot declares that it is no longer ready. Except in the initial state, this is also equivalent to store j = ǫ. The request signal is equivalent to d j = ǫ. Therefore the guarantee ϕ s R,4 corresponds to XIV, and the combination of ϕ s R,3 and ϕ s R,5 corresponds to XII. However, XV and XIII are not directly guaranteed by the robot but are required in Cases 4 and 5 of the proof of Proposition 3. XIII states that d j = ǫ necessarily results in r j = True. However, since the allocator does not require the liveness assumption I, the proof of Case 5 still works without guaranteeing XIII as follows: To prove Precondition 1. we deduce II-VI from the conjuncts of the closures of ϕ s S and ϕ s R . II and III follow from (a = True) arising from the existential quantification ofā. IV-VI similarly follow from (r = ǫ). To prove Precondition 2. we taket = False in the closure and the result follows trivially.
XV states that raise(r j ) requires d j = ǫ. But the proof of Case 4 fails when omitting this guarantee. However, let us consider what would happen if the robot raised r j when d j = ǫ. The allocator only receives R from FIFOr . If R = ǫ then D must be ǫ from ϕ s A,3 and ϕ s A,5 , so in this case d j = ǫ is not possible. Thus at that point R = ǫ and so a robot R h , h = j is offered to the allocator in R. Thus when r j is raised, R does not change necessarily, since FIFOr offers R = h first. However, from the connector proposition for d j , when R = j then d j = ǫ. So also in this case d j = ǫ is not possible.

Cell and Queue Specifications
Each cell C i in the architecture in Figure 5.1 has just one environment variable E i , indicating the number of robots engaged on the cell, and one system variable f i , the flag of the cell. These variables are shown in Table 5.5. In the specification, we will again drop the subscripts from the variables and write just f and E.

Name
Domain Description Environment r j , j ∈ [0, n) B The ready signal received from robot R j System R [ǫ, n) The index of the robot offered to AMM

Name
Domain Description The index of the vertex offered to AMM DEQf ACK B The dequeue acknowledgement A cell has to satisfy only two guarantees. The flag can only be cleared if there are at leastᾱ = 2 robots engaged on the cell: Moreover, we include a liveness property, ensuring that the cell will always be flagged eventually: ϕ s C,2 = ♦ f. In order for the specification to be realizable, we need to assume that as long as a cell is flagged, the number of robots that are engaged on the vertex associated with that cell will never decrease: The FIFO queues FIFOr and FIFOf are not synthesized as FDS's due to the state space explosion problem, cf. Section 5.1.1. Instead, a thread is implemented that guarantees certain properties to the allocator AMM . In particular, the environment assumptions of AMM on the local system variables controlled by FIFOr and FIFOf must be satisfied. The conceptual environment and system variables of the two queues are shown in Table 5.6 and Table 5.7 respectively.
From ϕ e A,1 , the allocator requires that initially "DEQf ACK = False", which can easily be implemented in FIFOf . Also, ϕ e A,4 requires the dequeue acknowledgement DEQf ACK to only be lowered if also the dequeue request DEQf is false, which is similarly straightforward to implement.
There is only one requirement on FIFOr , imposed by ϕ e A,3 . The robot index R that is offered to AMM may hence only be changed if a robot is dispatched. Since FIFOr keeps track on which robots are ready, and robots may only lower their ready signals r following a dispatch D (cf. the connector (5.3)), this requirement is automatically met.
Lastly, from ϕ e A,3 , the flag offered to the allocator may only be changed if a dequeue signal DEQf is received by FIFOf or a robot is dispatched. FIFOf 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18

Synthesis
The specifications given above were successfully synthesized using the TuLiP front end. Figure 5.2 shows the number of states of the allocator and the robot when varying the size of the topology and the number of robots available.
The size of the state space of the robot does not depend on the number of robots in the architecture, but the size of the state space of both the allocator and the robots increases quadratically with the number of vertices in the graph representation of the topology. Also, the size of the state space of the allocator increases slightly with the number of robots.
The time for synthesizing the controllers is also polynomial in the size of the topology, as would be expected: The size of the specification increases at most quadratically with n, the number of vertices in the graph representing the topology, and the synthesis time is cubic in the size of the specification. By plotting the synthesis time on a logarithmic scale as in Figure 5.3 shows that the complexity must be subexponential. A rough analysis yields polynomial complexity of sixth order in n, but this cannot be seen accurately from the available data.  The timing measurements have been conducted on a 2.4 GHz Intel Core i7 CPU, with 4 GB of working memory. The available memory is likely to also affect the performance because the JTLV implementation uses the JVM Garbage Collector. Note also that the graph presented in this section was obtained for just one random graph for each value of n. Other random graphs give different state space sizes and synthesis times, but the polynomial complexity results still hold.

Discussion
Stationary target search has been successfully simulated for various numbers of robots and vertices. When more than two robots are used, the allocator explicitly requests a new flag to be offered by FIFOf and dispatches a robot to the corresponding vertex. Thus, with four and more robots several targets can be rescued simultaneously.
However, as is clear from Figure 5.2, the size of the state space grows very fast with the size of the graph. This affects the efficiency of synthesis. The synthesis of the controllers for 20 vertices and 6 robots already took about 15 min, and much longer times are expected for larger graphs. However, space seems to be even a more pressing issue. Larger problems are susceptible to heap overflow due to unsuccessful JVM garbage collection. For example, synthesis of a controller for 16 vertices and 5 robots is not successful when only permitting 1 GB of working memory.
The increase of the state space is mostly due to the added environment variables from the communication protocol. The assumptions on these additional envi-ronment variables cannot be strengthened sufficiently to reduce the state space further. The communication in this specification already deviates slightly from the four-phase handshake protocol defined in Section 3.2.3 in order to alleviate this problem, as any additional signal like a boolean acknowledgement roughly doubles the state space. Also, beyond a certain graph size, synthesis seems impractical. If this limitation cannot be overcome, then this type of specification seems unsuitable for practical applications.

Moving Target Search
In contrast to USAR, the targets in WiSAR are considered to be able to move. That means that the stationary target search methods are no longer sufficient, and we implement the distributed multi stage moving target search strategy developed in Section 4.5.3.
There is no central allocator, hence the specification is easier than that of stationary target search. However, as is evident from Section 4.3, justifying that a given number robots with controllers synthesized from the specification reliably find all moving targets requires more effort than with stationary target search.

Communication Structure
As indicated in Section 4.5.1, the robots are organized in a circular structure of authority and communication. A robot R j has exactly one slave and exactly one master. Figure 5.4 shows such a cycle. The state variables of the robots are explained in Table 5.8 and Table 5  We use the standard four-phase handshake protocol introduced in Section 3.2.3. Hence no sophisticated arguments as in the previous section on stationary target search are required to justify the correctness of the communication protocols used. Also, the correctness of the composition of all synthesized components is a simple extension of Proposition 2 in Section 3.2.3.

Name
Domain Description C in,j [ǫ, n) Vertex the robot is sent to by its master ackin j B Acknowledgement received from its slave cst j {cl, pc, cr, sv} State of the vertex on which the robot is

Robot Specifications
Similar to the stationary target search, the global specification must state that any target is eventually found on the given topology. Since the search strategies developed in Section 4.5 ensure that the graph is cleared, this global requirement is necessarily satisfied, given that the architecture contains sufficiently many robots. We therefore only state the specifications that are synthesized into robots implementing a winning strategy for the cops. It is then easy to extend this to include sensors to detect targets and react appropriately (e.g. by engaging).
In the following specifications, the subscripts and superscripts indicating the index of the robot are omitted for notational convenience.

Guarantees: Topology
Similar to the stationary target search, the allowable moves of the robot have to be defined in the guarantee part of the specification. The restrictions due to the topology are encoded as presented in Section 4.1.1, and the formula ϕ G encoding the topology is included in the robot's specification.

Guarantees: Guarding Mode
In the guarding mode M = gu, the robot has to stay at the current vertex unless a command from its master is received via C in : However, if a command is received, then the clearing mode M = sl has to be entered, setting up the store and counter appropriately: If the guarding mode is entered, then the robot's slave is instructed to clear all out-edges of the current vertex v i by asserting the index i on C out = i. However, if the guarding mode is entered because the counter c is saturated, this means that no vertex was found in M = cs or M = sp. In this case we know that the graph is cleared and so C out stays at ǫ. .

Guarantees: Searching Modes
The searching modes M = cs and M = sp can be specified together, as they differ only slightly by the state of the vertex the robot is searching for and the mode that is entered if such a vertex is encountered.
First, when entering a searching mode, the counters must be initialized correctly: where γ i is the index of the first occurrence of the vertex v i in the path p. Note that nextval(γ) = (γ + 1 + |p|) mod |p| as defined in Section 4.2.1 before (4.2).
If a start vertex has been found, then enter the guarding mode M = gu: Similarly, if a partially cleared vertex v has been found, then enter the clearing mode M = sl, initialized to clear the out-edges of v: Also, if the maximum counter value is reached in M = sp, then there is no partially cleared vertex and the search for a start vertex M = cs is entered: Note that the values of the counters are reset to the correct values necessarily by the guarantee ϕ s M,4 . Similarly, if the maximum counter value is reached in M = cs, then there is no contaminated (start) vertex and the graph must necessarily be cleared and the robot becomes dormant in guarding mode M = gu. Note that an additional mode can be introduced in this case that allows the robots to move arbitrarily on the graph, but here only the concept of moving target search should be introduced. The corresponding guarantee is: Now a few guarantees are required that prevent the counters from changing when they should not (so called frame axioms). The counter of the position in the path p, cnt may only increase until it overflows, corresponding to the path closing in a cycle. (cnt = γ ∧ (cnt = nextval (γ)))).
Since cnt and mcnt are only used in M = cs or M = sp, they are set to zero otherwise: Two more guarantees are required to prevent the robot from leaving the searching mode if no start vertex or partially cleared vertex was encountered or the counter has not reached its maximum value: (cnt = γ ∧ mcnt = γ) ∧ (cst = pc)).

Guarantees: Clearing Mode
The clearing mode is the most involved mode, but also the mode that is responsible for actual progress in clearing edges: no edges can be cleared by a robot that is not in mode M = sl.
First, on entering clearing mode, the index of a vertex is written to store so that the robot knows for which vertex the out-edges must be cleared. This can only happen when the robot is guarding and called by its master to move, or when the robot has found a partially cleared cell that it is now about to clear: Also, store may only change from ǫ if also the counter c is reset to ǫ or alternatively if the robot enters the clearing mode from a search for a partially cleared vertex: Moreover, if store = ǫ, then it may only change to ǫ, i.e. it is not permitted to immediately change from sliding down the out-edges of one vertex to sliding down the out-edges of another. Such a change also requires the counter c to be saturated, indicating that all out-edges of the vertex held in store are successfully cleared: Conversely, if the counter c is saturated, then the robot has successfully cleared all out-edges of the vertex held in store and thus enters the search for a partially cleared vertex: The counter c is always diligently set to ǫ when the clearing mode is entered (see ϕ s M, 26 ), representing that the robot first has to move to the vertex held in store. This latter requirement is expressed using the following property: (store = ǫ ∧ c = ǫ → ♦ i∈[0,n) (store = i ∧ X i )). (5.4) Note that we write (π → ♦ i∈[0,n) (store = i ∧ X i )) rather than the more intuitively obvious i∈[0,n) (π ∧ store = i → ♦ X i ). This is because the latter introduces n response formulae, each of which requires a trigger variable to be added to the system variables, which would multiply the potential number of states by 2 n . Using the former contracted response property only requires one trigger and thus the synthesized FDS has fewer states.
While the robot moves to the vertex held in store, the counter c must remain at ǫ: ϕ s M,19 = i∈[0,n) (store = i ∧ c = ǫ ∧ ¬X i → (c = ǫ)).
On reaching the vertex, the robot sets the counter to zero. It also stays in the vertex so that the state of the robot is consistent: Given that the robot is in the vertex held in store and the counter c has a value not equal to ǫ, an out-edge can be cleared. The corresponding property has already been introduced in Section 4.5.3: Recall thatγ i is the number of out-edges of the vertex i and w γ i is the (unique) vertex such that there is an edge e from i to w γ i and e is the γ th edge to be cleared by the robot. After clearing the edge, the robot must move back to the vertex held in store, which is expressed by the guarantee (5.5) This again is a response property, which would require a trigger to be introduced. Instead of having both response properties (5.4) and (5.5), we combine them into one guarantee: (c = γ + 1 ∧ X w i γ )) → ♦ i∈[0,n) (store = i ∧ X i )). This is of course only possible since the right hand side of the implication → is the same in both (5.4) and (5.5).
Again, the counter c must be restricted. It may only increase by one if an edge is cleared: Also, the counter may not decrease unless it is reset. Moreover, it may only increase by one: increase(c, γ 1 , γ 2 , i)), where increase(c, γ 1 , γ 2 , i) is a formula that only holds if the counter changes by an admissible amount, which is defined as follows: The counter may only be reset to ǫ if all out-edges have been cleared: (store = i ∧ c =γ i )).
If the robot is not in the clearing mode, then the counter c and store are not used, and they are therefore set to ǫ: ϕ s M,26 = (M = sl → c = ǫ ∧ store = ǫ).
Finally, the robot has to remain in the clearing mode as long as there are still out-edges of the vertex held in store to be cleared. (store = i ∨ c =γ i ) → (M = sl)).

Communication
The robots communicate with each other using the four-phase handshake protocol introduced in Section 3.2.3. Each robot communicates with its slave and its master as receiver and sender respectively, see Note however, that the assumption (C out = ǫ → ♦ ¬ackin ) corresponding to I is not included, since then the specification would not be synthesizable. This is because the rest of the specification implicitly includes (π(ackin ) → ♦ π ′ (C out )) for some propositional formulae π and π ′ . However, leaving out an assumption does not render the protocol incorrect (while leaving out a guarantee would). The guarantee IX is not necessary, since the request signal C out is boolean and a specification (C out ∧ ¬C out → ¬C out ) is redundant. The conjunct M = gu in the antecedents of the guarantees is necessary to ensure realizability since C out must be permitted to be asserted when guarding mode is entered (cf. guarantee ϕ s M,3 ).
Note again that the assumption (ackout → ♦(C in = ǫ)) corresponding to V is not included due to problems with synthesizability. But since all guarantees are included, the communication protocol works as proved above in Proposition 2 in Section 3.2.3.

Assumptions
While the specification above is perfectly realizable, due to the large number of possible valuations of the environment variables (|C in | × |ackin | × |cst| = 8n) it is beneficial to make assumptions on the environment to reduce the number of transitions that have to be included in the synthesized FDS (see Section 2.2.2).
Since the state of a vertex is only required in the searching modes M = cs and M = sp, we can artificially set cst to some arbitrary value in these modes. Then the robot can make the following two assumptions on the environment: Here we chose to set cst = cr. Note that this has to be guaranteed by the global storage of the graph state, cf. Section 4.5.2.

Synthesis
The full specification of the robots results is the following which can be translated into a GR [1] specification and hence synthesized with TLV.
The robot specifications given above were successfully synthesized using the TuLiP front end. For varying numbers of vertices in the topology, nine 1 random graphs were generated each in order to investigate the state space size and  As with the controllers for stationary target search, the size of the state space depends quadratically on the size of the graph n. The synthesis time for the moving target search controllers is polynomial as well, since the curve on the logarithmic plot in Figure 5.6 is sublinear. However, for a given n the state space size of the controllers exceeds those in stationary target search. The same is true for the time they take to synthesize (cf.

Simulation
We show a simulation of the moving target search on a small graph G with five vertices. The cop number is c(G) = 3, and so we use three robots. The specification is synthesized first and then the resulting FDS is executed in three different threads, corresponding to three robots on the graph with controllers M C0 , M C1 and M C2 . The communication between the robots is realized using a shared data structure holding the valuations of the global state variables V of the composite FDS M C = M C0 | M C1 | M C2 .
As explained in Section 4.5.3, all robots are initialized to M = gu, except one, which is initialized to M = cs. Figure 5.7(a) shows the initial configuration on the graph. Solid edges are contaminated while dashed edges are cleared. A vertex is black, red, green and dashed if it is contaminated, critical, partially cleared or cleared, respectively.   Figure 5.7. It can be seen that the graph is successfully cleared with the given number of robots. The specifications do not state how the target is detected, in which case the moving target search would have ended with the target being found (if one exists).

Discussion
Again, as in the case of the stationary target search, the size of the state space increases quadratically with the number of vertices in the graph. However, the number of robots does not influence the size of the state space, since each robot has exactly one master and one slave and no further negotiation is required. Still, due to the required additional variables for communication, the synthesized FDS's are even larger than those in stationary target search.
In the searching modes, the circular search introduced in Section 4.2.2 is used. This results in a rather inefficient moving target search implementation. However, the robots only have local information, so when global properties such as "for all partially cleared vertices" need to be implemented in such a distributed way, a tradeoff between information and efficiency is introduced. Note also that by only using V i G , the heuristics H uses local information to decide on the start vertex.
When a robot is guarding a vertex, it cannot move. In this specification of moving target search, there is always only one robot not in guarding mode un-          less the graph is already cleared. This might seem inefficient, as only one robot can move. However, the guarding robots are playing an important part in the search; if they move, recontamination could revert the progress of previous sliding moves.
One reason why the moving target search strategy can be implemented in such a way is because the global storage (cf. Section 4.5.2) allows the robots to not retain any historical knowledge of the graph state. Also, the heuristics H is implemented in the global storage, so that the start vertex is offered to a robot R j simply by letting cst j = sv. In a real-world implementation this has to be taken into account.

Conclusion
In this thesis, a framework for specifying and reasoning about communicating and cooperating SAR robots is introduced, and the synthesis of controllers from their specifications is demonstrated. We further define and verify a communication protocol, allowing reliable asynchronous transmission of data between the robots.
The methods are demonstrated by successfully synthesizing and simulating controllers for robots performing centrally coordinated SAR of stationary targets, and for robots performing distributed search of moving targets. This demonstrates that it is possible to automatically generate discrete controllers for coordinated SAR operations that are mathematically proven to achieve their highlevel goals.

Observations
The controllers cannot ensure bounds on the time it takes to eventually find a target. This is limitation inherent in the fragment of the specification language that we use and the synthesis method. However, fast searching is paramount, as with increasing time the chances of successful rescue dwindle, which is exacerbated in WiSAR, where it is usually necessary to increase the search radius with time.
With respect to the expected time to find a target, there is is a tradeoff between the accuracy and speed of effective search. These two factors are also called detection and coverage [31]. With greater accuracy the search takes longer and the probability of a SAR operation being successful decreases. In typical SAR operations, exhaustive search is only resorted to if other more effective search strategies have failed to yield useful information.
The discrete controllers are synthesized to satisfy their specifications with mathematically proven certainty. However, this requirement might be too rigorous for uncertain environments, compromising robustness in the case of unexpected scenarios or failures. For example, a change in the topology would render a controller unusable and cause the robot to stop operating. Also, it might be 6.2. VIABILITY OF APPROACH sufficient to guarantee that targets are found only with very high probability, or almost surely, while ensuring a faster overall operation.
With this type of controllers, the tradeoff between detection and coverage is completely ignored, and the search is always exhaustive. The accuracy of detection depends on the sensors being able to reliably detect targets. No such sensor exists, and sensors with high false-alarm rates lead to misallocating rescue robots that could be used otherwise to improve coverage.

Viability of Approach
Two key themes limiting the versatility of the proposed methods throughout this thesis are the computational complexity of the synthesis methods and the size of the state space. It may be objected that all information required for the controller is already encoded in the specification, and that the synthesis is wasteful both in terms of time and space. A program in a procedural language rather than an FDS could be used instead with the same effect but with lower space requirements. However, for complex specifications, program validation can likewise be a lengthy task.
In particular for the search strategies, algorithms have been developed that have proven to yield the same results as the tediously specified FDS's. It might not be viable to translate an existing algorithm into LTL and then synthesizing it back into an executable FDS. However, development of rule-based controllers or incrementally subjecting algorithms to more requirements can be handled straightforwardly with LTL specifications (as long as the specification remains realizable), e.g. introducing a new traffic rule when controlling an autonomous vehicle for urban traffic.

Future Work
Several improvements and extensions that are relevant for the specification and synthesis of controllers from LTL can be made. In SAR operations, it is often required that there are agents designated to particular tasks, e.g. robots specialized for searching large areas, searching on a small scale and extracting victims, or providing medical relief. This heterogeneity can be exploited for more efficient SAR strategies [31]. Moreover, a distribution of the resources can be included, such as partitioning the topology among several teams of robots.
The currently implemented search strategies are effective, but inefficient. This can be partially alleviated by the above improvements. Another approach would be to allow more robots than the cop number and implement fast search strategies that require each edge to only be traversed once by a robot [85]. Also, efficient search methods that rely on probabilistic information on the environment can be synthesized from probabilistic temporal logic specifications [7,28].
The controller specifications are small compared to the FDS's resulting from synthesis with TLV. It would be beneficial to exploit the compactness of a specification and perform synthesis on-the-fly instead of generating a static FDS. Such dynamic approaches are already used for model checking, e.g. by synthesizing deterministic monitors [6]. Dynamic synthesis is still in its infancy, but receding horizon, on-the-fly and compositional methods are already being developed [26,90].
Finally, Chung et al. [17] state that "due to poor reliability and the number of possible failures, few multi-robot systems have been tested on the scale necessary to demonstrate pursuit-evasion in complex environments." This thesis shows that theoretically the synthesis of controllers for SAR robots is viable, but neither the technology of robots is yet advanced enough, nor is controller synthesis explored to the extent that large-scale complex SAR scenarii can be implemented based on the methods that we present. The small existing sample implementations do not yet allow reliable communication between the robots [46]. Given the promises in robot-assisted SAR and the complexity reduction through synthesis, it would be a rewarding endeavor to test the presented methods on hardware.