Chapter IV: Directive-response Assume-guarantee Contracts for an Auto-
4.3 Mathematical Formulation
Definition 4.3.1(Path). Apathis a continuous map π: [0,1] β R2. π(0)is called the start point of π and π(1) is called the end point of π. For each path π, let πβ : [0,1] β (β180,180] be such that πβ(π ) is the heading angle measured in degrees from the abscissa to π0(π ), the derivative vector of πwith respect toπ . For π‘ β [0,1], let Λπ(π‘) denote the element π(π‘) Γ πβ(π‘)ofR3.
We will denote the set of all paths byPand, by abuse of notation, we will also use πto denote π( [0,1]), the image of [0,1]under π.
Definition 4.3.2 (Curvature feasibility). Given π > 0 and a path π, π -feasible(π) is set to True if and only if π is twice differentiable on [0,1], and its curvature
|det(π0(π ), π00(π )) |
kπ0(π ) k3 < π forπ β [0,1].
Definition 4.3.3 (πΏ-corridor). Let B B {True,False}. If π β P, and πΏ : P Γ [0,1] ΓR3βBis such that the corresponding subset:
ΞπΏ(π) B Γ
π β[0,1]
ΞπΏ(π, π ),
whereΞπΏ(π, π ) B {(π₯ , π¦, π) β R3 | πΏ(π, π ,(π₯ , π¦, π)) = True} such thatΞπΏ(π, π ) is open and contains Λπ(π ), then we say thatΞπΏ(π) is aπΏ-corridorfor π.
AVP World Building Blocks
In this section, we will introduce naming symbols for objects that exist in the AVP world.
Definition 4.3.4(AVP World). TheAVP worldconsists of the following:
1. A distinguished set of indexing symbolsT:={π‘ , π‘0, π‘00, ...} denoting time.
2. A set of typed variablesUto denote actions, states, channels, etc.
3. The following set of constants: C,Gwhere
a) C, a set of symbols, is called the customer set.
b) G, a set of symbols, is called the garage set containing the following constant values:
i. G.ππ π π£ π ππ π_ππ π π β R3, the set of configurations that vehicles are allowed to be in;
ii. G.π€ ππ π π ππ π_ππ π π β R2, the area that pedestrians are allowed to walk on;
iii. G.πππ‘π π¦_πππ π πππ’π ππ‘π πππ β R3, a set of configurations that the customers can deposit their car in;
iv. G.π ππ‘ π’π π_πππ π πππ’π ππ‘π πππ β R3, a set of configurations that the car should be returned in;
v. G. π ππ π πππ_π π ππ‘ π β N, the number of parking spots available in the parking lot;
vi. G.πππ‘ ππ π ππ β R2, the area inside the parking garage.
Directive-Response Message Types
Each channel in the system is associated with a unique message type. The following are all the message types in our AVP system.
1. A(Β·), directive types:
a) A(CustomerInterface) B {Park,Retrieve}, b) A(Supervisor) BR6,
c) A(Planner) B P,
d) A(Tracker) BI β R2, the set of all control inputs.
2. B(Β·), response types:
a) B(CustomerInterface) B {Failed},
b) B(Supervisor) B {Rejected,Accepted,Returned},
c) B(Planner) =B(Tracker) B {Blocked,Failed,Completed}.
For each typeT, we will denote by ΛTthe product typeTΓCwhich will be used to associate a message of type Twith a specific customer inC. In addition, we will useIdto denote the set of message IDs.
Behavior
For each variable π’ β U, we denote by type(π’) thetype of π’, namely, the set of values that it can take. The types of elements ofTare taken to beRβ₯0.
Definition 4.3.5 (Behavior). Let π be an ordered subset of variables in U. A π-behavior is an element of B (π) B (Γ
π§βπ type(π§))Rβ₯0. Given ππ β B (π) and π βT, we will callππ(π)thevaluationofπat timeπ. Ifπ§ β π, we will also denote byπ§(π)the value ofπ§at timeπ.
Note that each behavior inπ β Ucan be βliftedβ to a set of behaviors inUby letting variables that are not contained in π assume all possible values in their domains.
Additionally, the set of behaviorsB (π)can be lifted to a set of behaviors in B (U) in a similar way. To ease notational burden for the reader, we will take the liberty of not explicitly making any reference to the βliftingβ operation when they are in use unless there is any ambiguity that may result from doing so.
Definition 4.3.6(Constraint). A constraint π on a set of variables π is a function that maps each behavior of π to an element of B, the Boolean domain. In other words,π βBB (π).
Note that by βliftingβ, a constraint on a set of variablesπ is also a constraint onU. Definition 4.3.7(Channel variables). For each componentπand another component π, we can define two types ofchannel variables:
β’ πβπ, denoting an incoming information flow fromπ to π,
β’ πβπ, denoting an outcoming information flow from π toπ.
In this work, we assume thatπβπ is always identical toπβπ. Each channel variable must have a well-defined message type and each message π has an ID denoted by id(π) β Id. If the message has valueπ£, then we will denote it by[π£ ,id(π)], but we will often refer to it as[π£]whereby we omit the ID part to simplify the presentation.
Intuitively, given a behavior, a channel variableπ₯is a function that maps each time step to the message the associated channel is broadcasting at that time step.
Definition 4.3.8(System). Asystemπ consists of a set of each of the following 1. internal variables/constants varππ,
2. output channel variables varππ, 3. input channel variables varππ,
4. constraints conπ on varππ βͺvarππβͺvarππ.
A behavior of a system π is an element of the set of behaviors that correspond to varππ βͺvarππβͺvarππ subject to conπ. This is denoted byB (π).
Directive-response
Before introducing directive-response systems, for any predicatesπ΄andπ΅, we define the following syntax:
π΄ { π΅ Bβπ‘ :: π΄(π‘) β βπ‘0β₯ π‘ :: π΅(π‘0). (βleads toβ) π΄ π΅ Bβπ‘ :: π΅(π‘) β βπ‘0 β€π‘ :: π΄(π‘0). (βprecedesβ) β₯π‘π΄ Bβπ‘0β₯ π‘ :: π΄(π‘0). (βalways fromπ‘β) starts_at(π΄, π‘) B π΄(π‘) β§ βπ‘0< π‘ ::Β¬π΄(π‘0). (4.1) Ifπ is a set-valued variable, then we define
persistent(π) Bβπ‘ ::βπ ::π β π(π‘) β β₯π‘(π β π). (4.2) Definition 4.3.9 (Directive-response system). A directive-response system π is a system such that for each output (resp., input) channel variable π βππ there is an internal variablesendπ βππ (resp.,receiveπ βππ) whose domain is a collection of sets of messages that are of the type associated withπ βππ. Ifπ βππis an output channel variable, there is a causality constraintππ βππ βconπ defined by
ππ βππ Bπ βsendπ π =π βππ. (4.3)
That is, a message must be sent before it shows in the channel. Otherwise ifπ βππ is an input channel variable, then
ππ βππ B π =π βππ π βreceiveπ βππ. (4.4)
Namely, a message cannot be received before it is broadcasted.
Definition 4.3.10(Lossless directive-response system). A lossless directive-response system is a directive-response system such that ifπ βππ is an output channel, then
persistent(sendπ βππ) β§ (π βsendπ βππ {π =π βππ), (4.5) and ifπ βππis an input channel
persistent(receiveπ βππ) β§ (π=π βππ { π βreceiveπ βππ). (4.6) Definition 4.3.11(Assume-guarantee contracts for directive-response systems). An assume-guarantee contract C for a directive-response system π consists of a pair of behaviors π΄, πΊ of π and denoted byC = (π΄, πΊ). An environment forC is any set of all behaviors that are contained in π΄while an implementation ofCis any set of behaviors that is contained in π΄ βπΊ. Cis said to be saturated if the guarantee part satisfiesπΊ = (Β¬π΄β¨πΊ) = (π΄βπΊ).
Note that any contract can be converted to the saturated form without changing its sets of environments and implementations. The saturated form is useful in making contract algebra less cumbersome in general. If π is a system, then we say π satisfies Cif B (π) β (π΄ β πΊ). Furthermore, the system composition π1Γ π2 ofπ1andπ2is a system whose behavior is equal toB (π1) β© B (π2).
Definition 4.3.12 (Customer). A customer is an element of C. Corresponding to eachπ β Cis a set ofU variables var(π) that includeπ .π₯, π . π¦ (the coordinates of the customer him/herself), π .πππ .π₯, π .πππ . π¦, π .πππ .π (the coordinates and heading of the customerβs car), π .πππ . βπ ππ π‘ β π¦, whether the car is healthy, π .ππππ‘π ππ π .π£, π .ππππ‘π ππ π . π(the velocity and steering inputs to the vehicle),π .πππ .β(the length of the car),π .πππ .π‘ ππ€ π π (whether the car is being towed). We will use the shorthand π .πππ .π π‘ ππ‘ πto mean the 3-tuple (π .πππ .π₯ , π .πππ . π¦, π .πππ .π).
For each behavior inB (U), we require eachπ βCfor whichπ .πππ .π‘ ππ€ π πisFalse to satisfy the following constraints that describe the Dubins car model:
π(π .πππ .π₯) π π‘
(π‘) =π .ππππ‘π ππ π .π£(π‘)cos(π .πππ .π(π‘)) π(π .πππ . π¦)
π π‘
(π‘) =π .ππππ‘π ππ π .π£(π‘)sin(π .πππ .π(π‘)) π(π .πππ .π)
π π‘
(π‘) = π .ππππ‘π ππ π .π£(π‘) π .πππ .β
tan(π .ππππ‘π ππ π . π(π‘)).
(4.7)
Table 4.1: CustomerInterfacedirective-response system.
Internal variables/constantsvarπ
C The set of all customers in the AVP world.
Outputsvarπ
CustomerInterfaceβSupervisor An output channel of type ΛA(CustomerInterface). Inputsvarπ
CustomerInterfaceβSupervisor An input channel of type ΛB(Supervisor).
CustomerInterfaceβTracker An input channel of type ΛA(Tracker).
Constraintsconπ
Vehicle dynamics See (4.7)
Car and pedestrian limits (4.8) and (4.9).
AVP System
By treating theCustomerInterfaceas an external component, the AVP system con- sists of three internal components: Supervisor, Planner, and Tracker. These systems are described below.
CustomerInterface
The environment in which the system shall operate consists of the customers and the pedestrians which we will call a CustomerInterface. A customer drops off the car at the drop-off location and is assumed to make a request for the parked car back from the garage eventually. The pedestrians are also controlled by the environment.
When a pedestrian was generated by the environment, they start walking on the crosswalks. Pedestrians are confined to the pedestrian path, meaning they will not leave the crosswalk and walkway areas and their dynamics are continuous, meaning no sudden jumps. The cars move according to their specified dynamics. This includes a breaking distance depending on their velocity and maximum allowed curvature. For a formal description, refer to Table 4.1. Below are some constraints we impose on this module.
βπ βC::(π£min β€ π .ππππ‘π ππ π .π£β§π .ππππ‘π ππ π .π£ β€ π£max
β§πmin β€ π .ππππ‘π ππ π . πβ§π .ππππ‘π ππ π . π β€ πmax) (4.8)
βπβC::βπ .
π(π .π₯) π π‘
(π ),
π(π . π¦) π π‘
(π )
β€ π£π π π ,max. (4.9) Supervisor
A Supervisor component is responsible for the high level decision making in the process. It receives theCustomerInterface: requests and processes them by sending
Table 4.2: Supervisordirective-response system.
Internal variables/constantsvarπ
G.β AllGobjects.
ππ’π_π ππ‘π π£ π_ππ’ π π‘ ππ ππ π The number of cars currently being served in the parking lot.
Outputsvarπ
SupervisorβCustomerInterface An output channel of type ΛB(Supervisor).
SupervisorβPlanner An output channel of type ΛA(Supervisor).
Inputsvarπ
SupervisorβCustomerInterface An input channel of type ΛA(CustomerInterface). SupervisorβPlanner An input channel of type ΛB(Planner).
Constraintsconπ
Parking lot topology Any specific geometric constraints onG.β.
Number of active customers ππ’π_π ππ‘π π£ π_ππ’ π π‘ ππ ππ π must be equal to the num- ber of cars that have been accepted but not yet left the parking lot.
Table 4.3: Plannerdirective-response system.
Interval variables/constantsvarπ
G.β AllGobjects.
{π .πππ .π₯ , π .πππ . π¦, π .πππ .π|πβC} The configurations of all cars in AVP world.
π Maximum allowable curvature.
Outputsvarπ
PlannerβSupervisor An output channel of type ΛB(Planner).
PlannerβTracker An output channel of type ΛA(Planner).
Inputsvarπ
PlannerβSupervisor An input channel of type ΛA(Supervisor).
PlannerβTracker An input channel of type ΛB(Tracker).
Constraintsconπ
Parking lot topology Any specific geometric constraints onG.β.
π Maximum allowable curvature given car dynamics
and input constraints.
the appropriate directives to thePlannerto fulfill a task. ASupervisordetermines whether a car can be accepted into the garage or rejected. It also receives responses from thePlanner. ASupervisoris to be aware of the reachability, the vacancy, and occupied spaces in the lot, as well as the parking lot layout. Formally, aSupervisor is a lossless directive-response system described by Table 4.2.
Planner
A Planner system receives directives from the Supervisor to make a car reach a specific location in the parking lot. APlannersystem may have access to a planning graph determined from the parking lot layout, and thus can generate executable trajectories for the cars to follow. ThePlanneris aware of the locations of the agents and the obstacles in the parking lot from the camera system. APlanneris a lossless directive-response system described by Table 4.3.
Table 4.4: Trackerdirective-response system.
Interval variables/constantsvarπ
πΏ Corridor map.
πmin, π ππ Minimum safety distance to other cars.
πmin, π ππ ππ π Minimum safety distance to pedestrians.
Outputsvarπ
TrackerβPlanner An output channel of type ΛB(Tracker).
TrackerβCustomerInterface An output channel of type ΛA(Tracker).
Inputsvarπ
TrackerβPlanner An input channel of type ΛA(Planner).
Constraintsconπ
Corridor constraints In our implementation, we define theπΏ-corridor for any pathπto be the open set containing points whose distance to the closest point inπdoes not exceed 3 meters.
πmin, π ππ,πmin, π ππ ππ π These values are determined based on the dynamics and the uncertaintyΞπΆ ππ.
l Figure 4.2: Contracts between the components of the AVP system.
Tracker
A Tracker system is responsible for the safe control of cars that are accepted into the garage by a Supervisor. It receives directives from a Planner consisting of executable paths to track and send responses based on the task status to aPlanner.
See Table 4.4.