{'fraction_non_alphanumeric': 0.03497657989710512, 'fraction_numerical': 0.006949243645857329, 'mean_word_length': 4.31897079844803, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 13, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Synthesis of provably correct controllers for autonomous vehicles in urban environments

This paper considers automatic synthesis of provably correct controllers for autonomous vehicles operating in an urban environment populated with static obstacles and live traffic. We express traffic rules such as collision avoidance, vehicle separation, speed limit, lane following, passing, merging and intersection precedence requirements in a formal specification language. Embedded control software synthesis is then applied to generate a controller that ensures that the vehicle obeys this set of traffic rules in any road and traffic conditions that satisfy certain assumptions.


I. INTRODUCTION
In the past decades, there have been growing interests in increasing the level of autonomy in transportation systems to enhance operational safety and efficiency. In particular, considerable research has been directed towards putting more autonomy into transport vehicles. The vehicles completed the 2007 DARPA Urban Challenge and the Google driverless cars have demonstrated that the technology for autonomous vehicles is close. However, to allow these vehicles to drive on a road with other autonomous and human-driven vehicles, it is crucial to verify that the autonomous vehicles operate safely and correctly follow traffic rules in any situation. As the number of possible situations is large, such verification can be a challenging task. Verification of certain components can be found, for example, in [1], [2].
In this paper, we consider an alternative approach where a "correct" controller is automatically designed such that, by construction, the vehicle is guaranteed to obey traffic rules in any traffic conditions that satisfy certain assumptions. To enable such an automatic construction, we precisely describe the vehicle specification in a formal language. The vehicle specification incorporates assumptions on the road and traffic conditions as well as traffic rules including collision avoidance, vehicle separation, speed limit, lane following, passing, merging and intersection precedence requirements. We use linear temporal logic [3] as a specification language due to its expressiveness. Embedded control software synthesis is then applied to automatically construct a controller that is correct with respect to the vehicle specification.
Automatic construction of a controller for an autonomous vehicle has been considered, for example, in [4], [5], [6], [7] with a limited set of traffic rules. The main contribution of this paper is in extending the set of traffic rules to cover all the nominal road driving requirements in the technical T evaluation criteria of the DARPA Urban Challenge. As a result, the autonomous vehicle exhibits much more similar behaviors to those of human-driven vehicles. For example, the vehicle respects the precedence order at an intersection rather than having to wait until the intersection is clear. It also stops within a required distance and monitors oncoming traffic before performing a passing maneuver. To achieve this, a finer abstraction that that used in, e.g., [4], [5] is required and results in additional computational complexity. The receding horizon framework proposed in [6], [7] is applied in order to keep the problem manageable.
The remainder of the paper is organized as follows. In Section II, we briefly describe linear temporal logic and terminology and notations used throughout the paper. Section III formulates the urban autonomous driving problem as well as formally describes the vehicle specification. Section IV provides a brief overview of existing techniques for embedded control software synthesis. Simulation results demonstrating that the autonomous vehicle correctly obeys traffic rules are presented in Section V.
II. PRELIMINARIES We use linear temporal logic (LTL) to describe system specifications. LTL is a powerful specification language for unambiguously expressing a wide range of desired system behaviors and has been utilized in various applications [8].
Definition 1: A system consists of a set V of variables. The domain of V , denoted by dom(V ), is the set of valuations of V . A state of the system is an element v ∈ dom(V ).
In this paper, we consider the case where V can be partitioned into two disjoint subsets S and E of controlled and environment variables, respectively. The environment variables are those related to factors over which the system does not have control whereas the controlled variables are those whose values can be set by the controller.
Definition 2: An atomic proposition is a statement on system variables v ∈ V that has a unique truth value (True or False) for a given value of v. Let ν ∈ dom(V ) be a state of the system and p be an atomic proposition. We write ν p if p is True at the state ν. Otherwise, we write ν p.
Definition 3: A finite transition system is a tuple T := (V, U, →, V 0 , Π, L) where V is a finite set of states, U is a finite set of actions, → ⊆ V × U × V is a transition relation, V 0 ⊆ V is a set of initial states, Π is a set of atomic propositions, and L : V → 2 Π is a labeling function.
An LTL formula is interpreted over an infinite sequence of states. Given an execution σ = v 0 v 1 v 2 . . . and an LTL formula ϕ, we write v i |= ϕ if ϕ holds at position i ∈ N 0 of σ. The semantics of LTL is defined inductively as follows: Based on this definition, ϕ holds at position v i iff ϕ holds at the next state v i+1 , ϕ holds at position i iff ϕ holds at every position in σ starting at position i, and ϕ holds at position i iff ϕ holds at some position j ≥ i in σ.
Definition 5: Definition 6: Let Σ be the set of all executions of a system. The system is said to be correct with respect to its specification ϕ, written Σ |= ϕ, if all its executions satisfy ϕ, that is, Safety (invariance) and reachability are examples of widely used properties. Given a propositional formula p that describes states of interest, a safety formula is of the form p, which asserts that p remains invariantly true throughout an execution. A reachability formula is of the form p, which asserts that p becomes true at least once in an execution. Obstacle avoidance and reaching a goal state are examples of safety and reachability properties, respectively.

III. URBAN AUTONOMOUS DRIVING PROBLEM
We consider the problem of autonomous driving in partially known urban environments populated with static obstacles and live traffic similar to those faced in the 2007 DARPA Urban Challenge (DUC). The aim is to automatically synthesize a controller that ensures that the vehicle obeys traffic rules while executing a given driving task.

A. Problem Setup
A road network R is defined as a collection of lanes and intersections. A lane is connected to another via an intersection. Let N l and N int be the number of lanes and intersections, respectively, in R. Then, R can be written as R = (L, I) where L = {L 1 , . . . , L N l } and I = {I 1 , . . . , I Nint } are sets of all the lanes and intersections, respectively, in R. Without loss of generality, we assume that each lane can be exited through only one intersection.
A lane is defined as a tuple L i : . . , N l }, X Li ⊂ R 2 is a set of points (i.e., x, y coordinates) in L i and can be represented, e.g., by the union of polygons, d Li ∈ {−1, 1} is the direction of L i defined in a consistent manner for all the lanes in R (i.e., d Li = d Lj iff lanes L i , L j have the same direction of travel), v Li ∈ R is the speed limit, Ent Li ⊂ X Li is a set of entry points, Exit Li ⊂ X Li is a set of exit points, Stop Li ∈ {0, 1} indicates whether there is a stop line at the exit of L i , and Adj Li ⊆ L is a set of lanes that can be entered from every point in L i without going through any other lane. Hence, Adj Li essentially includes all the lanes that are adjacent to L i with no median strip in the middle. For a lane with a stop line at the exit, we assume that the exit points are exactly where the stop line is.
An intersection is defined as a tuple Ii is a set of exit lanes (i.e., lanes that can be exited through I i ), Entry Ii is a set of entry lanes (i.e., lanes that can be entered from a lane in Exit Ii through intersection I i ), and T urn Ii is a set of tuples that specify the associated pairs of exit and entry lanes. Each tuple in T urn Ii is of the form (L j ex , L j en , type j ) where L j ex ∈ Exit Ii , L j en ∈ Entry Ii , and type j ∈ {−1, 0, 1} defines the type of turn (left, straight and right, respectively) from lane L j ex to L j en .
Next, we define controlled and environment variables.
Controlled Variables: The variables over which the system has control are x, d and v where x ∈ R 2 is the current position of the vehicle, d ∈ {−1, 1} is the direction defined in a consistent manner with the lane directions, and v ∈ R is the speed of the vehicle.
Environment Variables: The environment variables are the positions of the static obstacles and other vehicles. We assume that the environment state can be obtained accurately at run time through the onboard sensors. Let Obs = Obs f ∪ Obs b ∪ Obs l ∪ Obs r be a set of positions of all the static obstacles where Obs f and Obs b include all the static obstacles in our lane, Obs f include obstacles in front of us whereas Obs b include obstacles behind our vehicle, and Obs l and Obs r include all the static obstacles in the lanes to our left and right, respectively. In addition, we define V eh to be a set of all the other vehicles, identified, e.g., by unique IDs. Let Loc(V eh), Dir(V eh) and Speed(V eh) denote sets of positions, directions and speeds, respectively, of the vehicles in V eh. For any X ⊆ R 2 , let V eh| X = {veh ∈ V eh|Loc(veh) ∈ X} denote the set of all the vehicles whose positions are within X.

