TL;DR
This paper introduces efficient methods for "trace repair"—the process of minimally adjusting a robot's recorded path or actions so that they satisfy a complex formal specification. By combining Temporal Behavior Trees (TBTs) with novel incremental and landmark-based optimization strategies, the authors successfully repaired traces with over 25,000 entries in under ten minutes, a feat that causes standard mathematical solvers to run out of memory.
What Problem Does This Paper Address?
In robotics and cyber-physical systems (CPS), we often use formal specifications to define how a system should behave. However, real-world executions (traces) frequently violate these specs due to sensor noise, imperfect planners, or environmental shifts.
"Trace repair" asks: What is the smallest change I can make to this failing execution to make it succeed? Solving this is vital for:
- Explainability: Showing exactly where and by how much a maneuver failed.
- Plan Correction: Fixing the output of an untrusted or "black-box" AI planner.
- Training: Generating high-quality, successful examples for machine learning from near-misses.
The mathematical tool usually used for this is Mixed-Integer Linear Programming (MILP). While powerful, MILP's complexity explodes as the trace length increases. For complex specifications like Temporal Behavior Trees (which combine the hierarchical logic of Behavior Trees with the timing constraints of Signal Temporal Logic), standard MILP simply doesn't scale to real-world mission lengths.
Methods
The authors propose two complementary strategies to bypass the "MILP bottleneck":
- Incremental Repair: This strategy uses a "divide and conquer" approach. Instead of encoding the entire mission into one massive optimization problem, it uses a TBT Monitor to segment the trace. It attempts to repair individual "leaf" behaviors (like "move to position") locally. If a local fix works without breaking the rest of the mission, the process stops. If not, it incrementally moves up the tree hierarchy to repair larger segments.
- Landmark-based Repair: This strategy turns the discrete, "hard" choices of a specification (e.g., "should I go to Location A or Location B?") into a simpler Linear Programming (LP) problem. It identifies "landmarks"—specific points in the trace that are likely candidates for satisfying the spec—using the robust semantics of TBTs as a heuristic. By picking the most promising landmark first, the solver avoids the exponential cost of exploring every possible logical path.
These methods assume the system follows linear discrete-time dynamics (e.g., $X_{t+1} = AX_t + BU_t$).
Datasets
The paper evaluates the methods using two primary case studies rather than a static public dataset:
- Robot Search Task: A simulated robot must find an apple or an orange at three different locations while avoiding restricted areas. This tests the system's ability to handle "Fallback" (OR) logic and spatial constraints.
- UAV Ship Landing: A high-fidelity simulation of an unmanned aerial vehicle (UAV) attempting to land on a moving ship. This involves complex timing, heading alignment, and 3D trajectory constraints. The traces used here ranged from ~1,000 to over 25,000 entries.
Key Insights and Ideas
- Segmentation as a Roadmap: The most powerful idea is leveraging the hierarchical structure of Behavior Trees to localize failures. If a robot fails a 10-minute mission in the 9th minute, you shouldn't need to re-calculate the first 8 minutes.
- Robustness as a Heuristic: Signal Temporal Logic (STL) provides a "robustness" value—a numerical score of how much a spec is satisfied or violated. The authors use this score to rank "landmarks," allowing them to solve a series of fast, continuous optimization problems instead of one slow, discrete one.
- Minimal Intervention: By using $L_1$ and Hamming distance cost functions, the repair ensures the "corrected" trace stays as close to the original "human/planner intent" as possible, rather than generating a completely new, alien trajectory.
Key Results
- Scalability: For a UAV landing trace with 1,014 entries, the Incremental Repair finished in 30 seconds, while the standard MILP approach took over 2,000 seconds (a ~66x speedup).
- Extreme Lengths: The Landmark-based Repair successfully processed a trace with 25,348 entries in 362 seconds. Standard MILP solvers crashed or ran out of memory on this same task.
- Qualitative Success: In the ship landing scenario, the repair successfully corrected a heading misalignment that was too subtle for a human operator to easily detect but enough to violate the formal safety specification.
Limitations and Future Work
- Fixed Trace Length: Currently, the algorithms can modify the values in a trace (position, velocity) but cannot change the duration of the trace. If a repair requires the robot to move slower and thus take more time, the current system cannot find that solution.
- Linear Dynamics: The repair assumes linear system models. While many systems can be linearized, highly non-linear maneuvers (like aggressive drone acrobatics) might not be perfectly captured.
- Infeasibility: If a trace is "too broken" to be fixed within the given system constraints, the algorithm returns
none. The authors suggest that "refining the TBT specification" (making the requirements less strict) is a necessary next step for such cases. - Future Direction: The authors plan to integrate trace repair into reinforcement learning loops to help agents learn from their mistakes more efficiently.
Summary updated