TLDR: This survey explores how legal and logical rules are being integrated into autonomous vehicle (AV) systems for perception, prediction, and planning. It details methods for making AVs understand and comply with traffic laws, from using AI with symbolic logic for robust perception to formalizing legal texts into machine-readable rules. The paper also covers how AVs plan movements under legal constraints, handle ambiguities and exceptions in laws, and provide explanations for their decisions. It highlights the challenges of scalability, cross-jurisdictional operations, and balancing strict compliance with human-like driving behavior, emphasizing the need for interdisciplinary collaboration to ensure legally compliant and trustworthy AVs.
As autonomous vehicles (AVs) move closer to widespread use, it’s becoming increasingly important for them to not only drive safely and efficiently but also to understand and follow traffic laws. This isn’t just about avoiding accidents; it’s also about being able to explain their actions, especially if an incident occurs. A recent survey explores how legal and logical rules are being integrated into the core functions of AVs: how they perceive their surroundings, predict what others will do, and plan their movements.
The survey highlights that a major challenge lies in balancing reliable perception, legal compliance, and the ability to justify decisions in complex and unpredictable driving situations. It introduces a way to categorize existing methods based on their underlying theories, how they are built, and how they are tested. The focus is on methods that can handle uncertainties in what the AV ‘sees’ and explicitly incorporate legal norms, leading to decisions that are both technically sound and legally defensible.
How AVs ‘See’ and Understand the World
For an AV to follow the law, it first needs to accurately understand its environment. This involves more than just traditional computer vision. Researchers are developing methods that combine artificial intelligence (AI) with symbolic reasoning to make perception systems more robust. For example, some approaches integrate logical rules directly into the AI’s learning process. This helps prevent errors, such as misclassifying a stop sign as a speed limit sign, even when faced with challenging conditions like bad weather or partial obstructions.
Another area of focus is ‘uncertainty quantification,’ where AVs not only detect objects but also estimate how confident they are in their detections. By incorporating domain knowledge, these systems can provide more reliable uncertainty estimates and ensure consistency across different perception tasks, like identifying a car’s type, location, and likely action. This helps AVs make more contextually aware decisions.
AVs also need to interpret complex traffic scenes at multiple levels, much like human drivers. New frameworks are being developed that use both general common sense and specific expert knowledge to understand scenes. This hierarchical approach helps AVs learn how different elements in a scene interact, improving both their understanding and their ability to explain what they perceive.
Finally, ensuring the reliability of these perception systems is critical. Formal verification techniques are used to check if the AV’s ‘seeing’ and reasoning processes meet safety and legal requirements. This involves rigorous testing and monitoring to ensure that the entire system, from sensing to action, aligns with legal and ethical standards.
Translating Laws into Machine Language
A fundamental step for lawful AV behavior is converting human-written traffic laws into a format that machines can understand. Traffic laws, written in natural language, are often ambiguous and difficult for AVs to interpret directly.
One approach is to use ‘logical specifications,’ such as temporal logics, which are mathematical frameworks for encoding time-dependent rules. For instance, a rule like ‘if the light is red, the car must eventually stop before the intersection’ can be precisely translated. These logics can not only flag violations but also quantify how well a rule is being satisfied, which is useful for nuanced laws like maintaining a ‘sufficient’ distance.
However, real-world driving often involves conflicting rules. To address this, the concept of ‘rulebooks’ has emerged. A rulebook establishes a hierarchy or priority among rules, allowing the AV to make principled decisions when it must choose the ‘lesser evil’ – for example, crossing a line to avoid an obstacle. This framework helps resolve conflicts by systematically relaxing lower-priority rules when necessary to satisfy higher-priority ones.
Researchers are also working on pipelines to extract formal rules directly from natural language legal texts. This involves translating legal text into structured logic, creating ‘Lawmaps’ to visualize legal requirements. Large-scale efforts are underway to digitize traffic regulations into databases, making them machine-interpretable and easier to update as laws change.
Planning Movements with Legal Constraints
When an AV plans its movements, it typically aims for safety, efficiency, and comfort. Legal compliance adds another layer of complexity, requiring planners to incorporate traffic rules as formal constraints. This means planned speeds must not exceed legal limits, and trajectories should avoid crossing solid lane markings.
Legal compliance can be integrated by restricting available maneuvers. For example, if a ‘no passing’ zone is detected, the system disables lane-change maneuvers for overtaking. Recent work even explores using large language models (LLMs) to interpret traffic laws and advise the planner, helping the AV understand regional rule variations and distinguish between strict laws and advisory guidelines.
Beyond generating a plan, AVs must verify that the planned trajectory complies with applicable legal rules before execution. ‘Runtime verification’ monitors the executed trajectory in real-time, flagging violations as they occur or are imminent. If a violation is detected, the plan can be rejected, or a safety supervisor can intervene. The goal is that if a rule must be violated due to external circumstances, the system does so minimally, justifiably, and with an auditable explanation.
Navigating Legal Ambiguities and Exceptions
Traffic laws are written for human interpretation and often contain ambiguities, vagueness, and exceptions. AVs must go beyond simply following formalized rules; they need to understand context, balance competing priorities, and justify necessary deviations.
‘Norm-aware behavior prediction’ is crucial here. AVs predict the behavior of other traffic participants by assuming they will generally follow rules, but also by detecting or forecasting when others might not. This helps the AV plan more defensively, anticipating potential rule violations by human drivers.
Ambiguity in natural language laws, such as ‘maintain a safe distance,’ is addressed by calibrating thresholds using statistical norms from human driving data or by incorporating court interpretations and standard formulas. This helps AVs interpret vague laws in a way that aligns with human understanding and judicial precedent.
The question of when an AV can break traffic rules is central to handling emergencies. Frameworks are being developed to explicitly model ‘rule exceptions.’ For instance, a base rule might be ‘do not cross a solid line,’ but an exception could permit ‘crossing a solid line to bypass a stalled vehicle if done with caution.’ This allows the system to determine whether a violation is justified due to an emergency condition, moving AVs closer to legal reasoning rather than mere rule-following.
Operating across different jurisdictions, where laws may vary, is another challenge. Frameworks that rely on centralized rule databases or retrieval aim to address this by allowing the AV to swap out rule sets while keeping the decision logic unchanged. However, ensuring correct interpretation, especially with AI models, remains a complex task.
Explaining AV Decisions
When an AV is involved in an incident, explaining its actions in legal terms is crucial for determining liability and building public trust. Research is focused on creating transparent and interpretable AV decision-making systems that can justify their actions.
Some systems can generate natural language explanations, linking specific rules to chosen actions. For example, an AV might explain: ‘It is illegal to turn right on red at this intersection because a sign prohibits it, so the vehicle waits.’ Formal verification approaches contribute through ‘proofs and counterexamples,’ identifying conflicting rules and explaining why a violation became necessary. Visual representations, like ‘Lawmaps,’ also help make decision flows comprehensible to both engineers and legal experts.
Post-incident accountability is a critical requirement. Online compliance monitoring systems continuously evaluate AV behavior against traffic laws, creating detailed records for incident reconstruction. These records can demonstrate in court that the AV made minimal, legally justified deviations to comply with higher-priority safety requirements.
Also Read:
- StuckSolver: An LLM-Powered System for Autonomous Vehicle Recovery
- The Two Faces of Agentic AI: From Logic to Generative Autonomy
The Road Ahead
While significant progress has been made in embedding legal specifications into AV decision-making, many challenges remain. These include the sheer scale of encoding a full traffic code for even one jurisdiction and maintaining it as laws change. Validating these systems across countless rare scenarios, balancing strict legal adherence with ‘socially acceptable’ driving behaviors, and seamlessly adapting to different jurisdictions are also major hurdles.
Ultimately, regulatory acceptance and legal liability are key. The industry may push for a ‘reasonable AV standard’ in law that acknowledges some flexibility. Proving that an AV’s planning module verifiably complies with all laws (except in emergencies) could reduce liability. The integration of legal specifications into AV technology is not just a technical goal but a socio-technical one, requiring ongoing collaboration between roboticists, legal scholars, and regulators to ensure that AVs are both safe and legally sound. You can read the full survey here.