B. Autonomous Vehicle Specification
We use the DUC Technical Evaluation Criteria [9] as the requirement of the vehicle. For the clarity of the presentation, we consider only the case where the vehicle only needs to drive on a road and not in an unstructured region such as parking lot. 1 In this section, we show how each requirement can be expressed in LTL. The overall requirement of the vehicle is simply the logical conjunction of these requirements.
Checkpoints: The vehicle must pass over each checkpoint in the correct lane and in the correct sequence. 2 Assuming that there exists a high-level mission planning component that keeps track of the last checkpoint the vehicle has crossed and issues the next checkpoint to the controller, the corresponding requirement for the traffic planning component is reduced to eventually reaching the next checkpoint. Let ck be the position of the next checkpoint and d ck be the direction of the lane containing the next checkpoint. This requirement can be expressed in LTL as where ∆ ck represents the maximum distance between the vehicle and the checkpoint such that the checkpoint is considered being passed over.
Collisions and vehicle separation: The vehicle maintains a minimum standoff of X obs (e.g., 1 meter) from all obstacles and vehicles in all areas: Speed limits: Vehicle speed conforms to the maximum limit: Passing: The vehicle must always come to a full stop and monitor oncoming traffic before crossing a double yellow line. The vehicle maintains a forward vehicle separation of X pass,1 when leaving lane to initiate a passing maneuver in a travel area. The vehicle returns to travel lane with vehicle separation between X pass,2 and X pass,3 when completing a passing maneuver. We define propositions π p and π c . Proposition π p indicates whether there is an obstacle blocking the travel lane such that the vehicle is allowed to perform a passing maneuver. It is initialized to F alse and evolves according to the following logical dynamical equation where V eh l ⊆ V eh is a set of all the vehicles in the left lane that are driving in the direction towards our vehicle. Proposition π c indicates whether the vehicle has completed the passing maneuver. It can be defined as 2 This statement illustrates ambiguity of requirements written in an informal language. Suppose a given sequence of checkpoint is c 1 , c 2 , . . . . This statement can be interpreted as the vehicle may not navigate through c 2 before passing over c 1 at all. However, in the DUC, such a behavior is allowed. However, c 2 will not be considered as already being crossed and hence need to be visited again after the vehicle crosses c 1 .
where Obs r,f , Obs r,b ⊆ Obs r are disjoint sets of static obstacles in the right lane that are in front of and behind our vehicle, respectively. Note that π c , together with π p , ensures that the vehicle returns to the lane with vehicle separation less than X pass, 3 .
The passing requirement can then be expressed in LTL as The first and second always express the vehicle separation requirements for leaving and returning to lane, respectively. Stay in lane: The vehicle remains entirely in travel lane at all times except when performing a legal traffic maneuver such as a left turn or maneuvering to avoid an obstacle: Note that this requirement is simplified by the assumption that the vehicle is a point. For vehicles with non-zero length and width, X Li on the right hand side of (6) needs to be changed to a smaller set to account for the size of the vehicle. Stop line: The vehicle stops within X stop (e.g., 1 meter) of the center of the stop line at intersection. To express this requirement in LTL, we define a proposition π s that indicates whether the vehicle has stopped at the current stop line. We set π s [0] = F alse and for t ≥ 0,

