Open research initiative · Design v0.2
The whole law of a legal order, written as one typed, testable program.
LexTML, the Lex Typed Meta-Language, is a design for a programming language that encodes the decision logic of law in full: what can be computed, what an official decides, and what calls for judgement. No compiler exists yet. The design is published first, so that lawyers and scientists can challenge it before any code is written.
- Design
- version 0.2
- Compiler
- not built yet
- Open hypotheses
- 97
- First pilot
- Ukrainian tax law
Why
Why another language for law
Law already runs as software, written far from the text. Encoding it faithfully exposes mistakes: the Catala project found a bug in an existing implementation of French family benefits while formalising them.
Existing languages cover the part of law that is computation. Much of law is something else: an official’s decision, an open standard such as “reasonable”, a precedent, a collision between two norms.
The aim is full coverage, not full automation. Every provision gets a typed representation. Only some get a deterministic answer. The rest get a structured, testable procedure whose output is advice with a trace.
The idea
How it works
Logic only
A program holds the logic of decision-making. Legal text stays outside and is referenced by an identifier and an edition.
One program per legal order
Legal institutions are classes, norms are methods, and each method is assembled from clauses bound to their sources.
The legal order describes itself
Sources, powers, ranking and conflict rules are written as norms in the same language. There are no dialects per country or legal family.
Exceptions, ambiguity and discretion are explicit
An exception stated by the text is its own construct. An ambiguous text can carry alternative readings. Every decision clause says whether it is a duty or a discretion.
Judgement as advice
An open standard becomes named criteria assessed by a model. The model is recorded with each result, and the output is advice with measured reliability.
Lawyers validate without reading code
Tests are part of the program. Lawyers check it through tests, traces and references to the text.
Three kinds of result
- Computed
- Worked out deterministically from the rules and the facts, with a trace to its sources.
- Decided
- A named actor picks one of a closed set of outcomes on stated grounds.
- Advisory
- For an open standard such as “reasonable”, a person decides, advised by a score, a rationale and measures of stability.
A result is never more trustworthy than what it depends on. An advisory result reaches a binding output only through a recorded adoption step by a named role.
Limits
What is not proven
LexTML is a design, not a product. Its limits are stated as plainly as its ideas.
Every known limitation is held as an open hypothesis with a test and a workaround. Version 0.2 lists 97 of them.
Nothing has been tested on real law yet. The first pilot will do that.
There is no formal grammar. The syntax in the documents is a placeholder.
Whether an automated or assisted decision is lawful is a question for each jurisdiction, and it is open.
Take part
Where your expertise is needed
The design has to hold for legal systems its authors do not know. That work needs you.
Legal theory and comparative law
Does the core fit your legal family? Test whether a legal order’s ranking of sources and its conflict rules can be written as norms, and where that fails for customary or religious law.
A specific legal system
Bring your legal order. Describe its sources, powers and conflict rules, and lead or review its encoding. Each legal order has its own repository.
Ukrainian legal orderLegal practice
Practising lawyers and tax specialists validate encoded norms through tests and traces, and say whether that is enough without reading code.
AI and law, formal methods, programming languages
Challenge the treatment of exceptions, alternative readings, precedent and the flow of trust between kinds of result. Point to prior work that was missed.
Public administration and legislative drafting
Show how duty and discretion, decision records and registers work in practice, and what would make a result usable by an official.
Call for discussion
Seven questions for readers
Kinds of result
Is the split into computed, decided and advisory results, with an enforced flow of trust between them, the right backbone for law as a whole?
Self-description
Can a legal order’s ranking of sources and its conflict rules be written as norms without distorting them?
Exceptions and readings
Do a text-stated exception with a declared effect and burden, and bounded alternative readings, match how lawyers reason about departures and ambiguity?
Validation
Would practising lawyers accept validating a program through tests, traces and references to the text, without reading code?
Judgement calls
Is criteria-based model advice with recorded reliability a defensible treatment of open standards, or should they stay outside the program?
Hypotheses
Which of the 97 does existing evidence already confirm or refute?
Prior work
What has been missed?
Pilots
Where the design will be tested
Ukrainian tax law
The first pilot, chosen for its importance and complexity. Status: planned. The inventory of the domain is the next step.
US trade-secret law
The second pilot: a domain built on precedent, to test the same language on case law.
A third pilot, with a community partner, on a legal order centred on custom
It is not planned yet, and a partner is sought. If that could be you, say so in the form.
Read
Documents
Three documents, published under CC BY 4.0 in one repository. Comments and proposals are welcome there as issues and discussions.
Language Specification v0.2
The design, a syntax sketch, and the registers of decisions and hypotheses.
Implementation Guide v0.2
Recommended practice that the language does not enforce: test levels, judgement models, registers, and how lawyers validate.
Pilot Plan v0.2
The pilots, the working order, and the step at which each hypothesis is tested.