Flow-Based Synthesis of Reactive Tests for Discrete Decision-Making Systems with Temporal Logic Specifications
Abstract
Designing tests to evaluate if a given autonomous system satisfies complex specifications is challenging due to the complexity of these systems. This work proposes a flow-based approach for reactive test synthesis from temporal logic specifications, enabling the synthesis of test environments consisting of static and reactive obstacles and dynamic test agents. The temporal logic specifications describe desired test behavior, including system requirements as well as a test objective that is not revealed to the system. The synthesized test strategy places restrictions on system actions in reaction to the system state. The tests are minimally restrictive and accomplish the test objective while ensuring realizability of the system’s objective without aiding it (semi-cooperative setting). Automata theory and flow networks are leveraged to formulate a mixed-integer linear program (MILP) to synthesize the test strategy. For a dynamic test agent, the agent strategy is synthesized for a GR(1) specification constructed from the solution of the MILP. If the specification is unrealizable by the dynamics of the test agent, a counterexample-guided approach is used to resolve the MILP until a strategy is found. This flow-based, reactive test synthesis is conducted offline and is agnostic to the system controller. Finally, the resulting test strategy is demonstrated in simulation and experimentally on a pair of quadrupedal robots for a variety of specifications.
Index Terms:
Test and Evaluation, Reactive Test Synthesis, Formal Methods, Network Flows, OptimizationI Introduction
![Refer to caption](x1.png)
Safety is imperative for a wide range of autonomous systems, from self-driving vehicles, to autonomous flight and space missions, to assistive robotics, and medical devices. To ensure safety, various challenges need to be addressed [1]. For example, these systems need to be aware of their own state and adapt their behavior in response to the environment, which requires reasoning over both discrete and continuous inputs and states. Deployment of these safety-critical autonomous systems requires thorough testing, both in simulation and in the operating environment, which is crucial to validating the system’s performance. Typically, test cases are designed to uncover bugs and corner cases in the system design that lead to safety-critical errors. However, for these tests to be successful, executing them requires setting up a test environment that is consistent with the test case while also allowing for correct system implementations. To make this process efficient, it is equally important to automatically synthesize these test environments for the desired test case, i.e., automatically synthesize test environments that reveal corner cases.
In this work, we focus on synthesizing test environments (e.g., placement of obstacles, agent strategies) to test the discrete decision-making logic in an autonomous system. Tests are synthesized from temporal logic descriptions of desired test behavior which encodes aspects of the test unknown to the system (test objective) in addition to the system requirements (system objective). The test objective is meant to capture the “challenging” aspect of the test in terms of high-level decision-making, and is not revealed to the system. The purpose of testing is to check that the system can take correct decisions despite being given opportunities to fail, i.e., verify correct decision in the presence of “hard tests” or corner cases. Our framework routes the system to the test objective while also giving the system freedom to make decisions and ensuring that the test is fair (i.e., system can satisfy its requirements if it makes correct decisions). Therefore, we synthesize tests that minimally restrict the system’s decision-making to realize the desired test behavior. Fig. 1 provides an overview of the flow-based test synthesis framework.
I-A Background on Test and Evaluation
Tests are typically manually designed by test engineers — identifying challenging test cases and manually constructing the test environments either from expert experience or failure reports. Examples of this include the qualification tests in the DARPA Urban Challenge, track testing by self-driving car companies [2, 3], and constructing test scenarios in simulation using tools such as CARLA [4] or Scenic [5], for which test engineers either partially specify the scenarios or recreate them from crash reports [6, 7, 3]. Due to the time-intensive nature of this endeavor, automatically finding challenging tests for safety-critical systems is an active area of research [8, 9]. For self-driving vehicles, there is ongoing effort to standardize the testing process [10, 11].
Black-box optimization algorithms [12] and reinforcement learning [13, 14] have been used to search over a specified input domain to find a falsifying input that leads to a trajectory that violates a metric of mission success. This metric can be derived from formal temporal logic specifications [15, 16, 17, 18, 19, 20, 21] or from control barrier functions [22]. However, falsification algorithms typically require a well-defined test environment, and find a falsifying trace by fine-tuning the parameters in that scenario. The framework proposed in this paper is complementary to these approaches — our focus is on synthesizing high-level strategies for the test environment, and continuous parameters of the synthesized test environment (e.g., continuous pose values of test agents, friction coefficients, exact timing of events) can be inputs to falsification algorithms for fine-tuning.
Typically, high-level choices of autonomous robotic systems exhibit discrete decision-making [23, 24]. The use of linear temporal logic (LTL) model checkers for testing has been explored in [25, 26, 27, 28]. In these works, counterexamples from model-checking are used to construct test cases for deterministic systems and are inconclusive if the system behavior deviates from the expected test case. However, since robotic systems are often reactive, and because we want to generate tests without specific knowledge of the system controller, the generated tests must be able to adapt or react to system behavior at runtime. Our test synthesis procedure is gray-box in the sense that it requires knowledge of a nondeterministic model of the system but is agnostic to the high-level controller of the system and is completely black-box to models and controllers at lower levels of abstraction.
Adaptive specification-based testing using discrete logics has been explored in [29, 30, 31, 32, 33]. Particularly in [29], an adaptive test strategy is synthesized using reactive synthesis [34] from LTL specifications of the system and the fault model, both of which are specified by the test engineer. This adaptive test strategy ensures that the resulting test trace demonstrates a fault if the system implementation is faulty according to the fault model. However, these fault models must be carefully specified over the outputs of the system. While this is incredibly useful for specifying and catching sub-system level faults, it becomes intractable for specifying complex system-level faults resulting from multiple outputs. Our test synthesis framework is also specification-based and adaptive, but we specify desired test behavior in the form of test objectives instead of specifying system-level faults. Furthermore, in [29], the adaptive test strategies are synthesized from fault models that are designed for coverage goals corresponding to specification coverage, without accounting for the freedom of the system to satisfy its own requirements. We seek to synthesize reactive test strategies that demonstrate the test objective while placing minimal restrictions on the system. The automata-theoretic tools used in this paper build on concepts used in correct-by-construction synthesis and model checking [35, 36]. This background is covered in Section II.
In [37], testing of reactive systems was introduced as a game between two players, where the tester and the system try to reveal and hide faults, respectively. Similarly, in [38] the test strategy is found by reasoning over a game graph to optimize reachability and coverage metrics. Testing in cooperative game settings has been explored in [39, 40]. However, the reactive test synthesis problem we consider is neither fully adversarial nor fully cooperative — a well-designed system is cooperative with the test environment in realizing the system objective, but since the system is agnostic to test objective, it need not cooperate with the test environment in realizing it.
We consider test environments that can consist of the following: static obstacles that restrict the system throughout the test, reactive obstacles and a dynamic test agent that is reactive to system behavior at runtime. In particular, we leverage flow networks to pose the test synthesis problem as a mixed-integer linear program (MILP). In recent years, network flow optimization frameworks with tight convex relaxations have led to massive computational speed-ups in solving robot motion planning problems [41, 42]. Network flow-based mixed integer programs have also been to synthesize playable game levels in video games [43], which was then applied to construct playable scenarios in robotics settings [44].
In previous work [45], we formulated this problem in a semi-cooperative setting as a min-max Stackelberg game with coupled constraints. Despite being defined over continuous variables with an affine objective and affine constraints, the prior formulation resulted in slow runtimes and did not guarantee that the optimal solution would realize the test objective. Furthermore, it could only reactively restrict system actions, and did not characterize how to translate these restrictions to the choice of a test agent strategy. In this work, we present a simpler formulation of the routing optimization as an MILP, which led to an improvement in runtime. Test strategies from optimal solutions of the MILP are guaranteed to realize the test objective in a least restrictive fashion. Finally, we present a formal approach to restricting system actions in the form of static/reactive obstacles and dynamic test agent strategies, including a counterexample-guided approach to synthesize a test agent strategy from the solution of the routing optimization.
I-B Contributions
In this work, we study the problem of synthesizing a reactive test strategy for a test environment for discrete decision-making systems given a formal test objective, unknown to the system under test. In particular, we ask whether such a test strategy exists without making it impossible for the system to meet its specification.
To obtain the main results of this paper, we first characterize system and test objectives using a variety of specification patterns commonly used in robotic missions [46]. We formalize both the restrictiveness and the feasibility of a test strategy, i.e., a system should have freedom to make decisions and a correct system should be able to pass the test. Secondly, these conditions are translated into a routing optimization on a flow network to capture the requirement that all test executions that satisfy the system objective should demonstrate the test objective. For each test environment, we set up an MILP to find cuts, corresponding to restrictions on system actions, on the flow network. For static and reactive obstacles, the solution of the MILP is realized in the form of an obstacle placement test strategy. We prove that the optimal solutions to the MILPs solve the aforementioned routing requirement. Third, in the case of dynamic agents, we match the restrictions on system actions to a test agent strategy via GR(1) synthesis [35, 47]. Furthermore, we use a counterexample-guided approach to exclude unrealizable solutions from the MILP until we find a realizable test agent strategy. We prove that test agent strategies synthesized in this manner exactly correspond to the test strategy found from the MILP. In the extended version, we prove that the routing problem is NP-hard via a reduction from 3-SAT. Despite this, our framework can reliably handle medium-sized problems with thousands of integer variables. Empirical runtimes for parametrized problems are also provided.
Finally, the test synthesis framework is demonstrated on simulated grid world settings and on hardware with a pair of quadrupedal robots. For all experiments, our framework synthesizes test strategies that place the fewest possible restrictions on the system over the course of the test either by obstacle placement or a dynamic agent. In experiments with reactive obstacles and dynamic agents, the reactive test strategy results in a different test execution depending on system behavior. Despite this, the system is always routed through the test objective (e.g., being put in low-fuel state or having to walk over challenging terrain).
II Preliminaries
This section introduces concepts from automata theory and network flows that are relevant to this work.
II-A Automata Theory and Temporal Logic
Definition 1 (Finite Transition System).
A finite transition system (FTS) is the tuple
where denotes a finite set of states, is a finite set of actions, the transition relation, the set of initial states, the set of atomic propositions, and denotes the labeling function. We denote the transitions in as . We refer to the states of as , and similarly denote the other elements of the tuple. An execution is an infinite sequence , where and is the state at time . We denote the finite prefix of the trace up to the current time as . A strategy is a function .
Definition 2 (System).
The system under test is modeled as a finite transition system with a single initial state, that is, . Furthermore, at least one of the system states is terminal (i.e., no outgoing edges).
The system designers provide the states , actions , transitions , and a set of possible initial conditions , set of atomic propositions, and a corresponding label function . We require a unique initial condition to synthesize the test. If the test designer wishes to select an initial condition, then they can synthesize the test for each and choose accordingly. In addition to , the test designer can choose additional atomic propositions and define a corresponding labeling function , where . For test synthesis, the system model is is defined for the specific initial condition chosen by the test designer. The terminal state is used for defining test termination when the system satisfies its objective.
Assumption 1.
Except for sink states, transitions between states of the system are bidirectional: where is not a terminal state, we also have .
This assumption is for a simpler presentation, and the framework can be extended to transition systems without this assumption (see Remark 7).
Definition 3 (Test Harness).
A test harness is used to constrain a state-action pair of the system in the sense that the system is prevented from taking action from state . Let the actions denote the subset of system actions that can be restricted by the test harness. The test harness maps states of the transition system to actions that can be restricted from that state.
In the examples in this paper, every state of the system has a self-loop transition corresponding to stay-in-place action, but the proposed framework does not require this. Note that in our examples, does not contain self-loop actions.
Definition 4 (Test Environment).
The test environment consists of one or more of the following: static obstacles, reactive obstacles, and dynamic test agents. A static obstacle on is a restriction on the system transition that remains in place for the entire duration of the test. A reactive obstacle on is a temporary restriction on the system transition that can be enabled/disabled over the course of the test. A dynamic test agent can occupy states in , thus restricting the system from entering the occupied state.
In this work, we synthesize tests for high-level decision-making components of the system under test and therefore model it as a discrete-state system. Linear temporal logic (LTL) has been effective in formally specifying safety and liveness requirements for discrete-decision making [48, 49, 50]. For our problem, we use LTL to capture the system and test objectives.
Definition 5 (Linear Temporal Logic [36]).
Linear temporal logic (LTL) is a temporal logic specification language that allows reasoning over linear-time trace properties. The syntax of LTL is given as:
with , where is the set of atomic propositions, (conjunction) and (negation) are the Boolean connectors from which other Boolean connectives such as can be defined, and (next) and (until) are temporal operators. Let be an LTL formula over . We can define the operators (eventually) and (always) as and . For an execution and an LTL formula , iff holds at of . More formally, the semantics of LTL formula are inductively defined over an execution as follows,
-
for , iff evaluates to True at ,
-
iff and ,
-
iff ,
-
iff , and
-
iff and , for all .
An execution/trace satisfies formula , denoted by , iff . A strategy is correct (satisfies formula ), if the trace resulting from the strategy satisfies .
Every LTL formula can be transformed into an equivalent non-deterministic Büchi automaton, which can then be converted to a deterministic Büchi automaton [36].
Definition 6 (Deterministic Büchi Automaton).
A non-deterministic Büchi automaton (NBA) [51, 36] is a tuple where denotes the states, is the set of alphabet for the set of atomic propositions , denotes the transition function, represents the initial states, and is the set of acceptance states. The automaton is a deterministic Büchi automaton (DBA) iff and for all and .
Remark 1.
We use deterministic Büchi automata since each input word corresponding to an execution should have a unique run on the automaton. While there are several different automata representations, deterministic Büchi automata are a natural choice for LTL specifications.
A product of two deterministic Büchi automata, and over the alphabet , is defined as , with states , initial state , acceptance states . The transition relation is defined as follows, for all , for all , where and .
The desired test behavior can be captured via sub-tasks that are defined over atomic propositions . Table I lists the sub-task specification patterns that are considered. These specification patterns are commonly used to specify robotic missions [46]. The desired test behavior is characterized by the system and test objectives, defined over the set of atomic propositions that can be evaluated on system states .
Name | Formula | |
Visit | \collectcell(s1)q:reach_spec\endcollectcell | |
Sequenced Visit | \collectcell(s2)q:sequence_reach_spec\endcollectcell | |
Safety | \collectcell(s3)q:safe_spec\endcollectcell | |
Instantaneous Reaction | \collectcell(s4)q:instant_reaction_spec\endcollectcell | |
Delayed Reaction | \collectcell(s5)q:delayed_reaction_spec\endcollectcell |
Definition 7 (Test Objective).
The test objective consists of at least one visit or sequenced visit sub-task or a conjunction of these sub-tasks. The Büchi automaton corresponds to the test objective .
Definition 8 (System Objective).
The system objective consists of at least one visit or sequenced visit sub-task. The final visit proposition should be a terminal state of the system. In addition, it can also contain some conjuction of safety, instantaneous and/or delayed reaction, and visit and/or sequenced visit sub-tasks. The Büchi automaton corresponds to the system objective . We say that the system reaches its goal or that the test execution satisfies the system objective if the system trace is accepted .
Typically, some aspects of a test are not revealed to the system until test time such as testing the persistence of a robot or prompting it to exhibit a difficult maneuver by placing obstacles in its path. This is formalized as a test objective which is not known to the system. In contrast, the system is aware of the system objective, which captures its requirements. For example, to test for safety, the system should know to avoid unsafe areas (sLABEL:eq:safe_spec). To test a reaction, , the system needs to be aware of the reaction requirement (sLABEL:eq:instant_reaction_spec), and the test objective needs to contain the corresponding visit requirement to trigger the reaction. Furthermore, the test objective can contain standalone reachability (visit and/or sequenced visit) sub-tasks that are not associated with a system reaction sub-task, but require the system to reach/visit certain states. The test objective is accomplished by restricting system actions in reaction to the system state.
In addition to the system objective, the system must interact safely with the test environment. The system must also obey the initial condition set by the test designer. For each obstacle/agent of the test environment, the system controller must respect the corresponding restrictions on its actions (i.e., cannot crash into obstacles/agents). Furthermore, for a valid system implementation, all lower-level planners and controllers of the system must simulate transitions on .
Definition 9 (System Guarantees).
The system guarantees are a conjunction of the system objective, initial condition, safe interaction with the test environment, and a system implementation respecting the model .
Definition 10 (System Assumptions).
The system assumes that the test environment satisfies the following conditions:
A1. The test environment can consist of: i) static obstacles (e.g., wall), ii) reactive obstacles (e.g., door), and iii) test agents whose dynamics are provided to the system.
A2. The test environment will not take any action that will inevitably lead to unsafe behavior (e.g., not restricting a system action after the system has committed to it, test agents not colliding into the system).
A3. The test environment will not take any action that will inevitably block all paths for the system to reach its goal (e.g., restrictions will not completely the enclose the system or block it from progressing to its goal).
A4. If the system and test environment are in a livelock, the system will have the option to break the livelock and take a different path toward its goal.
A correct system strategy satisfies the system guarantees when the test environment satisfies the system assumptions. This full system specification cannot always be expressed as an LTL formula. This is because, in an LTL synthesis setting, the system can assume that the test environment can behave in a worst-case manner and will never synthesize a satisfying controller. However, the system can assume that the test environment will always ensure that a path to achieving the system specification remains. For many examples, expressing that a satisfying path exists is not possible in LTL.
Definition 11 (Specification Product).
The specification product is the product , where is the Büchi automaton corresponding to the system specification, and is the Büchi automaton corresponding to the test objective. The states , where and , capture the event-based progression of the test and are referred to as history variables.
The system reaching its goal would typically mark the end of a test execution. However, the test engineer can also decide to terminate the test if the system appears to be stuck or enters an unsafe state. Tests that are terminated prematurely might result in inconclusive results [52], so we rely on the test engineer to determine the termination condition. We assume that the test engineer gives the system a reasonable amount of time to complete the test. Upon test termination in state , we augment the trace with the infinite suffix for evaluation purposes.
Remark 2.
As tests have a defined start and end point, we need to bridge the gap between the finiteness of test executions and the infinite traces that are needed to evaluate LTL formulae. Augmenting the trace with the infinite suffix allows us to leverage useful tools available for LTL. Other research on interpreting LTL over finite traces can be found in [29, 53, 54].
Remark 3.
Example 1.
The system under test can transition (N-S-E-W) on the grid world as illustrated in Fig. 2. The initial condition of the system is marked by , and the system is required to visit one of the terminal goal states marked by , . The test objective is to observe the system visit at least one of the states before the system reaches its goal, encoded as .
Example 2.
In this example, the system under test can transition (N-S-E-W) on the grid world as illustrated in Fig. 2. The initial condition of the system is marked by , and the system objective is to visit terminal state , . The test objective is to observe the system visit states and : . The corresponding Büchi automata are illustrated in Fig. 3.
The synchronous product operator is used to construct a product of a transition system and a Büchi automaton. In particular, we will use this operator to construct the virtual product graph and the system product graph (see Section III).
Definition 12 (Synchronous Product).
The synchronous product of a DBA and a FTS , where the alphabet of is the labels of , is the transition system , where:
We denote the transitions in as . An infinite sequence on corresponds to a state-history trace . We refer to as the state-history pair and define the corresponding path to be the finite prefix: .
II-B Network Flows
Definition 13 (Flow Network [55]).
A flow network is a tuple , where denotes the set of nodes, the set of edges excluding self-loops, the source nodes, and the sink nodes. We assume unit capacity for all edges. On the flow network , we can define the flow vector to satisfy the following constraints: i) the capacity constraint
(6) |
ii) the conservation constraint
(7) |
iii) no flow into the source or out of the sink
(8) |
The flow value on the network is defined as
(9) |
III Problem Statement
In this section, we will state the test environment synthesis problem. The test engineer provides a system objective and a test objective, which describes the desired test behavior. Then, we find a reactive test strategy for which every test execution that satisfies the system objective also satisfies the test objective.
Definition 14 (Reactive Test Strategy).
A reactive test strategy defines the set of restricted system actions at each state during its execution . For some finite prefix of execution starting from initial state , is the set of actions that the system cannot take from state . A test environment is said to realize a reactive test strategy if it restricts system actions according to .
Let be the set of all finite prefixes of system traces. At each time step , a correct system strategy must pick from available actions at state . The resulting execution is denoted as .
Remark 4.
Note that the test environment externally blocks system transitions, and as a consequence, restricts corresponding actions that the system can safely take. When actions are restricted by the test environment, the system strategy should select from the available actions at each state. Since these restrictions can be placed during the test execution, the system might have to re-plan and choose a different action than originally planned.
Definition 15 (Feasibility of a Test Strategy).
Given a test environment, system , system and test objectives, and , a reactive test strategy is said to be feasible iff: i) the test environment can realize , ii) there exists a correct system strategy , and iii) any execution corresponding to a correct satisfies the system and test objectives: .
Note that the test strategy is not aiding the system in achieving the system objective; it only restricts system actions such that the test objective is realized. That is, the system is free to choose an incorrect strategy, in which case there are no guarantees. Furthermore, the test strategy should allow the system to make multiple decisions at each step of the execution, if possible, as opposed to leaving a single allowed action. For any system trace , every finite prefix of maps to a history variable . For each , we can define a corresponding state-history trace , where history variable at time step corresponds to the prefix of of . From now on, we will refer to and the associated as the test execution, and clarify the context if necessary.
Definition 16 (Restrictiveness of a Test Strategy).
State-history traces and are unique if they do not share any consecutive state-history pairs. For a feasible , let be the set of all executions corresponding to correct system strategies, and let be the set of all state-history traces corresponding to . Let be a set of unique state-history traces. A test strategy is least restrictive if the cardinality of is maximized.
Remark 5.
Note that the set of all state history traces can be infinite. However, the set is finite because: i) the system has a finite number of states and the specification product has a finite number of history variables, and ii) every state-history trace in is unique with respect to any other trace in .
Problem 1 (Finding a Reactive Test Strategy).
Given a high-level abstraction of the system model , test harness , system objective , test objective , find a feasible, reactive test strategy that is least restrictive.
The restrictions on system actions placed by the test strategy can be realized in several ways in the test environment. For example, a dynamic test agent, together with any static obstacles, can be used to enforce the test strategy. This leads to the second problem of synthesizing a reactive strategy for a test agent to realize the test strategy. That is, at each time step of the test execution, the test environment consisting of an agent and static obstacles restricts the system actions according to .
Problem 2 (Reactive Test Agent Strategy Synthesis).
Given a high-level abstraction of the system model , test harness , system objective , test objective , and a test agent modeled by transition system . Find the test agent strategy and the set of static obstacles that: i) satisfy the system’s assumptions on its environment, and ii) realize a reactive test strategy that is least-restrictive and feasible.
IV Graph Construction
To reason about executions of the system in relation to the system and test objectives, we leverage automata theory to construct the following graphs.
Definition 17 (Virtual Product Graph and System Product Graph).
A virtual product graph is the product transition system . Similarly, the system product graph is defined as .
The virtual product graph tracks the test execution in relation to both the system and test objectives while the system product graph tracks the system objective. We will find the restrictions on system actions on , while represents the system’s perspective concerning the system objective during the test execution. For each node , we denote the corresponding state in as . Similarly, the state corresponding to is denoted by . For practical implementation, we remove nodes on the product graphs that are not reachable from the corresponding initial states, or .
Definition 18 (Projection).
We map states from to using the projection as
(10) |
These projections help us to reason about how restrictions found on map to the system and the system product graph . We can now define the edges on that we can restrict with the test harness as follows,
(11) |
Lemma 1.
For every path on , there exists at least one corresponding path on .
Proof.
Suppose there exists some such that is a path on . Then, by construction, there exists a path on where maps to for all . ∎
Paths on the virtual product graph correspond to possible test executions. We identify the nodes on that capture the acceptance conditions for the system and test objectives.
Definition 19 (Source, Intermediate, and Target Nodes).
The source node represents the initial condition of the system. The intermediate nodes correspond to system states in which the test objective acceptance conditions are met. Finally, the target nodes represent the system states for which the acceptance condition for the system objective is satisfied. Formally, these nodes are defined as follows,
In addition, we define the set of states corresponding to the system acceptance condition on as .
Proposition 1.
Every test execution corresponds to a path on where . The corresponding system trace satisfies the system objective, iff . Furthermore, if , then the path contains a state-history pair for some .
Provided that there exists a path on from to , identifying a feasible reactive test strategy corresponds to identifying edges to cut on . These edge cuts correspond to restricted system actions. In particular, these edge cuts are such that all paths on from source to target visit the intermediate .
V Network Flow Optimization for Identifying Restrictions on System Actions
To identify which edges to cut on , we use network flow optimization, a commonly used paradigm for flow-cut problems on graphs. On , which characterizes all possible test executions, all paths from the initial condition to the system goal must be routed through the intermediate . Furthermore, the edge cuts should be least-restrictive and such that the system can satisfy the test objective and system objective. Maximum flow can be a proxy for freedom of the system under test to make decisions — a higher network flow corresponds to more unique paths on . Since we use flow networks with unit edge capacities, a realization of maximum flow corresponds to a set of paths that do not share an edge. Furthermore, this flow should be achieved with the fewest possible cuts to not unnecessarily restrict system actions. A high network flow with the minimum possible edge cuts corresponds to a least restrictive test for the system.
V-A Optimization Setup
We define the flow network , where , , source and target nodes correspond to and , with the corresponding flow . For simplicity, we use the same notation to refer to nodes and edges on the graph and the corresponding flow network. The Boolean edge cut vector represents whether edges are cut or not. That is, refers to edge being cut, and implies that edge is not cut,
(c1) |
The edges into and out of the intermediate nodes are denoted as . To solve Problem 1, we formulate a mixed-integer linear program (MILP).
Objective. To find the least restrictive test, we want to maximize the system’s freedom in satisfying the test objective. To capture this, we optimize for edge cuts that maximize the flow value on . However, a realization of maximum flow on a network is not unique. To ensure that we do not cut any edges unnecessarily, we subtract the sum of the edge cuts from the flow value:
(12) |
The regularizer on the sum of edge cuts is chosen such that it will not compete with the maximum flow value on the network. The weighted sum is always between and , and binary edge cuts and unit capacity will always result in maximum flow being integer-valued. Thus, the optimization will always favor increasing the maximum flow value rather than reducing edge cuts.
Network flow constraints. First, the network flow optimization is subject to the following standard constraints on flow :
(c2) |
An edge that is cut restricts flow completely, while an edge that is not cut may or may not have flow,
(c3) |
Partition constraints. The following constraints ensure that all flow across the network will be routed through . To accomplish this, we adapt the partitioning conditions given in [56] as follows. Except for the nodes, we divide the remaining nodes into two groups defined by the partition variable , and ensure that the nodes belong to one group, and belong to the other:
(c4) |
The two groups are partitioned by the edge cut vector , where this constraint is only defined over the edges that do not go into or out of nodes in ,
(c5) |
Feasibility constraints. To ensure that the test is not impossible from the system’s perspective, we map restrictions found on to via the following feasibility constraints. For each history variable , we define the set of state-history pairs that captures the possible first observations of the history variable in a test execution via the function defined as follows,
(13) |
These sets of states are mapped to as follows:
(14) |
where this set is empty if no path from the node to exists on . For each , for each source in , we define a flow network , where , and , with the corresponding flow variable . For each of these flow networks, we define a flow subject to the standard flow constraints:
(c6) |
For each , we map the edge cuts and check that there is still a path from to some node in . This ensures that reactively placing restrictions on system actions does not make it impossible for a correct system strategy to make progress toward its goal. Intuitively, the edge cuts are grouped by the history variable and checked to ensure that the system has a feasible path when these restrictions are placed on system actions. The edges are grouped by their history variable using the mapping , defined as follows:
(15) |
The edge cuts are mapped onto the corresponding to cut the corresponding flow as follows:
(c7) |
Since we are agnostic to the system controller, we need to ensure that a path to the system’s goal exists at all times during the test execution. To enforce this, we require a flow of at least 1 on each system flow network ,
(c8) |
These feasibility cuts correspond to the reactive constraint setting since edge cuts are placed on and depend on the history variable . For an illustrated explanation for Example 2, refer to Fig. 4. Finally, the optimization to identify edge cuts for the reactive test strategy is characterized by the following mixed-integer linear program (MILP) with the cuts as the integer variables, and the flow and partition variables taking continuous values.
MILP-reactive:
(16) | |||
Static Constraints. We can simplify the feasibility constraints in the case of static obstacles. This corresponds to the requirement that any transition that is restricted will remain restricted for the entire duration of the test. From the system’s perspective, the restrictions will not change depending on the history variable . That is, edges in corresponding to the same transition in are grouped and share the same cut value:
(c9) |
Similarly, the optimization to find edge cuts in a static setting is as follows.
MILP-static:
(17) | |||
Lemma 2.
Proof.
Under (c9), the edge groupings become the same for all . Thus, the constraints (c6)-(c8) can be reduced onto a single flow network , where . Equation (c8) being satisfied on implies that there is a path on from to via Lemma 1. Additionally, if there is a path on from to with the static constraints (c9), then it must be that there exists a path from to on . ∎
Remark 6.
For the reactive constraint setting, we can replace the feasibility constraints (c6)-(c8) by several static constraints. That is, we introduce a copy of for each history variable and each source , denoted , and require a path from to to exist under a static mapping of the edges in the group by constraint (c9). We choose the former since it reduces the number of variables and constraints in the optimization.
Mixed Constraints. In some cases, it might be desirable to define specific transitions which require static constraints. The mixed setting of reactive and static transition restrictions can be implemented by enforcing the feasibility constraints (c6)-(c8), and the static constraints (c9) on edges , where the corresponding transition . Finally, the optimization for the mixed constraint setting is as follows.
MILP-mixed:
(18) | |||
Auxiliary Constraints. Additional constraints can be added to the optimization depending on the test harness or the desired test setup. For example, it might be required to enforce that if an edge is cut, the transition will be blocked in both directions. This can be enforced as follows,
(c14) |
V-B Characterizing Optimization Results
The flow value (Eq. (9)) of the network is always integer-valued since the edge cuts are binary and edges have unit capacities, and therefore, any strictly positive flow value corresponds to at least one valid test execution. In the following cases, the problem data are inconsistent and a flow value cannot be found.
Case 1: There is no path from to on (and equivalently, no path from to on ). In this case, the optimization will not have to place any cuts because the only possible maximum flow value is .
Case 2: There is a path from to on , but there is no path to in visiting an intermediate node in . In this case, the partition constraints will cut all paths from to , while by Lemma 1 the feasibility constraints require a path to exist from to —a contradiction. The routing optimization is infeasible in this instance.
For each MILP, the set of edges that are cut are found from the optimal as follows, , resulting in the cut network . The bypass flow value is computed on the network , where , and . A strictly positive bypass flow value indicates the existence of a on that does not visit an intermediate node in .
Theorem 1.
For each MILP, the optimal cuts result in a bypass flow value of .
Proof.
The partition constraints (c4) and (c5) partition the set of vertices into two groups: nodes with potential (e.g., ) and nodes with potential (e.g., ). On any path on , where and , the difference in potential values can be expressed as a telescoping sum: . Then, by partition constraints (c4) and (c5),
Therefore, for at least one edge on the path, where , the corresponding cut value is . These edges belong to the set of cut edges . Thus, the flow value on is zero. ∎
Theorem 2.
For each MILP, the optimal cuts are such that there always exists a path to the goal from the system’s perspective.
Proof.
First, consider the MILP in the reactive setting. The optimal cuts satisfy the feasibility constraints (c6), (c7), and (c8). These constraints ensure that for each history variable , there exists a path for the system from each state to on . The edge cuts are grouped by their history variable (see equation (15)) and mapped to the corresponding (see equation (c7)). Then, each copy represents all the cuts that can be simultaneously applied when the state of the test execution is at history variable . Thus, all restrictions on system actions at history are captured by the cuts on . Since this is true for every and every source state at which the test execution enters into , there always exists a path to the goal by equation (c8). The proof for the static and mixed settings follows similarly. ∎
Lemma 3.
For each MILP, the optimal cuts correspond to maximizing the cardinality of .
Proof.
By construction, a realization of the flow on corresponds to a set of unique state-history traces . The MILP objective maximizes the flow, and therefore the cardinality of is maximized. ∎
VI Test Strategy Synthesis
In this section, we will outline how to find the reactive test strategy from the optimization result in the different settings.
VI-A Test Environments with Static and/or Reactive Obstacles
For each setting (static, reactive, and mixed), the optimal cuts from solving the corresponding MILP are used to realize a test strategy with static and/or reactive obstacles. The optimal cuts for each MILP are parsed into a reactive map , where
(19) |
The set captures cuts that will be used to restrict the system when the state of the test execution is at the history variable . When the test execution reaches a state-history pair at time step , and contains a system transition , then the reactive test strategy will restrict the system action corresponding to this transition. That is, the set of restrictions on the system is given by
(20) |
In practice, the reactive test strategy can be realized by the test environment by placing obstacles during the test execution. The set of active obstacles at time step is defined as the set of all state-action restrictions at time . The test environment uses the test strategy to determine in the following settings.
Instantaneous: In this setting, the test environment instantaneously places obstacles for the current history variable . For any , let be the state-history pair at time step of the test execution. Therefore, the set of active obstacles at is given as, .
Accumulative:
In this setting, the test environment accumulates obstacles according to the system state during the test execution. For any , let and be the state-history pairs at time steps and of the test execution, respectively. If , we set active obstacles to be . As the test execution progresses to state-history pair at time step , any transition restricted by the test strategy is added to the set of active obstacles and is restricted by the test environment.
These obstacles remain in place until the test execution reaches a state history pair at time step , where , at which point the test environment resets the set of active obstacles to be and restrictions are accumulated until a different history variable is reached.
Remark 7.
Assumption 1 can be relaxed if we can ensure that cuts do not introduce any livelocks, in which the system has no path the goal. The feasibility constraints ensure that there always exists a path to the goal from every source for every history variable , and under the bidirectional setting of Assumption 1, the system can navigate back to the corresponding source. Without Assumption 1 we need to check for every cut that the MILP returns, that a path to the goal still exists. If that is not the case, we can exclude the solution and re-solve the MILP in a counterexample-guided search similar to the approach presented in Section VI-B.
Proposition 2.
In both the instantaneous and accumulative settings, as long as no new restrictions that are not in are introduced, the flow value remains the same.
Example 2 (Small Reactive (continued)).
Fig. 6 illustrates the test environment implementing a reactive test strategy. The reactive test strategy is constructed from the optimal cuts (as depicted in Fig. 4) on found by solving MILP (reactive). The test starts in history variable q and the system transitions are restricted according to Fig. 6. If the system decides to visit first, the test execution moves to history variable q shown in Fig. 6, whereas if the system decides to visit first, the test execution moves to q, as depicted in Fig. 6. This test environment can be implemented in either the instantaneous or the accumulative setting.
Static and Mixed Test Environments. The cuts found from MILP-static result in a reactive map in which for all . That is, restrictions on system actions remain in place for the entire duration of the test, and do not change depending on the history variable . In this fully static setting, every edge is in the static area, that is . Therefore, the test environment realizes the test strategy by restricting all system actions corresponding to any cut in for all with static obstacles simultaneously,
(21) |
In the mixed setting of static and reactive obstacles, the test strategy resulting from MILP-mixed is implemented similarly to the reactive setting, except for system transitions in that are blocked by static obstacles.
Example 1 (continued).
For the grid world example, Fig. 5 illustrates the static test on the grid world, and Fig. 5 shows the corresponding cuts on the virtual product network . Here, the 14 cuts on map to 4 static obstacles since multiple edges on correspond to the same transition in . The optimal flow value is and there is no bypass flow. Thus, as the system navigates from source to target , it must visit at least one of the intermediate nodes .
Remark 8.
The instantaneous and accumulative implementations of the test environment guide when the obstacles are placed by the test environment. However, this does not have to be the same as when the system senses or observes these restrictions on its actions. We assume that the system can observe all restricted actions on its current state before it commits to an action.
The graph construction, network flow optimization, and finding the reactive test strategy are summarized in Algorithm 1.
Theorem 3.
Proof.
The test environment informs the choice of the MILP (static, reactive, or mixed). Therefore, the resulting will be realizable by the test environment. By construction of , any correct system strategy corresponds to a . By Theorem 2, at any point during the test execution, if the system has not violated its guarantees, there exists a path on to . Therefore, there exists a correct system strategy , and resulting trace , which corresponds to the path on , where to . By Lemma 1 any on has a corresponding on and by Theorem 1, the cuts ensure that all such paths on are routed through the intermediate . Therefore, for a correct system strategy , the trace . Thus, is feasible and by Proposition 2 and Lemma 3, is least-restrictive. Thus, Problem 1 is solved. ∎
This framework results in a test that is not impossible (with respect to the system objective) for a correctly implemented system. On the other hand, a poorly designed system can still fail since the system is not aided in satisfying its guarantees.
VI-B Synthesizing a Dynamic Test Strategy
In some test scenarios, it might be beneficial to make use of an available dynamic test agent. Thus, the challenge is to find a test agent strategy that corresponds to while ensuring that the system’s operational environment assumptions are satisfied. To accomplish this, we adapt the MILP-mixed using information about the dynamic test agent. Then, we find the test agent strategy using reactive synthesis and counter-example guided search. From the optimal cuts of MILP-mixed and the resulting reactive map , we can find states that the test agent must occupy in reaction to the system state. Then, we synthesize a strategy for the dynamic test agent using the Temporal Logic and Planning Toolbox (TuLiP) [57]. If we cannot synthesize a strategy, we use a counterexample-guided approach to exclude the current solution and resolve the MILP to return a different set of optimal cuts until a strategy can be synthesized. Suppose we are given a test agent whose dynamics are given by the finite transition system , where contains at least one state that is not in , denoted as . During the test execution, the test agent can navigate to these states, if necessary. These states are required to synthesize a test agent strategy. From the test agent’s transition system , we determine which states in the test agent can occupy. From these states, we can define the static area as,
(22) |
Adapting the MILP: Since an agent can only occupy a single state at a time, we incentivize solutions in which multiple edge cuts can be realized by occupying the same state. For this, we introduce the variable , which represents whether an incoming edge into a state is cut. This is captured by the constraint
(c10) |
where corresponds to at least one incoming edge being cut. The adapted objective is then defined as
The objective is chosen such that the number of states that need to be blocked is minimized with the fewest possible edge cuts. The regularizers are chosen to reflect this order of priority. The optimal cuts from the resulting MILP are used to synthesize a reactive test agent strategy as follows. From the optimal cuts , we find the set of static obstacles according to Eq. (21) and the reactive map as follows:
(23) |
The reactive map is used to synthesize a strategy for the test agent. If no strategy can be found, a counter-example guided approach is used to resolve the MILP.
Reactive Synthesis: From the solution of the MILP, we now construct the specification to synthesize the test agent strategy using TuLiP. In particular, we construct a GR(1) formula with assumptions being our model of the system and the guarantees capturing requirements on the test agent. Note that we are synthesizing a strategy for the test agent, where the environment is the system under test. The variables needed to define the GR(1) formula consist of variables capturing the system’s state and , which track how system transitions affect the history variable . The test agent state is represented in the variable .
First, we set up the subformulae constituting the assumptions on the system model. The initial conditions of the system are defined as
(a1) |
where and . We define the dynamics of the system and the history variable for each state as follows:
(a2) |
where denotes the successors of state . For simplicity, we choose a turn-based setting, in which each player will only take their action if it is their turn. To track this, we introduce the variable as a test agent variable. For the system, this is encoded as remaining in place when :
(a3) |
If a turn-based setup is not used, we need to synthesize a Moore strategy for the test agent since it should account for all possible system actions. The system objective can be encoded as the formula
(a4) |
where is the terminal state of the system and a reachability objective specified in . The other objectives specified in are transformed to their respective GR(1) forms in . This transformation of LTL formulae into GR(1) form is detailed in [58]. In addition, the system is expected to safely operate in the test agent’s presence. The set of states where collision is possible is denoted by . Thus, the safety formula encoding that the system will not collide into the tester is given as:
(a5) |
Equations (a1)– (a5) represent the test agent’s assumptions on the system model. Next, we describe the subformulae for the guarantees of the GR(1) specification. The initial conditions for the test agent are
(g1) |
The test agent dynamics are represented by
(g2) |
The test agent can also move only in its turn and will remain stationary when :
(g3) |
The variable alternates at each step:
(g4) |
To satisfy the system assumptions (Def. 10), the test agent should not adversarially collide into the system. This is captured via the following safety formula,
(g5) |
Now, we enforce the optimal cuts found from the MILP. To enforce cuts reactively during the test execution, the states occupied by the system are defined as follows,
(g6) |
Essentially, for some history variable , if is an edge cut, then the test agent must occupy the state when the system is in the state when the test execution is at history variable . However, the test agent should not introduce any additional restrictions on the system, which is formulated as
(g7) |
Intuitively, this corresponds to the requirement that the tester agent shall not restrict system transitions that are not part of the reactive map . A test agent strategy that satisfies the above specifications is guaranteed to not restrict any system action unnecessarily. However, the test agent can occupy a state that is not adjacent to the system and block all paths to the goal from the system’s perspective. This could lead the system to not making any progress towards the goal at all, resulting in a livelock. To avoid this, we characterize the livelock condition as a safety constraint that the test agent must satisfy (e.g., if it occupies a livelock state, it must not occupy it in the next step). The specific safety formula that captures the livelock depends on the example. We find the states where the tester would block the system from reaching its goal . The following condition ensures that it will only transiently occupy blocking states:
(g8) |
Therefore, we synthesize a test agent strategy for the GR(1) formula with assumptions (a1)–(a5) and guarantees (g1)–(g8).
Counterexample-guided Approach: The MILP can have multiple optimal solutions, some of which may not be realizable for the test agent. If the GR(1) formula is unrealizable, we exclude the solution and re-solve the MILP until we find a realizable GR(1) formula. In particular, every new set of optimal cuts that is unrealizable is added to the set . Then, the MILP is resolved with an additional set of affine constraints as follows,
(c15) |
This corresponds to preventing all edges in an excluded solution from being cut at the same time. The adapted MILP is then defined as follows:
MILP-agent:
(24) | ||||
This process is repeated until a strategy is synthesized or the MILP-agent becomes infeasible.
Lemma 4.
Proof.
By construction in Eqs. (19), (21), (23), we have that for all history variables . Due to guarantee (g6), the synthesized test agent strategy restricts the transitions in . The test agent is also prohibited from restricting any other transitions by the guarantee (g7). Therefore, at each step of the test execution, the system actions restricted as a result of and static obstacles exactly correspond to those restricted by the test strategy . ∎
Proof.
The test agent strategy is synthesized to satisfy guarantees (g1)-(g8). The guarantees (g1)-(g4) specify the dynamics of the test agent, which satisfies A1. The safety guarantee (g5) satisfies A2. Guarantees (g6) and (g7) realize the optimal cuts from MILP-agent. Due to constraint (c8) the optimal cuts ensure that there always exists a path on . Together with guarantee (g8), this results in satisfying assumptions A3 and A4. By Lemma 4, is a realization of a least-restrictive feasible . ∎
The test agent strategy and obstacles, and correspond to the least-restrictive reactive test strategy possible for that test environment. Other test environments might result in different least-restrictive reactive test strategies.
VII Complexity
Our framework comprises three parts: i) graph construction, ii) routing optimization, and iii) reactive synthesis. For graph construction, we first need to construct Büchi automata from specifications. In the worst case, this construction has doubly-exponential complexity, , in the length of the formula [36]. Then, graph construction involves computing a Cartesian product of two graphs and , and has a worst-case time complexity of . For a more efficient implementation, we construct this product by expanding into states that are reachable from the source . In the reactive synthesis part of the framework, we use GR(1) synthesis which is known to have a complexity of , where is the number of states required to define the formula. In this section, we will establish the computational complexity of the routing optimization and show that the associated decision problem is NP-hard.
To prove the computational complexity of finding the cuts on the graph, we first prove the computational complexity in the special case of static obstacles. As defined in sections IV and V, the problem data is a graph with node groups , , , and the corresponding flow network . For some edge , the binary variable indicates whether the edge is cut: . The set represents the set of edges with . For static obstacles, the edges are grouped by the corresponding transition in . The grouping , and defined as follows,
(25) |
For some , all edges have the same value, i.e., if for some edge in the group, then all edges in this group will have set to 1. A bypass path on is some which does not visit the intermediate . The flow value on is defined from the source to target , with each edge having unit capacity. A valid set of edge cuts is such that i) there does not exist a bypass path, ii) there exists a path from to , and iii) edges respect the grouping .
Problem 3 (Static Obstacles Optimization Problem).
Given a graph , find a valid set of edge cuts such that the resulting maximum flow is maximized over all possible sets of edge cuts, and such that is minimized for the flow .
This corresponds to finding the valid set of edge cuts that as first priority, maximizes the flow , and subsequently chooses the set of edge cuts with the smallest cardinality (i.e. breaking ties between all valid edge cuts that realize ). For static obstacles, Problem 3 corresponds to the following decision problem.
Problem 4 (Static Obstacles Decision Problem).
Given a graph and an integer , does there exist a valid set of edge cuts such that ?
Lemma 5.
Lemma 5 implies that if there exists a polynomial-time algorithm to compute a solution to Problem 3, then there also exists a polynomial-time algorithm to solve Problem 4. Thus, if we can show that Problem 4 belongs to the class of NP-hard problems (i.e., there exists a polynomial-time reduction from any arbitrary problem in NP to Problem 4), that would imply that there exists a polynomial-time algorithm to solve Problem 4 only if . This in turn would support the MILP approach we provide to solve Problem 3. To show that Problem 4 is NP-hard, we construct a polynomial-time reduction from 3-SAT to Problem 4. This polynomial-time reduction maps any instance of 3-SAT to Problem 4 such that the solution of the constructed instance of Problem 4 corresponds to a solution of the instance of the 3-SAT problem.
Definition 20 (3-SAT [59]).
Let be a propositional logic formula over Boolean propositions in conjunctive normal form (CNF) in which each clause is a disjunction of three Boolean propositions or their negations. A solution to the 3-SAT problem is an algorithm that returns True if there exists a satisfying Boolean assignment to and False otherwise.
We first introduce a construction which maps any clause in a propositional logic formula to some sub-graph of a graph. We will then connect these sub-graphs to obtain the graph which will allows a reduction of any instance of 3-SAT to Problem 4. In turn, we will show that we can use any algorithm that solves Problem 4 to solve the 3-SAT problem, showing that Problem 4 is polynomial-time only if there exists a polynomial-time algorithm to solve 3-SAT, implying P=NP.
Construction 1 (Clause to Sub-graph).
Given a 3-SAT clause , we can construct a sub-graph representing this clause as follows. For each clause , we introduce nodes and . Then, we add the nodes corresponding to variables in the 3-SAT formula. We add the following directed edges for each node — an incoming edge from node to , and an outgoing edge from node to node . Then we add two nodes, denoted by and , to this sub-graph. If appears in the clause , then we connect the node by bypassing the edge from to , and if appears in , then we connect to bypass the edge from to (as shown in Fig. 7).
Constructing a sub-graph for a clause via Construction 1 allows us to relate the edge cuts to the Boolean assignment for the variables . If the incoming edge into is cut, then the corresponding Boolean assignment to is False, and if the outgoing edge from is cut, then the corresponding Boolean assignment to is True. This ensures that a satisfying assignment for the clause corresponds to edge cuts such that all are routed through intermediate nodes . An assignment that evaluates the clause to False corresponds to edge cuts in the sub-graph such that there is no path from to .
Construction 2 (Reduction of 3-SAT to Problem 4).
Suppose we have an instance of the 3-SAT problem with variables and clauses . First, we construct the sub-graphs for each clause according to Construction 1. Let . We denote the node as the source , and as the sink . The resulting graph is a series of sub-graphs representing each clause of the 3-SAT formula. For every variable in the formula, we maintain two groups of edges: i) incoming edges , and ii) outgoing edges . All edges in a group share the same edge cut value, corresponding to . This ensures that every variable has the same Boolean assignment across clauses.
This allows us to construct a graph corresponding to a 3-SAT formula in polynomial time via the procedure outlined in Construction 2, also illustrated in Fig. 7.
Theorem 5.
Problem 4 is NP-complete.
Proof.
We will show that Problem 4 is NP-hard by showing that Construction 2 is a correct polynomial-time reduction of the 3-SAT problem to Problem 4 i.e., any polynomial-time algorithm to solve Problem 4 can be used to solve 3-SAT in polynomial-time. Consider the graph constructed by Construction 2 for any propositional logic formula. The valid set of edge cuts on this graph with cardinality is a witness for Problem 4. A witness for the 3-SAT formula is an assignment of the variables . A witness to a problem is satisfying if the problem evaluates to True under that witness. Next, we show that a valid set of edge cuts is a satisfying witness for Problem 4 iff the corresponding assignment to variables is a satisfying witness for the 3-SAT formula.
First, consider a satisfying witness for Problem 4. By Construction 2, the cardinality of the witness, will be exactly , which is the minimum number of edge cuts required to ensure no bypass paths on the constructed graph. This implies that each variable has a Boolean assignment. By Construction 1, a strictly positive flow on the sub-graph of clause implies that is satisfied. By Construction 2, a strictly positive flow through the entire graph implies that all clauses in the 3-SAT formula are satisfied. Therefore, a satisfying witness to the 3-SAT formula can be constructed in polynomial-time from a satisfying witness for an instance of Problem 4.
Next, we consider a satisfying witness for the 3-SAT formula. The Boolean assignment for each variable corresponds to edge cuts on the graph (see Fig. 7). Any Boolean assignment ensures that there is no bypass path on the graph since either all incoming edges or all outgoing edges for each variable are cut. This also corresponds to the minimum number of edge cuts required to cut all bypass paths, corresponding to . By Construction 1, a satisfying witness corresponds to a Path() on the sub-graph for each clause . By Construction 2, observe that there exists a strictly positive flow on the graph. Thus, we can construct a satisfying witness to an instance of Problem 4 in polynomial time from a satisfying witness to the 3-SAT formula. Therefore, any 3-SAT problem reduces to an instance of Problem 4, and thus, Problem 4 is NP-hard. Additionally, Problem 4 is NP-complete since we can check the cardinality of , and whether is a valid set of edge cuts in polynomial time. ∎
Additionally, we can identify the computational complexity for the reactive setting. For the reactive setting, a valid set of edge cuts is similar to the static setting, except in how edges are grouped, which is discussed in Remark 6. Fig. 8 illustrates the graphs used for establishing the computational complexity in this setting. The optimization problem and its corresponding decision problem can be stated as follows.
Problem 5 (Reactive Obstacles Optimization Problem).
Given a graph , identify a valid set of edge cuts such that the resulting flow is maximized over all possible sets of edge cuts, and such that is minimized for the flow F.
Note that a valid set of edge cuts for the reactive problem is different from a valid set of edge cuts for the static problem.
Problem 6 (Reactive Obstacles Decision Problem).
Given a graph , and an integer , does there exist a valid set of cuts such that ?
Once again, we prove a reduction from 3-SAT, but to an instance of Problem 6 with a single history variable . Given a 3-SAT formula, the construction of the graph follows from the static setting, but with a few key differences.
Construction 3 (Reduction from 3-SAT to Problem 6 with single history variable ).
Suppose we have an instance of the 3-SAT problem with variables and clauses . Let . Using Construction 2, setup two graphs: and a copy for source and the single history variable . The key difference is that follows Construction 2 exactly, while in , edges in a group need not have the same cut value. Furthermore, for each group in , the cut value is set to the maximum edge-cut value in the corresponding group in .
Proof.
The proof follows similarly from Theorem 5. In this setting, a witness for Problem 6 comprises the maximum edge cut value of each group in . Construction 3 relates edge cuts on and . This implies that edge cuts on are found under the condition that there is a strictly positive flow on under a static mapping of edges. The minimum set of edge cuts which ensures no bypass paths on has cardinality , corresponding to only one of the sub-graphs having edge cuts. Furthermore, for each , there will be one edge-cut in one of the two groups (incoming or outgoing edges). Therefore, for each , only the incoming or the outgoing edge group will have a maximum edge cut value of 1, corresponding to the Boolean assignment for . A minimum cut on found under the conditions of no bypass paths on and a positive flow on results in a Boolean assignment that is a satisfying witness to the 3-SAT formula. Thus, we have polynomial-time construction of a satisfying witness to the 3-SAT formula from a satisfying witness to Problem 6. This follows similarly to Theorem 5.
Likewise, a satisfying witness to the 3-SAT formula can be mapped to edge cuts on one of the sub-graphs of . These edge cuts will be such that there is no bypass path on , and will be the minimum set of edge cuts to accomplish this task, corresponding to . Additionally, by construction of the graphs, this will correspond to a strictly positive flow on . Thus, we can construct a satisfying witness to Problem 6 in polynomial time from a satisfying witness of the 3-SAT formula. Therefore, any 3-SAT problem reduces to an instance of Problem 6. As a result, Problem 6 is NP-complete and following similarly to Corollary (1), Problem 5 is NP-hard. ∎
VIII Experiments
In this section, we demonstrate our framework on simulated and hardware experiments, and include runtime analysis. In the following experiments, examples with static test environments solve the routing optimization MILP-static to find the test strategy. Similarly, examples with reactive test environments solve MILP-reactive, and those with reactive dynamic agents solve MILP-agent, unless otherwise stated. These optimizations are solved using Gurobipy [61]. The reactive test agent strategies are synthesized using the temporal logic planning toolbox TuLiP [47].
In simulations and hardware experiments, we utilize Unitree A1 quadrupeds as both the system and test agents. The low-level control of the quadruped is managed through a motion primitive layer, which abstracts the underlying dynamics and facilitates transitions between primitives as described in [62]. This includes behaviors such as lying down, standing, walking, jumping, and reduced-order model-based waypoint tracking using a unicycle or single integrator model. These behaviors can be directly commanded by the autonomy layer provided by TuLiP. Individual motion primitives are implemented within our C++ motion primitive framework, with control laws, sensing, and estimation executed at 1kHz.
![Refer to caption](x20.png)
![Refer to caption](x21.png)
![Refer to caption](x22.png)
![Refer to caption](x23.png)
VIII-A Simulation
Reactive Test Environment: The following two reactive examples were demonstrated on hardware in previous work in [45]. The updated framework in this paper resulted in simulated test traces (see Figs. 9, 9) that are qualitatively similar to the hardware demo in [45]. Additionally, using the updated framework reduced the time to solve the optimization by three orders of magnitude.
VIII-A1 Beaver Rescue
The quadruped’s task is to rescue the beaver from the hallway and return it to the lab. The system objective is given as , where ‘beaver’ corresponds to the quadruped reaching the beaver, and ‘goal’ corresponds to the quadruped and the beaver reaching the safe location in the lab. The test objective is given as , ensuring that the quadruped will use different doors on the way to the beaver and back into the lab. The resulting test execution first shows the quadruped using to exit the lab into the hallway, then after it reaches the beaver, is shut and the quadruped walks to to finally return to the lab. The reactive aspect here can be observed as follows — if the quadruped chose to enter the hallway through , then the resulting test execution would constrain access to when the quadruped is attempting to re-enter the lab with the beaver. The simulated test trace is shown in Fig. 9.
VIII-A2 Motion Primitive Example
In this example, we test the motion primitives of the quadruped given as ‘lie’, ‘jump’, and ‘stand’. The goal for the quadruped is to reach the beaver in the hallway. The test objective is given as , which ensures that each motion primitive is tested at least once; and the system objective is , where ‘goal’ corresponds to the beaver location. The test setup includes doors that might be unlocked by the system demonstrating specific motion primitives. Our framework will decide whether the doors will be locked or unlocked according to which motion primitives have already been observed during the test. This is where the reactivity of this framework becomes apparent, if the quadruped chose a different set of doors and motion primitives, the resulting test execution would have been different. The simulated test trace is shown in Fig. 9.
Test Environment with Dynamic Agent
VIII-A3 Maze 1
The system (gray quadruped) wants to reach its goal location in the top left corner of the grid, and the test agent wants to route it through a series of states, labeled , and , shown in Fig. 9. The system specification and test objective are given as and The test agent (yellow quadruped) can move up on the center column of the grid, and its strategy is found using the flow-based synthesis framework. Observe that it blocks specific cells such that the quadruped cannot directly navigate to its goal through the center of the grid. Instead, the system quadruped is forced to visit the labeled cells, and only then, the test agent moves into the parking state off the grid to not excessively constrain the system. The resulting test execution is shown in Fig. 9.
VIII-B Hardware Experiments
![Refer to caption](extracted/2404.09888v1/figures/annotated_figs/refueling_fig_annotated2.png)
![Refer to caption](x24.png)
![Refer to caption](x25.png)
Static Test Environment:
VIII-B1 Running Example
For this experiment we implemented Example 1 on the quadruped. The resulting test trace is shown in Fig. 12.
![Refer to caption](extracted/2404.09888v1/figures/annotated_figs/med_ex_annotated.png)
For the following two examples, the system state also contains the fuel level. Thus, the auxiliary bidirectional constraints in MILP-static are such that the fuel level is abstracted away, meaning if a transition is cut for a specific fuel level, it is cut for all fuel levels.
VIII-B2 Refueling
This example highlights that intermediate nodes need not always represent poses of the system. In addition to the coordinates , the quadruped state also tracks the fuel level . A full fuel tank consists of 10 units of fuel. Every move on the grid reduces the fuel level by 1 and reaching the refueling station (in the bottom right corner of the grid) resets the fuel tank to full. The desired test behavior is to have the system visit a state that is too far away to reach the goal state with its available fuel, specifically we want to see the system be in the lower three rows of the grid with a fuel level of lower than . The system objective is given as and the test objective is . Note that this test objective also includes states where the fuel tank is empty, , but the MILP will not route the test execution through these unsafe states, but will automatically only route it through the states where instead. Snapshots and the trace of the test execution are shown in Fig. 10. The color of the trace corresponds to the fuel level, and we observe that the obstacle configuration is such that for the quadruped to successfully reach its goal location it is required to visit the refueling station.
VIII-B3 Mars Exploration
In this example the system is tested for a combination of reachability, reaction and avoidance sub-tasks. This example is inspired by a planetary rover’s exploration of the Martian surface. Consequently, the grid world has states designated as ‘rock’, ‘ice’, and ‘drop-off’, denoting sample locations and the drop-off position, respectively. In addition to the coordinates , the quadruped state also contains the fuel level that decreases by 1 for every transition on the grid. The maximum fuel capacity is 10 units and is reset to full at the refueling locations labeled ‘R’. The system objective states that the quadruped must reach its goal location, labeled ‘T’, and if it picks up a sample, it shall drop it off at the drop-off location, while not running out of fuel. This is captured in the system objective
The test objective corresponds to the triggers of the reaction sub-task. Specifically, the quadruped is required to collect a ‘rock’ sample and an ‘ice’ sample, and is routed such that a successful run requires the quadruped to refuel:
where is the distance to the goal and is the fuel level. The experiment trace and snapshots of the hardware test execution are shown in Figs. 11 and 11. From the experiment trace, the static obstacles are placed such that the quadruped has to pick up rock and ice samples, refuel twice, and then drop off samples before reaching its goal. The test environment for the hardware run in Fig. 11 corresponds to a sub-optimal solution of MILP-static with a flow of 1. This sub-optimal solution still ensures that the system is routed in a manner that the test objective is still satisfied. In Table V, we list the runtimes for getting the optimal solution for this example.
![Refer to caption](extracted/2404.09888v1/figures/quad_plus_empty.png)
![Refer to caption](x29.png)
![Refer to caption](x30.png)
Reactive Dynamic Agent:
VIII-B4 Patrolling
This example is similar to the static refueling example, except that the test environment now consists of a test agent and static obstacles (see Fig. 1). The system (gray quadruped) starts in the lower right corner and must reach its goal in the lower left corner of the grid without running out of fuel, which is encoded in the system objective: The refueling station is denoted ‘R’ in Fig. 1. Once again, the test objective routes the system through a state from which a successful test execution requires it to refuel,
where is the distance to the goal. The test agent can move up and down the third column of the grid, and can leave the grid from the first and last rows to a parking state. As shown in the trace and hardware snapshots in Fig. 1, our framework chooses to place a static obstacle near the start state, and the test agent blocks the system from directly navigating to the goal (see panels , and in Fig. 1) until its fuel level is low enough, thus requiring it to refuel. For this experiment, we solve MILP-agent with the objective (12) for numerical stability in Gurobi.
VIII-B5 Maze 2
In this example, the system quadruped starts in the bottom left corner of the grid, and must reach its goal location in the top right corner. The grid world is a grid, with a symmetric obstacle configuration shown in yellow in Fig. 13. In this example, the test environment consists of a test agent that can traverse along the center row and center column of the grid. While the test environment can also place static obstacles, it realizes the test strategy entirely via the test agent. The system objective is given as follows . The test objective consists of two visit tasks in arbitrary order, encoded as
where and correspond to the designated locations on the grid. The specification product is the same as shown in Fig. 3, we can see that to route the test execution through the test objective acceptance states, we need to find cuts for the history variables q, q, and q. The reactive cuts found by the flow-based synthesis procedure are shown in Figs. 13-13. The trace and snapshots of the resulting test execution is shown in Figs. 14 and 14. We observe that the system quadruped decides to take the top path first, visits (see panel in Fig. 14), and is blocked by the test agent (see panel ). It then decides to try navigating through the center of the grid, and is again blocked by the test agent (see panel ). Subsequently, it decides to try the bottom path, visits (see panel ), and successfully reaches the goal without any further test agent intervention. If the system decided to visit first, the adaptive test agent strategy would have blocked the system from reaching the goal directly from until it visits . This is an example with a maximum flow of , corresponding to the two unique ways for the system to reach the goal. For an alternative system controller in which the system chooses to approach the goal through , the simulated trace resulting from the test agent strategy is shown in Fig. 9.
VIII-C Runtimes
Table V showcases runtimes for simulated and hardware experiments involving static or reactive obstacles. Table VI shows runtimes for simulated and hardware experiments with a dynamic test agent. The size of the automata and graphs reported in these tables corresponds to the tuple , where is the number of nodes, and the number of edges. To evaluate the scalability of this framework, we include runtimes on randomized grid worlds for specification sub-tasks in Table IV for static obstacles, and in Table III for reactive obstacles. These experiments were conducted on an Apple M2 Pro with 16 GB of RAM. The Mars exploration example corresponds to solving an MILP with over binary variables, for which the solver takes s to find the optimal solution. For examples involving a dynamic agent such as Maze 1 and Maze 2, our framework iterates through counterexamples that are not dynamically feasible for the test agent until it finds a solution.
Experiment | |||||
Graph Construction [s] | |||||
Reachability: | |||||
2 | (4, 9) | 0.046 0.001 | 0.224 0.0056 | 0.554 0.009 | 1.078 0.011 |
3 | (8, 27) | 0.344 0.007 | 1.661 0.022 | 4.004 0.048 | 7.376 0.061 |
4 | (16, 81) | 1.997 0.077 | 9.895 0.109 | 23.512 0.179 | 43.188 0.454 |
Reachability & Reaction: | |||||
3 | (6, 21) | 0.090 0.001 | 0.424 0.016 | 1.037 0.004 | 2.044 0.013 |
5 | (20, 155) | 1.628 0.087 | 7.560 0.023 | 18.019 0.129 | 33.539 0.144 |
7 | (68, 1065) | 44.809 0.996 | 209.612 1.732 | 488.611 6.308 | 869.060 16.870 |
Reachability & Safety: | |||||
3 | (6, 18) | 0.102 0.002 | 0.508 0.010 | 1.278 0.022 | 2.557 0.023 |
4 | (6, 18) | 0.116 0.002 | 0.590 0.009 | 1.485 0.024 | 2.918 0.046 |
5 | (6,18) | 0.179 0.027 | 0.960 0.037 | 2.329 0.072 | 4.482 0.116 |
Experiment | |||||||||
Optimization[s], Success Rate (%) | |||||||||
Reachability: | |||||||||
2 | (4, 9) | 5.6313.43 | 100 | 64.6238.75 | 100 | 67.3825.47 | 100 | 68.6331.12 | 100 |
3 | (8, 27) | 23.3638.15 | 100 | 61.6835.12 | 100 | 91.5431.41 | 100 | 117.8234.89 | 100 |
4 | (16, 81) | 22.4936.33 | 100 | 83.5229.25 | 100 | 171.4950.72 | 100 | 317.6289.08 | 100 |
Reachability & Reaction: | |||||||||
3 | (6, 21) | 5.9713.21 | 100 | 61.0634.67 | 100 | 71.6441.03 | 100 | 85.2019.49 | 100 |
5 | (20, 155) | 17.1925.51 | 100 | 78.4434.71 | 100 | 159.9176.63 | 100 | 279.86148.23 | 90 |
7 | (68, 1065) | 52.7141.23 | 100 | 331.32187.28 | 90 | 585.2167.58 | 15 | 600.000.00 | 0 |
Reachability & Safety: | |||||||||
3 | (6, 18) | 0.761.52 | 100 | 70.8289.70 | 100 | 63.6827.54 | 100 | 80.5820.79 | 100 |
4 | (6, 18) | 0.150.29 | 100 | 71.4780.61 | 100 | 59.5938.92 | 100 | 76.0227.11 | 100 |
5 | (6, 18) | 0.120.18 | 100 | 94.6888.04 | 100 | 71.3430.89 | 100 | 82.5422.69 | 100 |
Experiment | |||||||||
Optimization [s], Success Rate (%) | |||||||||
Reachability: | |||||||||
2 | (4, 9) | 8.1713.14 | 100 | 54.0717.98 | 100 | 60.170.12 | 100 | 60.170.10 | 100 |
3 | (8, 27) | 27.7821.71 | 100 | 60.170.10 | 100 | 60.480.86 | 100 | 74.0238.70 | 100 |
4 | (16, 81) | 52.6014.05 | 100 | 60.420.34 | 100 | 82.0241.26 | 100 | 265.41203.51 | 80 |
Reachability & Reaction: | |||||||||
3 | (6, 21) | 10.6214.85 | 100 | 60.090.06 | 100 | 60.230.24 | 100 | 60.340.46 | 100 |
5 | (20, 155) | 20.4119.21 | 100 | 67.7731.90 | 100 | 95.31116.65 | 95 | 268.50222.14 | 75 |
7 | (68, 1065) | 36.6423.34 | 100 | 110.6392.81 | 100 | 419.77214.30 | 55 | 556.38131.06 | 10 |
Reachability & Safety: | |||||||||
3 | (6, 18) | 1.271.47 | 100 | 60.080.06 | 100 | 57.2712.61 | 100 | 60.320.24 | 100 |
4 | (6, 18) | 0.170.23 | 100 | 60.060.05 | 100 | 60.140.10 | 100 | 60.300.19 | 100 |
5 | (6, 18) | 0.110.16 | 100 | 54.1517.80 | 100 | 60.170.09 | 100 | 60.290.26 | 100 |
Experiment | [s] | BinVars | ContVars | Constraints | Opt[s] | Flow | ||||
Example 1 | (4, 9) | (15, 53) | (27, 96) | 0.0270 | 73 | 87 | 540 | 0.0003 | 3.0 | 14 |
Refueling | (6, 18) | (265, 1047) | (332, 1346) | 0.6655 | 1014 | 1261 | 19819 | 0.8682 | 2.0 | 199 |
Mars Exploration | (36, 354) | (376, 1522) | (4073, 17251) | 75.8313 | 13178 | 16604 | 1646480 | 46.6209 | 2.0 | 1641 |
Example 2 | (8, 27) | (6, 17) | (20, 56) | 0.0452 | 25 | 115 | 409 | 0.0003 | 2.0 | 4 |
Beaver Rescue | (12, 54) | (7, 19) | (15, 39) | 0.0470 | 8 | 154 | 441 | 0.0001 | 2.0 | 2 |
Motion Primitives | (16, 81) | (15, 42) | (72, 207) | 0.4286 | 106 | 761 | 2606 | 0.0005 | 3.0 | 15 |
Experiment | [s] | BinVars | Opt[s] | Controller[s] | Flow | |||||
Maze 1 | (16, 81) | (26, 80) | (196, 604) | 1.6226 | 355 | 0.0007 | 68.7052 | 3 | 1.0 | 3 |
Patrolling | (6, 18) | (386, 1539) | (210, 831) | 0.4573 | 621 | 6.0535 | 16.1191 | 0 | 1.0 | 13 |
Maze 2 | (8, 27) | (21, 66) | (80, 252) | 0.2195 | 176 | 0.0160 | 5.0072 | 5 | 2.0 | 8 |
For randomized experiments, we time out if the Gurobi fails to find a feasible solution to the MILP within 10 min. If it finds a feasible solution within 10 minutes, we allocate an additional minute for the optimizer reach the optimal, otherwise terminating the optimization with a feasible solution. For these experiments, we increase the length of the system and test objective for the following three classes of specification patterns: i) reachability, ii) reachability and reaction, and iii) reachability and safety. For reachability patterns, the set AP comprises of atomic propositions needed to describe the system and test objectives as follows, and , and the total number of atomic propositions are . Similarly, for reachability and reaction patterns (case ii), we have and , with . In the reachability and safety case (iii), only the length of the system objective changes: and , with . Improving the runtimes for graph construction and controller synthesis subroutines is orthogonal to the focus of this paper. Since the test synthesis framework is carried out offline, we observe reasonable runtimes for medium-sized problems with hundreds to thousands of integer variables. An interesting direction for future research involves identifying good convex relaxations of the MILPs to further improve scalability.
IX Comparison to Reactive Synthesis
We presented an approach to solve Problems 1 and 2 leveraging tools from automata theory and network flow optimization. In particular, for Problem 2, we rely on the optimization solution to construct a GR(1) specification to reactively synthesize a test agent strategy. One indication of the optimization step being necessary is the computational complexity of the problem. If the problem data are consistent, there exists a GR(1) specification for the test agent that would solve the problem, but directly expressing this specification is impractical. Essentially, the challenge is in finding the restrictions on system actions, which are then captured in the sub-formulae of the GR(1) specification. In this section, we argue that we cannot solve Problems 1 and 2 solely via synthesis from an LTL specification.
To the authors’ knowledge, directly capturing the different perspectives of the system and the test agent in this neither fully adversarial nor fully cooperative setting is not possible with current state-of-the-art approaches in GR(1) synthesis. Particularly in the reactive setting, the test strategy must ensure that from the system’s perspective, there always exists a path to the system goal. To capture this constraint, we reason over a second product graph that represents the system perspective. It is not obvious how this semi-cooperative setting can be directly encoded as a synthesis problem in common temporal logics.
In the static setting, the problem can be posed on a single graph. However, it is difficult to find the set of static obstacles directly from GR(1) synthesis. Every state in the winning set describes an edge-cut combination, but qualitative GR(1) synthesis cannot maximize the flow or minimize the cuts. Furthermore, the winning set can include states that vacuously satisfy the formula, i.e., not allowing the system any path to the goal. Finally, the combinatorial complexity of the problem would manifest as follows. Although the time complexity of GR(1) synthesis is in the number of states , we require an exponential number of states to characterize the GR(1) formula. For example, in Figure 15, this is illustrated for the GR(1) formula:
where captures the system transitions on the grid world, are the dynamics of the test environment, and and capture the condition in GR(1) form. In this example, each edge in the system transition system can take 0/1 values, and once an edge is cut, it remains cut and the system cannot take a transition that corresponds to a cut edge. Due to this, the number of states to describe the GR(1) formula includes the states that characterize the edge cuts. As seen in Figure 15, the direct GR(1) synthesis approach returns a trivial solution corresponding to an impossible setting for the system. Finally, even when an acceptable solution is returned, the problem being at least NP-hard will result in the combinatorial complexity manifesting in the synthesis approach.
One key advantage of the network flow optimization is reasoning over flows as opposed to paths, which allows for tractable implementations. These insights from network flow optimization in this work can help in driving further research along these directions.
![Refer to caption](extracted/2404.09888v1/figures/comparison_reactive.png)
X Conclusion and Future Work
We presented a framework to synthesize least-restrictive strategies for test environments according to specified system and test objectives. To do this, we formulate a network flow-based MILP corresponding to the types of agents available in the test environment. In the case of a dynamic test agent, we parse the solution of the MILP to synthesize a test agent strategy via reactive synthesis. Furthermore, we use a counterexample-guided approach to find a realizable test agent strategy. Our problem is shown to be NP-hard, yet the MILP can handle medium-sized problem instances. Our test strategies are such that the system is minimally restricted while routing the test execution through the test objective without creating a livelock. Therefore, a test execution in which the system fails to meet the system objective is solely the fault of the system, and not due to the test environment.
There are several exciting future directions. First, we aim to extend this framework to automatically select dynamic test agents from a library. This selection can optimized to meet user-defined metrics such as testing effort or cost. Secondly, we wish to improve the runtime of our algorithm by using symbolic methods to speed up graph construction and exploring convex relaxations to the MILP. More broadly, we want to investigate how to incorporate test metrics such as coverage and difficulty into our framework.
Acknowledgment
The authors acknowledge Emily Fourney, Chris Umans, Scott Livingston, Joel Burdick, Ioannis Filippidis, Mani Chandy, and Lijun Chen for useful discussions.
References
- [1] I. S. Organization, “Road vehicles: Safety of the intended functionality (ISO Standard No. 21448:2022),” 2022. https://www.iso.org/standard/77490.html, Last accessed on 2024-04-11.
- [2] Zoox, “Putting Zoox to the test: preparing for the challenges of the road,” 2021. https://zoox.com/journal/structured-testing/, Last accessed on 2024-04-11.
- [3] N. Webb, D. Smith, C. Ludwick, T. Victor, Q. Hommes, F. Favaro, G. Ivanov, and T. Daniel, “Waymo’s safety methodologies and safety readiness determinations,” 2020.
- [4] A. Dosovitskiy, G. Ros, F. Codevilla, A. Lopez, and V. Koltun, “CARLA: An open urban driving simulator,” in Conference on Robot Learning, pp. 1–16, PMLR, 2017.
- [5] D. J. Fremont, T. Dreossi, S. Ghosh, X. Yue, A. L. Sangiovanni-Vincentelli, and S. A. Seshia, “Scenic: a language for scenario specification and scene generation,” in Proceedings of the 40th ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 63–78, 2019.
- [6] A. Gambi, T. Huynh, and G. Fraser, “Generating effective test cases for self-driving cars from police reports,” in Proceedings of the 2019 27th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering, pp. 257–267, 2019.
- [7] C. Stark, C. Medrano-Berumen, and M. Akbaş, “Generation of autonomous vehicle validation scenarios using crash data,” in 2020 SoutheastCon, pp. 1–6, 2020.
- [8] G. Lou, Y. Deng, X. Zheng, M. Zhang, and T. Zhang, “Testing of autonomous driving systems: where are we and where should we go?,” in Proceedings of the 30th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering, pp. 31–43, 2022.
- [9] A. Corso, R. Moss, M. Koren, R. Lee, and M. Kochenderfer, “A survey of algorithms for black-box safety validation of cyber-physical systems,” Journal of Artificial Intelligence Research, vol. 72, pp. 377–428, 2021.
- [10] H. Winner, K. Lemmer, T. Form, and J. Mazzega, “Pegasus—first steps for the safe introduction of automated driving,” in Road Vehicle Automation 5, pp. 185–195, Springer, 2019.
- [11] L. Li, W.-L. Huang, Y. Liu, N.-N. Zheng, and F.-Y. Wang, “Intelligence testing for autonomous vehicles: A new approach,” IEEE Transactions on Intelligent Vehicles, vol. 1, no. 2, pp. 158–166, 2016.
- [12] G. E. Mullins, P. G. Stankiewicz, R. C. Hawthorne, and S. K. Gupta, “Adaptive generation of challenging scenarios for testing and evaluation of autonomous vehicles,” Journal of Systems and Software, vol. 137, pp. 197–215, 2018.
- [13] A. Corso, P. Du, K. Driggs-Campbell, and M. J. Kochenderfer, “Adaptive stress testing with reward augmentation for autonomous vehicle validatio,” in 2019 IEEE Intelligent Transportation Systems Conference (ITSC), pp. 163–168, IEEE, 2019.
- [14] S. Feng, H. Sun, X. Yan, H. Zhu, Z. Zou, S. Shen, and H. X. Liu, “Dense reinforcement learning for safety validation of autonomous vehicles,” Nature, vol. 615, no. 7953, pp. 620–627, 2023.
- [15] Y. Annpureddy, C. Liu, G. Fainekos, and S. Sankaranarayanan, “S-taliro: A tool for temporal logic falsification for hybrid systems,” in International Conference on Tools and Algorithms for the Construction and Analysis of Systems, pp. 254–257, Springer, 2011.
- [16] H. Abbas and G. Fainekos, “Linear hybrid system falsification through local search,” in International Symposium on Automated Technology for Verification and Analysis, pp. 503–510, Springer, 2011.
- [17] G. E. Fainekos and G. J. Pappas, “Robustness of temporal logic specifications for continuous-time signals,” Theoretical Computer Science, vol. 410, no. 42, pp. 4262–4291, 2009.
- [18] A. Donzé, “Breach, a toolbox for verification and parameter synthesis of hybrid systems,” in International Conference on Computer Aided Verification, pp. 167–170, Springer, 2010.
- [19] D. J. Fremont, E. Kim, Y. V. Pant, S. A. Seshia, A. Acharya, X. Bruso, P. Wells, S. Lemke, Q. Lu, and S. Mehta, “Formal scenario-based testing of autonomous vehicles: From simulation to the real world,” in 2020 IEEE 23rd International Conference on Intelligent Transportation Systems (ITSC), pp. 1–8, IEEE, 2020.
- [20] C. E. Tuncali, G. Fainekos, H. Ito, and J. Kapinski, “Simulation-based adversarial test generation for autonomous vehicles with machine learning components,” in 2018 IEEE Intelligent Vehicles Symposium (IV), pp. 1555–1562, IEEE, 2018.
- [21] C. Innes and S. Ramamoorthy, “Automated testing with temporal logic specifications for robotic controllers using adaptive experiment design,” in 2022 International Conference on Robotics and Automation (ICRA), pp. 6814–6821, 2022.
- [22] P. Akella, M. Ahmadi, R. M. Murray, and A. D. Ames, “Formal test synthesis for safety-critical autonomous systems based on control barrier functions,” in 2020 59th IEEE Conference on Decision and Control (CDC), pp. 790–795, 2020.
- [23] T. Wongpiromsarn, M. Ghasemi, M. Cubuktepe, G. Bakirtzis, S. Carr, M. O. Karabag, C. Neary, P. Gohari, and U. Topcu, “Formal methods for autonomous systems,” arXiv preprint arXiv:2311.01258, 2023.
- [24] G. Fainekos, H. Kress-Gazit, and G. Pappas, “Hybrid controllers for path planning: A temporal logic approach,” in Proceedings of the 44th IEEE Conference on Decision and Control, pp. 4885–4890, 2005.
- [25] L. Tan, O. Sokolsky, and I. Lee, “Specification-based testing with linear temporal logic,” in Proceedings of the 2004 IEEE International Conference on Information Reuse and Integration, 2004. IRI 2004., pp. 493–498, IEEE, 2004.
- [26] E. Plaku, L. E. Kavraki, and M. Y. Vardi, “Falsification of LTL safety properties in hybrid systems,” International Journal on Software Tools for Technology Transfer, vol. 15, no. 4, pp. 305–320, 2013.
- [27] G. Fraser and F. Wotawa, “Using LTL rewriting to improve the performance of model-checker based test-case generation,” in Proceedings of the 3rd International Workshop on Advances in Model-Based Testing, pp. 64–74, 2007.
- [28] G. Fraser and P. Ammann, “Reachability and propagation for LTL requirements testing,” in 2008 The Eighth International Conference on Quality Software, pp. 189–198, IEEE, 2008.
- [29] R. Bloem, G. Fey, F. Greif, R. Könighofer, I. Pill, H. Riener, and F. Röck, “Synthesizing adaptive test strategies from temporal logic specifications,” Formal Methods in System Design, vol. 55, no. 2, pp. 103–135, 2019.
- [30] J. Tretmans, “Conformance testing with labelled transition systems: Implementation relations and test generation,” Computer Networks and ISDN Systems, vol. 29, no. 1, pp. 49–79, 1996.
- [31] B. K. Aichernig, H. Brandl, E. Jöbstl, W. Krenn, R. Schlick, and S. Tiran, “Killing strategies for model-based mutation testing,” Software Testing, Verification and Reliability, vol. 25, no. 8, pp. 716–748, 2015.
- [32] R. Hierons, “Applying adaptive test cases to nondeterministic implementations,” Information Processing Letters, vol. 98, no. 2, pp. 56–60, 2006.
- [33] A. Petrenko and N. Yevtushenko, “Adaptive testing of nondeterministic systems with FSM,” in 2014 IEEE 15th International Symposium on High-Assurance Systems Engineering, pp. 224–228, IEEE, 2014.
- [34] A. Pnueli and R. Rosner, “On the synthesis of a reactive module,” in Proceedings of the 16th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, pp. 179–190, 1989.
- [35] R. Bloem, B. Jobstmann, N. Piterman, A. Pnueli, and Y. Sa’ar, “Synthesis of reactive (1) designs,” Journal of Computer and System Sciences, vol. 78, no. 3, pp. 911–938, 2012.
- [36] C. Baier and J.-P. Katoen, Principles of model checking. MIT press, 2008.
- [37] M. Yannakakis, “Testing, optimization, and games,” in Proceedings of the 19th Annual IEEE Symposium on Logic in Computer Science, 2004., pp. 78–88, IEEE, 2004.
- [38] L. Nachmanson, M. Veanes, W. Schulte, N. Tillmann, and W. Grieskamp, “Optimal strategies for testing nondeterministic systems,” ACM SIGSOFT Software Engineering Notes, vol. 29, no. 4, pp. 55–64, 2004.
- [39] A. David, K. G. Larsen, S. Li, and B. Nielsen, “Cooperative testing of timed systems,” Electronic Notes in Theoretical Computer Science, vol. 220, no. 1, pp. 79–92, 2008.
- [40] E. Bartocci, R. Bloem, B. Maderbacher, N. Manjunath, and D. Ničković, “Adaptive testing for specification coverage in CPS models,” IFAC-PapersOnLine, vol. 54, no. 5, pp. 229–234, 2021.
- [41] T. Marcucci, J. Umenberger, P. Parrilo, and R. Tedrake, “Shortest paths in graphs of convex sets,” SIAM Journal on Optimization, vol. 34, no. 1, pp. 507–532, 2024.
- [42] T. Marcucci, M. Petersen, D. von Wrangel, and R. Tedrake, “Motion planning around obstacles with convex optimization,” Science Robotics, vol. 8, no. 84, p. eadf7843, 2023.
- [43] H. Zhang, M. Fontaine, A. Hoover, J. Togelius, B. Dilkina, and S. Nikolaidis, “Video game level repair via mixed integer linear programming,” in Proceedings of the AAAI Conference on Artificial Intelligence and Interactive Digital Entertainment, vol. 16, pp. 151–158, 2020.
- [44] M. Fontaine, Y.-C. Hsu, Y. Zhang, B. Tjanaka, and S. Nikolaidis, “On the Importance of Environments in Human-Robot Coordination,” in Proceedings of Robotics: Science and Systems, (Virtual), July 2021.
- [45] A. Badithela, J. B. Graebener, W. Ubellacker, E. V. Mazumdar, A. D. Ames, and R. M. Murray, “Synthesizing reactive test environments for autonomous systems: testing reach-avoid specifications with multi-commodity flows,” in 2023 IEEE International Conference on Robotics and Automation (ICRA), pp. 12430–12436, IEEE, 2023.
- [46] C. Menghi, C. Tsigkanos, P. Pelliccione, C. Ghezzi, and T. Berger, “Specification patterns for robotic missions,” IEEE Transactions on Software Engineering, vol. 47, no. 10, pp. 2208–2224, 2019.
- [47] T. Wongpiromsarn, U. Topcu, N. Ozay, H. Xu, and R. M. Murray, “TuLiP: a software toolbox for receding horizon temporal logic planning,” in Proceedings of the 14th International Conference on Hybrid Systems: Computation and Control, HSCC ’11, (New York, NY, USA), p. 313–314, Association for Computing Machinery, 2011.
- [48] T. Wongpiromsarn, U. Topcu, and R. M. Murray, “Receding horizon temporal logic planning,” IEEE Transactions on Automatic Control, vol. 57, no. 11, pp. 2817–2830, 2012.
- [49] H. Kress-Gazit, G. E. Fainekos, and G. J. Pappas, “Temporal-logic-based reactive mission and motion planning,” IEEE Transactions on Robotics, vol. 25, no. 6, pp. 1370–1381, 2009.
- [50] C. Belta and S. Sadraddini, “Formal methods for control synthesis: An optimization perspective,” Annual Review of Control, Robotics, and Autonomous Systems, vol. 2, pp. 115–140, 2019.
- [51] J. R. Büchi, On a Decision Method in Restricted Second Order Arithmetic, pp. 425–435. New York, NY: Springer New York, 1990.
- [52] A. Bauer, M. Leucker, and C. Schallhart, “Runtime verification for LTL and TLTL,” ACM Transactions on Software Engineering and Methodology (TOSEM), vol. 20, no. 4, pp. 1–64, 2011.
- [53] K. Havelund and G. Rosu, “Monitoring programs using rewriting,” in Proceedings 16th Annual International Conference on Automated Software Engineering (ASE 2001), pp. 135–143, IEEE, 2001.
- [54] A. Morgenstern, M. Gesell, and K. Schneider, “An asymptotically correct finite path semantics for LTL,” in International Conference on Logic for Programming Artificial Intelligence and Reasoning, pp. 304–319, Springer, 2012.
- [55] T. H. Cormen, C. E. Leiserson, R. L. Rivest, and C. Stein, Introduction to algorithms. MIT press, 2022.
- [56] V. V. Vazirani, Approximation algorithms, vol. 1. Springer, 2001.
- [57] I. Filippidis, S. Dathathri, S. C. Livingston, N. Ozay, and R. M. Murray, “Control design for hybrid systems with tulip: The temporal logic planning toolbox,” in 2016 IEEE Conference on Control Applications (CCA), pp. 1030–1041, IEEE, 2016.
- [58] S. Maoz and J. O. Ringert, “GR(1) synthesis for LTL specification patterns,” in Proceedings of the 2015 10th joint meeting on foundations of software engineering, pp. 96–106, 2015.
- [59] S. A. Cook, “The complexity of theorem-proving procedures,” in Logic, Automata, and Computational Complexity: The Works of Stephen A. Cook, pp. 143–152, 2023.
- [60] C. H. Papadimitriou, Computational complexity, p. 260–265. GBR: John Wiley and Sons Ltd., 2003.
- [61] Gurobi Optimization, LLC, “Gurobi Optimizer Reference Manual,” 2023.
- [62] W. Ubellacker and A. D. Ames, “Robust locomotion on legged robots through planning on motion primitive graphs,” in 2023 IEEE International Conference on Robotics and Automation (ICRA), preprint, 2023.
![]() |
Josefine B. Graebener (Student Member, IEEE) received a B.Eng. in Aerospace Engineering in 2017 from the Aachen University of Applied Sciences (FH Aachen) in Aachen, Germany, and a M.S. in Space Engineering from California Institute of Technology in 2019. Currently, she is a Ph.D. candidate in Space Engineering with a minor in Computer Science at the California Institute of Technology. Her research interest lies in using formal methods for test and evaluation of autonomous systems, and system diagnostics. |
![]() |
Apurva Badithela (Student Member, IEEE) received a Bachelors degree in Aerospace Engineering and Mechanics in 2018 from the University of Minnesota, Twin-Cities. Currently, she is a Ph.D. candidate in Control and Dynamical Systems at the California Institute of Technology. Her dissertation work focuses on Formal Test Synthesis and System-level Evaluation for Safety-Critical Autonomous Systems. |
![]() |
Denizalp Goktas (Student Member, IEEE), Denizalp Goktas is a Ph.D. Candidate in Computer Science at Brown University. His research focuses on artificial intelligence, particularly how it intersects with economics and computer science. His research seeks to create algorithms for games and markets, aiming to use these to tackle problems practical problem such as in economics and robotics. He is supported by a JP Morgan AI fellowship. Previously, Denizalp earned his BA in Computer Science and Statistics from Columbia University and another BA in Political Science and Economics from Sciences Po. His past research experience includes internships at Google DeepMind and JP Morgan, and a visiting scholar position at UC Berkeley’s Simons Institute. |
Wyatt Ubellacker (Student Member, IEEE), earned his B.S. and M.S. degrees in Mechanical Engineering from the Massachusetts Institute of Technology in 2013 and 2016, respectively. Prior to joining Caltech in 2019, he was a Robotics Technologist at the Jet Propulsion Laboratory, where he wrote autonomy and control algorithms for the Mars Perseverance Rover. Currently, he is a Ph.D. candidate in Control and Dynamical Systems at Caltech. His research interests focus on control and autonomy for dynamic platforms, with a special emphasis on robotic morphologies that are capable of exhibiting a wide variety of behaviors. |
![]() |
Eric V. Mazumdar (Member, IEEE) received a B.S. degree in Computer Science from the Massachusetts Institute of Technology (MIT) in 2015, and a Ph.D in Electrical Engineering and Computer Science from UC Berkeley in 2021. Currently he is an Assistant Professor in Computing and Mathematical Sciences and Economics at Caltech. His research interests lie at the intersection of machine learning and economics, focusing on developing theoretical foundations and tools to confidently deploy machine learning algorithms into societal systems, particularly in settings with uncertain, dynamic environments in which learning algorithms interact with strategic agents. Dr. Mazumdar received the NSF CAREER Award in 2023 as well as a Research Fellowship for Learning in Games from the Simons Institute for Theoretical Computer Science. |
Aaron D. Ames (Fellow, IEEE) received a B.S. degree in Mechanical Engineering and a B.A. degree in Mathematics from the University of St. Thomas in 2001, and a M.A. degree in Mathematics and a Ph.D. in Electrical Engineering and Computer Sciences from UC Berkeley in 2006. Currently he is the Bren Professor of Mechanical and Civil Engineering and Control and Dynamical Systems at the California Institute of Technology. Prior to joining Caltech, he was an Associate Professor in Mechanical Engineering and Electrical & Computer Engineering at the Georgia Institute of Technology. He was as a Postdoctoral Scholar in Control and Dynamical Systems at Caltech from 2006 to 2008, and began is faculty career at Texas A&M University in 2008. His research interests span the areas of robotics, nonlinear control and hybrid systems, with a special focus on applications to bipedal robotic walking—both formally and through experimental validation. Dr. Ames was the recipient of the 2005 Leon O. Chua Award for achievement in nonlinear science at UC Berkeley, and the 2006 Bernard Friedman Memorial Prize in Applied Mathematics. Dr. Ames received the NSF CAREER award in 2010, and the Donald P. Eckman Award in 2015, and the 2019 Antonio Ruberti Young Researcher Prize. |
Richard M. Murray (Fellow, IEEE) received the B.S. degree in Electrical Engineering from California Institute of Technology in 1985 and the M.S. and Ph.D. degrees in Electrical Engineering and Computer Sciences from the University of California, Berkeley, in 1988 and 1991, respectively. He is currently the Thomas E. and Doris Everhart Professor of Control & Dynamical Systems and Bioengineering at Caltech. Murray’s research is in the application of feedback and control to networked systems, with applications in synthetic biology and autonomy. Current projects include design and implementation of synthetic cells and design, verification, and test synthesis for discrete decision-making protocols for safety-critical, reactive control systems. Dr. Murray’s professional awards include the Richard P. Feynman-Hughes Faculty Fellowship in 1993, awarded annually to an outstanding young faculty member in Engineering and Applied Science at Caltech, the National Science Foundation Early Faculty Career Development (CAREER) Award in 1995, the Office of Naval Research Young Investigator Award in 1995 and the Donald P. Eckman Award in 1997. He is a Fellow of the Institute for Electrical and Electronics Engineers (IEEE) and holds an honorary doctorate from Lund University in Sweden. He is an elected member of the National Academy of Engineering (2013). Dr. Murray received the IEEE Bode Lecture Prize in 2016, the IEEE Control Systems Award in 2017, and the AACC John R. Ragazzini Education Award in 2019. |