The stop line requirement can then be expressed in LTL as
Intersection precedence and merging: The vehicle respects precedence order at intersections and does not proceed out of turn. In addition, the vehicle always merges into moving traffic when there is a delay of τ m seconds or more before the arrival of the next traffic-vehicle.
and have the right of way; thus, we cannot proceed through the intersection while there is a vehicle in X ns [t]. In addition, to satisfy the precedence order, we cannot proceed through the intersection while a vehicle that arrives X st [t] before our vehicle has not proceeded. Note that in the computation of X ns [t] above, we assume that the other vehicles also conform to maximum speed limit. This assumption can be relaxed by changing v Lj to the maximum speed of other vehicles. Next The intersection precedence requirement can then be expressed in LTL as Left turn: The vehicle always completes a left turn across a lane carrying oncoming traffic when there is a delay of τ l or more before the passing of the next oncoming vehicle. For any given time t, we define X lef t [t] to be an area where we need to monitor the traffic before making the left turn: and where I[t] is defined as in (8). In addition, we let V eh lef t [t] = V eh[t]| X lef t [t] be the set of all the vehicles that should proceed through the intersection before our vehicle. The left turn requirement can then be expressed in LTL as (11) IV. EMBEDDED CONTROL SOFTWARE SYNTHESIS The autonomous driving problem above poses a number of challenges for system designers. First, the system includes a tight coupling between computational and physical elements. In addition, the specification is reactive in the sense that the vehicle needs to interact with its environment (e.g., obstacles and other vehicles) and whether it satisfies its specification depends on the behavior of the environments. For example, whether the vehicle exhibits a correct behavior at an intersection depends on the behavior of other vehicles, e.g., which vehicle gets to the intersection first.
A common two-step procedure to the above synthesis problem, as illustrated in Fig. 1, is based on constructing a finite-state abstraction of the underlying physical system (e.g., the motion of the vehicles) and utilizing polynomialtime algorithms for digital design synthesis to synthesize a strategy, represented by a finite state automaton, satisfying high-level specifications. This procedure leads to a hierarchical, two-layer control structure (see Fig. 2) with a discrete planner computing a high-level, discrete plan to be implemented by a low-level, continuous controller. Simulation and bisimulation relations [10] provide a proof that the continuous execution preserves the correctness of the discrete plan. The main limitation of this two-step approach is almost invariably a combinatorial growth of the state space, commonly known as the state explosion problem.
In this section, we provide a brief overview of existing techniques for finite state abstraction of continuous systems and digital design synthesis and a receding-horizon based approach to mitigate the state explosion problem.  Fig. 2. The two-layer control structure. In addition to the components discussed in this section, ∆, which captures uncertainties in the plant model, may be added to make the model more realistic.

