Slow Down, Move Over: A Case Study in Formal Verification, Refinement, and Testing of the Responsibility-Sensitive Safety Model for Self-Driving Cars

Megan Strauss, Stefan Mitsch

Introduction

Ensuring the safety of autonomous vehicles (AVs) remains one of the most significant hurdles in the path toward full deployment. Currently, the industry relies on two distinct paradigms: formal verification and empirical testing. Formal verification utilizes mathematical proofs to guarantee that a system remains safe under all defined conditions, but these models are often abstract and nondeterministic. Conversely, simulation and road testing involve executable code in specific scenarios, but they cannot exhaustively prove safety across the infinite variety of real-world situations.

This paper addresses the critical "gap" between these two worlds. While a formal model might state that a car can brake at any rate within a specific range, actual software must be deterministic, choosing a specific value. This research provides a verified pipeline that bridges this divide, ensuring that the safety guarantees established on the whiteboard are preserved all the way to the Python code running in a simulator.

Methodology: Correctness-by-Construction

The authors propose a "Correctness-by-Construction" workflow that links high-level safety requirements to low-level execution. This framework utilizes several advanced formal methods tools:

  • Differential Dynamic Logic (dL): This logic is used to model the car’s hybrid nature—combining continuous physical motion (kinematics) with discrete software control decisions.
  • KeYmaera X: An automated theorem prover for hybrid systems used to verify that the Responsibility-Sensitive Safety (RSS) model effectively prevents collisions.
  • Differential Refinement Logic (dRL): This method allows the authors to prove that a specific, deterministic controller is a valid "refinement" of the broader, verified safety envelope. If the broad envelope is safe, any valid refinement within it inherits that safety.
  • Verified Compilation: To prevent manual coding errors, the authors developed an intermediate language called det-HP and a set of compilation rules to translate formal models directly into executable Python code.
  • ModelPlex: This tool generates "runtime monitors"—lightweight code snippets derived from the formal proof. These monitors run alongside the simulation to flag any control decisions that might violate the safety model before a collision occurs.

Key Insights and Safety Proofs

Optimality of RSS

Beyond simply proving that the RSS model is safe, the authors provide mathematical evidence of its optimality. They demonstrate through Theorems 3 and 4 that the "safe distance" defined by RSS is the minimum required distance; if this distance were reduced by even a tiny margin ($\epsilon$), a collision could be mathematically guaranteed under worst-case conditions. This establishes a rigorous lower bound for safe following distances.

Safety Transfer and Refinement

A core contribution of this work is the concept of safety transfer. By proving a nondeterministic model safe, developers can then write specific driving logic (e.g., for comfort or fuel efficiency) and, as long as that logic is a formal refinement of the original model, the safety proof remains valid. This allows for a "safety bubble" within which developers can innovate without compromising core guarantees.

Loop Invariants as Documentation

The research highlights that the "loop invariants"—the conditions that must remain true throughout the execution of the control loop—discovered during the theorem-proving process serve as the ultimate form of documentation. They provide a concise, mathematical explanation of exactly why the system is safe, which is far more robust than traditional text-based documentation.

Results and Evaluation

The framework was evaluated using formal models of longitudinal (straight-line) scenarios, including both same-direction and opposite-direction traffic. The key results include:

  1. Verified Safety: Theorems 1 and 2 formally verified the safety of the RSS longitudinal model.
  2. Pipeline Validation: The authors successfully demonstrated a complete path from a dL formula to a running Python simulation, with safety proofs preserved throughout the compilation process.
  3. Runtime Detection: Using ModelPlex, the authors showed that runtime monitors could successfully detect when an unverified or "faulty" controller made a decision that violated RSS rules, providing a critical layer of defense-in-depth.

Limitations and Future Work

While this study provides a robust foundation for longitudinal safety, several challenges remain:

  • Lateral Complexity: The current model focuses on straight-line motion. Lateral safety (lane changes and swerving) is significantly more complex because velocity changes in those scenarios do not require the vehicle to come to a full stop to "reset" the safety state, making the mathematics of hybrid systems much harder to solve.
  • Physical Fidelity: The model currently uses kinematic equations. Future iterations will need to account for more complex dynamics, such as tire friction, road incline, and weather conditions.
  • Automated Falsification: The authors aim to integrate these runtime monitors with automated "falsification" tools that actively search for edge cases to stress-test the boundaries of the safety model.

Conclusion

By linking formal proofs with executable code, this research provides a roadmap for building autonomous systems that are not just "tested" to be safe, but are safe by design. The use of refinement logic and runtime monitoring ensures that the rigorous standards of formal verification can finally be applied to the practical, deterministic software that drives the cars of the future.

Summary updated

BibTeX
@inproceedings{strauss2023slow,
  author = {Megan Strauss and Stefan Mitsch},
  title = {{Slow Down, Move Over: A Case Study in Formal Verification, Refinement, and Testing of the Responsibility-Sensitive Safety Model for Self-Driving Cars}},
  booktitle = {TAP},
  year = {2023},
  doi = {10.1007/978-3-031-38828-6\_9},
}
Figure