The Self-Driving State – now published by Springer. Discover the book

ReqPOOL
Back to the blogVision

Digital Twins of Legislation: What a Law Can Do as a Model

What a digital twin of legislation is, why an online form is not a model of the law, and what a law as a model can and cannot do.

Date

15 March 2025

Author

Florian Schnitzhofer

Reading time

10 min read

Tags

Digital Twin of Legislation, Self-Driving State, Rules as Code, Administrative Law, Legal Informatics
Workshop at ReqPOOL: a consultant explains processes and systems at a wall of colorful sticky notes while a colleague at the table and another in the foreground listen; on the right the image blends into blue wave shapes on a dark background.

Laws are passed as prose and promulgated as prose, and every authority, every software vendor, and every company that has to apply a law translates the same provisions into its own programs once again, with its own reading and its own mistakes. A digital twin of legislation starts exactly there: a model of the law that can compute, justify, and keep pace with every amendment. This post opens a series on our research at Johannes Kepler University Linz; it explains the basic concept, distinguishes it from the digitization of forms, and shows what a law can do as a model and where it ends.

One law, many implementations

Today, the path of a law into practice is a path of repetition. Lawyers draft the text, parliament passes it, the official gazette promulgates it. Then the real work begins: ministries adapt their case-processing systems, software vendors update payroll programs and ERP systems, accounting firms maintain spreadsheets, companies change configurations. Each of these parties reads the same text, interprets it, and rewrites it into code or into work instructions. Dag Wiese Schartum described this translation process in 2020 in "From Legal Sources to Programming Code": lawyers verbalize the rules, technologists translate them, and both sides iterate until the result is right. The model is clean, but it runs from scratch in every organization.

The consequences are threefold. Effort multiplies with the number of implementers, because every organization builds the same logic again. Results diverge, because every translation carries its own interpretations and its own errors; two businesses in identical situations then pay different amounts simply because their software was programmed differently. And every amendment triggers a cascade of changes that would have to happen everywhere at the same time and correctly. In our contribution to the International Legal Informatics Symposium IRIS 2025 in February, we described this state as an n-fold implementation effort per legislative change (Schnitzhofer 2025, "Towards the Design of Digital Twins for Tax Law").

From a rule-of-law perspective, this is more than an efficiency problem. Law is meant to be applied equally and predictably. If its application takes place in hundreds of separate, proprietary implementations, nobody can verify whether any one of them actually follows the statute.

Why an online form is not a model of the law

When people talk about digitizing public administration, they usually mean forms: the application that used to be submitted on paper is filled in online, the attachments are uploaded, the decision arrives in an electronic mailbox. That is progress for citizens, but it does not change where the law lives. The form digitizes the interface between people and the authority. The rule by which the application is decided remains prose and is applied by a case worker, or it is hard-coded in a case-processing system where nobody but the developers can read it anymore.

In our book "Der selbstfahrende Staat" (Springer Gabler 2024, in German), we describe the development of the state in four stages modeled on the autonomy levels of self-driving vehicles: analog, digital, automated, self-driving. The online form belongs to the digital stage. It replaces the paper, not the decision. The transition to the automated stage demands something different: that the norm itself exists in a form that software can execute.

The concept of the digital twin helps to grasp this difference. In a 2018 literature review for manufacturing, Kritzinger et al. distinguished three levels by the degree of data integration: the digital model, which is maintained by hand; the digital shadow, which is fed automatically from the original; and the digital twin, in which data flows automatically in both directions. Transferred to law, an online form is at best a digital model of the paper form. A twin of legislation is a model of the law itself, kept in sync with the text.

Level What is digitized What happens when the law is amended
Online form the interface between people and the authority form and work instructions are adapted; the decision remains manual work
Case-processing system with hard-coded rules the workflow of a single authority every system is reprogrammed individually, n times across the state
Digital twin of legislation the norm itself the model is updated once; all connected systems follow

What a digital twin of legislation is

Digital twins come from engineering. There they denote the virtual replica of a machine, a plant, or a building that represents a deliberately limited slice of reality and is kept synchronized with the original in order to monitor, simulate, and control (Tao et al. 2019; Jones et al. 2020). The point lies in the limitation: a twin does not represent everything, only what is needed for a purpose.

Transferred to legislation, we defined the term in the book as follows:

A digital twin of legislation is the formal representation of a prose law and defines all rules required for decisions based on that law as formal rule sets.

You can think of the twin as a configuration file for a program: decision rules, decision parameters, and the structure and meaning of the decision data are defined in it in machine-readable form. The prose text remains the law. The twin is its executable annex: in the target state it is published together with the text, checked for conformity with the text before publication, and usable by everyone under a free license.