A. Finite State Abstraction of Continuous Systems
There are mainly 2 different ways of abstracting a continuous system into a finite transition systems: fixed abstraction and sampling-based approaches. Fixed abstraction is done offline and is based on partitioning the continuous state space into a finite number of equivalence classes or cells ν 1 , . . . , ν N such that the partition is proposition preserving [10]. Roughly speaking, a partition is said to be proposition preserving if for any atomic proposition p ∈ Π and any states v 1 and v 2 that belong to the same cell, v 1 satisfies p if and only if v 2 also satisfies p. Each of ν 1 , . . . , ν N then serves as a state of the finite transition system. We add a transition from ν i to ν j where i, j ∈ {1, . . . , N } if there exists a controller that can bring the system from ν i to ν j while always staying in the union of ν i and ν j .
Several abstraction methods have been proposed based on a fixed abstraction. For example, a continuous-time, timeinvariant model was considered in [11], [12] and [13] for special cases of fully actuated (ṡ(t) = u(t)), kinematic (ṡ(t) = A(s(t))u(t)) and piecewise affine dynamics, respectively, while a discrete-time, time-invariant model was considered in [6] and [14] for special cases of piecewise affine and controllable linear systems, respectively. Discretetime linear time-invariant state space model with exogenous disturbances was considered in [15], [16]. Reference [17] deals with more general dynamics by relaxing the bisimulation requirement and using the notions of approximate simulation and simulation functions [18].
A sampling-based method, in contrast, incrementally constructs a finite state abstraction of a continuous system online [19]. This construction is based on a random sampling procedure, which can be considered as an extension of the Rapidly-exploring Random Trees (RRT) algorithm. This approach has been used in conjunction with incremental model checking to extract a controller that satisfies a given specification. However, as model checking only provides correctness guarantee with respect to the current environment, it remains an ongoing work to apply the sampling-based approach in conjunction with game theoretic synthesis to ensure system correctness in dynamic environments.

B. Digital Design Synthesis: A Two-Player Game Approach
From Definition 6, for a system to be correct, its specification ϕ must be satisfied in all of its executions regardless of the behavior of the environment in which it operates. Thus, the environment can be treated as an adversary and the synthesis problem can be viewed as a two-player game between the system and the environment: the environment attempts to falsify ϕ while the system attempts to satisfy ϕ. We say that ϕ is realizable if the system can satisfy ϕ no matter what the environment does. For a Generalized Reactivity(1) specification, Piterman, et al. shows that checking its realizability and synthesizing the corresponding automaton can be performed in polynomial time [20].
If the specification is realizable, a digital design synthesis tool such as JTLV [20] generates a finite state automaton that represents a set of transitions the system should follow in order to satisfy ϕ. Otherwise (e.g., in the case of conflicting requirements), it provides the set of initial states starting from which there exists a set of moves of the environment such that the system cannot satisfy ϕ. Hence, even though the system may be designed manually, it is important to check the realizability of a given specification prior to the design phase as it informs the system designer whether it is possible at all to design a system that meets the given specification.
The main limitation of the synthesis of finite state automata is the state explosion problem. In the worst case, the resulting automaton may contain all the possible states of the system. For example, if the system has N variables, each can take any value in {1, . . . , M }, then there may be as many as M N nodes in the automaton.

