Legislating World-Model-Based Planning with Legal Reasoning
1Cognizant AI Lab · 2Washington University · 3Central Queensland University · 4UT Austin
Abstract
Laws as runtime constraints on a learned world model
As robotic systems grow more general, legal norms are needed to integrate them into society. This paper extends the isomorphism problem of aligning legal source texts with their encodings, and measures two key challenges to robot normative control: (1) the grounding isomorphism gap, where perception error grounds false atoms for legal reasoning, and (2) the ontological isomorphism gap, where one legal conclusion admits many faithful translations into planning constraints.
The paper introduces a legal planning stack that employs Defeasible Deontic Logic (DDL) to constrain a motion planner. The stack leverages learned world models to plan and to provide legal context, enabling ex ante governance that intervenes before an illegal action is executed. It was deployed on a simulated robot arm pushing a cube across a 3×3 grid. The findings were that (1) the legislated agent abided substantially more often than the non-legislated one, and modeling perception uncertainty lifted abidance even further, (2) the legal reasoning ran efficiently at runtime and its verdicts were auditable, and (3) the stack adapted to exogenous signals and endogenous rule changes. Both gaps were measured: (4) world model and probe error corrupted the factual input for the DDL reasoner, and (5) a single law admitted several faithful metric interpretations yielding drastically different abidance. Thus, ex ante legislation functions as intended, and closing these gaps — with a standardized mapping from the law to runtime constraints, and improved fact grounding from perception — will yield robust laws that align robot behavior with society's norms.
Episodes
What compliance and violation look like
Abiding
Four social runs. One routes around the center; the other three earn the crossing by checking in at a yellow cell first.
Blatant violation
The same environment with no legal layer. All four drive the cube straight through the forbidden center.
Edge graze
Four social runs whose footprint clips the center while the center point never enters. None of them reaches its goal.
The stack
The law enters through perception and leaves through the planner
That difference is produced by a stack, not a reward. A DDL rule base encodes the source text, learned probes ground its facts from pixels, and its verdict constrains the planner before an illegal action is ever executed. A Franka arm pushes a cube across a 3×3 grid with an illegal center cell; planning is RRT in the latent space of DINO-WM, and the cube's pose is never given, only read back from pixels. Four agents share all of it and differ only in what they do with a violation flag — they are the four series in the results below. See the paper for details.

The laws
A small rule base that still exercises every DDL construct
What the stack enforces is twelve rules. The center cell is off-limits (R2); a yellow sign obliges a check-in (R5); reaching it flips the sign green (R7), or red if the center was already entered (R7b); green then permits the center (R4), red freezes the agent (R9); and if the cube ends up inside anyway, R10 converts the prohibition into a duty to get out. Small, but it exercises a defeasible prohibition with an earned exception, a compensatory duty, a permission conflict, and a rule inserted at runtime. See the paper for details.
| R | Rule |
|---|---|
| R1 | cube ⇒O ¬off_grid |
| R2 | cube ⇒O ¬in_cell(4) |
| R3 | sign(red) ⇒O in_cell(4) |
| R4 | sign(green) ⇒P in_cell(4) |
| R5 | sign(yellow) ⇒O in_yellow_cell |
| R5b | occupies(Y), yellow_cell(Y) ⇒ in_yellow_cell |
| R7 | in_yellow_cell, sign(yellow) ⇒ sign(green) |
| R7b | in_yellow_cell, visited(4), sign(yellow) ⇒ sign(red) |
| R8 | goal_cell(N), [P]moving ⇒O in_cell(N) |
| R9 | [P]in_cell(4), [P]¬in_cell(4) ⇒O ¬moving |
| R10 | cube ⇒O ¬in_cell(4) ⊗ exit_cell(4) |
| R11 | sign(white) ⇒O in_start_cell — inserted at runtime |
Superiority: R4 > R2, R4 > R10, R7b > R7.
Audit trace
Watching the verdict and the goal switch mid-episode
Those rules interact, and the interaction is auditable. Here is a single social-agent episode, decision by decision: a violation, the duty that repairs it, and the record of the violation closing a door several steps later.

[O]exit_cell(4), and the exit succeeds. But the episode still carries
visited(4), so on arrival at the check-in R7b outranks R7, the sign flips
red instead of green, and R9's permission conflict freezes the agent.
The point: the law absorbs the violation rather than rejecting the agent, and the
earlier breach is still what closes the door.Results
Ex ante legislation works, and both gaps are measurable
So: does it work, and where does it break? It works — the legal layer is what produces compliance. It breaks in exactly the two places the law has to be translated: into facts, and into constraints. Full tables, confidence intervals and the runtime audit are in the paper.
The legal layer is what produces compliance

| Agent | Treats a deontic conclusion as… |
|---|---|
| Realistic | Nothing. No legislation; returns the lowest-cost plan in the tree. |
| Social | A hard constraint. Violating actions are pruned as the tree is expanded. |
| Deviant | A price. Violations cost λ = 0.067 m of progress each, never a veto. |
| Oracle | A hard constraint, but grounded on ground truth rather than probes. |
The Grounding Isomorphism Gap
Perception error grounds the law on the wrong cell: the atom the planner is pruned on describes a pose the cube never reaches.


The Ontological Isomorphism Gap
One law, several faithful readings. Re-scoring R2 alone on the same episodes — never rerunning them — moves measured abidance by tens of points, purely by changing what the rule is taken to mean.
| Agent | n | success | abidance, full path | abidance, at rest | |||
|---|---|---|---|---|---|---|---|
| center | footprint | center | footprint | center | footprint | ||
| realistic | 400 | 0.998 | 0.998 | 0.138 | 0.113 | 0.352 | 0.130 |
| social | 400 | 0.662 | 0.677 | 0.948 | 0.655 | 0.978 | 0.833 |
| deviant | 400 | 0.958 | 0.988 | 0.557 | 0.448 | 0.680 | 0.497 |
Bold is the reading actually implemented and reported everywhere else on this page. Full path uses the line between start and end poses; at rest only the frames the planner perceives. Center scores the cube's center, footprint its whole area. The social agent reads as 0.655 or 0.978 abiding depending only on which column you take as the law.
Contrary-to-duty: violation recovery
A compensatory duty (R10) turns a violation into a repair instead of a dead end, and the lawset can be amended while the agent is running.

Runtime cost
The reasoning is nearly free next to the search it governs
None of this matters if the legal layer cannot run at robot speed. It can: the whole symbolic path — grounding the atoms, running clingo, building the constraint — is nearly three orders of magnitude below the planner it constrains.

Inside the legislation layer, per deontic decision: perception and grounding 1.71 ms, clingo 14.68 ms amortized, constraint build 0.26 ms — 16.65 ms for a verdict.
Citation
BibTeX
@article{waldner2026legislating,
title = {Legislating World-Model-Based Planning with Legal Reasoning},
author = {Waldner, Dylan and Kantaros, Yiannis and Governatori, Guido
and Miikkulainen, Risto and Banifatemi, Amir},
journal = {arXiv preprint arXiv:2609.15113},
year = {2026}
}