In the IRIS paper, we developed this idea into an architecture with four layers. The template was the structure of smart contracts as described by the Accord Project, with the levels text, model, and logic; we added an ontology:

  1. Text. The legal text in natural language, unchanged and in its original form. It remains the reference point for all other layers.
  2. Ontology. The concepts of the law and their relationships: who is involved, which legal objects exist, how they are connected. For the Income Tax Act, for example, taxpayers, income categories, tax credits, and deductions.
  3. Model. The parameters the law sets: tax brackets with lower bound, upper bound, and rate, as well as income thresholds. They inherit their meaning from the ontology.
  4. Logic. The calculation rules and decision rules including exceptions, implemented in a formal language and callable through an interface.

An execution system, which we call the Digital Execution System, supplies the twin with case data, calls its interface, and processes the result. Our prototype for a section of the Austrian Income Tax Act uses OWL for the ontology and Python for the logic. How a prose text becomes such a model is something we will cover separately in this series.

From the XML experiment to the layered model

The path to the four layers led through a detour that I consider instructive. For the book, we translated the entire Austrian IT collective agreement of 2023 into a digital twin, together with Markus Knasmüller of the ERP vendor BMD, Thomas Oberngruber of the Upper Austrian Economic Chamber, and the lawyer Wolfram Hitz. The format was XML: tags for groups of persons, salary grades, and other semantic categories.

We learned two things. First, some parts of a body of rules can be formalized almost effortlessly, the salary table for instance. Others, such as the process rules on the negotiation and validity of the collective agreement, are practically impossible to transfer into formal structures; they belong in a case-processing system, not in the twin. Second, a purely structural representation is not enough. The XML document made the agreement searchable but not executable; the goals of cost savings and automation were missed. For automated reasoning, the model needs, beyond structure, the meaning of the terms and a logic separated from them. That is exactly what the ontology and logic layers provide. The architecture we pursue today grew out of this failure.

What the model can do

A law that exists as a model can do five things a prose text cannot.

  • Compute. From complete case data, the model derives the legal consequence deterministically: the same amount, the same classification, on every call and in every connected system.
  • Justify. Because every rule and every parameter points to a passage in the legal text, the model can state for every result which provision was applied with which value. That is the basis for a traceable and contestable decision.
  • Keep pace. If the legislature changes a rate or a threshold, an entry in the model layer changes; the logic remains untouched. If a term changes, the ontology changes. The model separates what an amendment typically changes from what stays stable.
  • Once instead of n times. The twin is built, checked, and published once. Authorities, software vendors, and companies call it through an interface instead of rebuilding it.
  • Test and simulate. An executable model can be tested against cases that experts have decided in advance and versioned with the tools of software engineering. The legislature can thus calculate what a change will do before passing it.

I consider the last point underestimated. Working on the model forces you to name ambiguities in the text before they are resolved differently in hundreds of implementations. New Zealand's Better Rules initiative experienced exactly that when it drafted bills in parallel as program code (Barraclough et al. 2021): the code exposed ambiguities that would have gone unnoticed in the text. And unlike a language model that can summarize a legal text, a model of the law does not deliver a probable answer but a definite one that can be checked line by line.

Where the model ends

A law as a model replaces neither the law nor lawyers. Its limits can be named clearly and belong to the design from the start.

First, discretion. Indeterminate legal terms, balancing exercises, and hardship cases are deliberately left open; they call for judgment, not calculation. The complexity of law, the incompleteness of any logic, and the intentionally open wording of many provisions (Prakken and Sartor 2015) are the reason we will never automate all decisions. A twin therefore represents only the deterministic, parameterizable parts of a decision and must make visible where it cannot decide.

Second, the hierarchy of law. Above every statute stands the constitution, below it regulations, alongside it court decisions that shape its interpretation. A self-contained, complete twin of a single statute is therefore out of reach. In the book, we derived from this the recommendation to start with the concrete provisions and to take every amendment and every new law as an occasion to publish a twin as an additional legislative service.

Third, time. In the book we expect a transition of 15 to 20 years and twins as annexes to prose laws by 2040, not a switchover in one stroke. The prose law remains authoritative during this time; the twin gains acceptance by proving reliable.

The research program I pursue at the Institute of Business Informatics – Data & Knowledge Engineering at JKU Linz together with Christoph Schütz works along these limits: which parts of a legal text can be formalized, which decisions can be automated, and where does the human being remain indispensable?

The next step

You will find the state of the research program and the IRIS 2025 papers on the page Digital Twin of Legislation and among our publications. If you are responsible for a law with clearly parameterized calculation rules in a public authority or a software company and want to know whether it lends itself to a twin, get in touch.

Share this article
Florian Schnitzhofer
Author

Florian Schnitzhofer

CEO ReqPOOL Group · More about Florian

Get in touch

Arrange a no-obligation initial conversation with our contact person.

Christian Buchegger

Chief Sales Officer & Authorised Signatory

Book an expert consultation