C. Receding Horizon Framework
For systems with a certain structure, the computational complexity of the synthesis problem can be alleviated by solving the problem in a receding horizon fashion, i.e., compute the discrete plan over a shorter horizon, starting from the current state, implement the initial portion of the plan and recompute the plan. This approach essentially reduces the Fig. 3. A graphical description of the receding horizon framework. synthesis problem into a set of smaller problems. The size of these smaller problems depends on the horizon length, which should be made as small as possible, subject to the realizability of the resulting short-horizon specifications as too short horizon may render the specifications unrealizable.
In [7], sufficient conditions that ensure that this receding horizon implementation preserves the desired systemlevel properties are presented. A graphical description of the receding horizon framework is illustrated in Fig. 3. First, we construct a finite state abstraction of the physical system. A partial order relation ϕ between the discrete states ν 1 , . . . , ν N needs to be established such that for any destination state ν k , ν k ≺ ϕ ν i for all i such that ν i is not the destination. The disjoint sets W 0 , . . . , W M can then be constructed such that for any discrete states ν i , ν j ∈ W k , k ∈ {0, . . . , M }, ν i = ϕ ν j and W 0 only contains the destination states. Finally, a map F : {W 0 , . . . , W M } → {W 0 , . . . , W M }, which captures the horizon length, and a receding horizon invariant Φ need to be defined.
The receding horizon approach works as follows. Suppose, for example, that the initial state of the system is ν 1 . Since ν 1 ∈ W 4 , we synthesize an automaton satisfying the shorthorizon specification where (a) the initial state is assumed to be in W 4 and satisfies Φ, (b) the environment is assumed to satisfy the assumptions stated in the original specification, and (c) the original safety properties are satisfied, Φ holds throughout an execution, and the robot eventually reaches a state in F(W 4 ). The robot then executes this automaton until it reaches a state ν j ≺ ϕ ν 1 . At this point, the robot computes an automaton for the short-horizon specification associated with the initial state ν j . This process is then repeated until the robot reaches the destination ν 10 . We refer the reader to [7] for a detailed discussion on this receding horizon framework.

V. EXAMPLE
We consider a road network of Fig. 4. The checkpoint is located on R 1 as marked by a star in Fig. 4(a). First, we apply a fixed abstraction technique and partition the roads into cells such that there are 2 cells across the width of the road, one completely in the right lane and the other completely in the left lane, as shown in Fig. 4(b). It has been shown in [15]  that this is a valid abstraction of the system, provided that the state of the vehicle evolves based on a fully actuated modelẋ(t) = u(t) + w(t) where u(t), w(t) ∈ R 2 are the control effort and disturbance at time t, respectively, with the constraints u(t) ∞ ≤ 1 and w(t) ∞ ≤ 0.1, ∀t ≥ 0. We then transform the specification in Section III-B such that it is written in terms of cells (as opposed to x, y coordinates as in the original specification). In order to make the resulting specification realizable, we impose the following assumptions on the behavior of static obstacles and other vehicles: (1) Our vehicle does not collide with obstacles or other vehicles at the initial state; (2) If our vehicle is on the left lane at the initial state, then there is an obstacle on the right lane; (3) The road is not blocked; (4) Obstacles and other vehicles are always detected before our vehicle gets within 1 cell apart from them; (5) Other vehicles do not collide with obstacles; (6) While our vehicle is moving forward, other vehicles do not collide with our vehicle from behind; (7) When our vehicle stops, other vehicles do not collide with our vehicle; (8) Other vehicles respect the stay in lane rule; (9) Other vehicles move infinitely often; (10) Infinitely often, V eh ns = ∅; and (11) Infinitely often, there is no oncoming traffic on the left lane.
Next, we apply the receding horizon framework. To this end, a software toolbox TuLiP [21] is employed. First, TuLiP verifies that a planning horizon of length 2 cells is sufficiently long and all the resulting short horizon specifications with this horizon are realizable. The partial order relation as well as the map F and the receding horizon invariant can be constructed as in [7]. The finite state automata generated by TuLiP contain between 571 and 2434 states and take between 0.7 and 6.5 seconds to compute on a MacBook Pro with a 2.8 GHz Intel Core 2 Duo processor. Snapshots of a simulation run is shown in Fig. 5 for different scenarios. The video of this run can be accessed at http://dl.dropbox.com/ u/29005314/sim.zip.