Why Law Is Law-Shaped

How amendment-driven text leads to an auditable replay design.

Elias Kunnas

I. The Structural Constraint

For amendment-driven statute collections, law is an incrementally maintained system authored by different institutions over time, with fine-grained addresses used for external reference.

This pattern appears across many civil-law, common-law, and hybrid systems, although their source formats and authority rules differ. Three properties shape the software model:

  • Incrementally maintained: Amendments usually modify specific provisions of existing statutes. The legal state at a given time combines acts enacted at different times and under different source conditions.
  • Distributed authorship: Different legislatures and publication bodies contribute provisions at different times. A current text therefore needs provenance for the source event and transformation that produced each portion.
  • Fine-grained addresses: Other laws, decisions, and contracts cite provisions such as “Section 12(2) of Act X.” These references point into the legal corpus. Renumbering can change a path, so a replay system must record address changes and preserve the relevant lineage.

Software version control offers a comparison: both code and statute collections need to explain incremental changes and preserve references. The comparison is an analogy, not a claim that legal authority works like a repository.

II. The Tree Is a Serialization Format

Statutes are organized as trees: parts contain chapters, chapters contain sections, and sections contain subsections. The hierarchy gives a document stable units for drafting, publication, navigation, and citation.

A tree alone does not encode all of the relationships that affect how provisions are read:

  • Section 12 says “as defined in Section 4” — a cross-reference, a pointer from one node to another, often across branches.
  • Section 30 says “notwithstanding Section 15(3)” — a conditional override, an edge that modifies the meaning of a distant node.
  • A tax statute says “as specified in Regulation (EU) 2016/679 Article 4” — a cross-jurisdiction dependency, linking nodes in different legal corpora entirely.
  • An EU directive can require national implementation — a cross-jurisdiction relationship between the directive and one or more national measures.

These are graph relationships. They connect nodes across branches of the tree, across statutes, and sometimes across jurisdictions. The document tree holds each provision’s content and position; a separate reference or dependency model is needed to represent those connections.

This separation of document structure from references and analysis is reflected in standards such as Akoma Ntoso, ELI, and FRBR; LegalRuleML addresses a different, rule-oriented layer. LawVM’s narrower argument is that the text layer should be computed as a reproducible, inspectable replay process before semantic tools rely on it.

III. The Amendment as an Operation

An amendment act can specify that “Section 12, subsection 2 is amended to read as follows.” At the text-state layer, that instruction has a typed operation shape:

  • A target address: Section 12, subsection 2
  • An action: replace (or: repeal, insert, renumber)
  • A payload: the new text
  • A source: which act, enacted when, effective when, by whose authority

LawVM’s supported vocabulary of text-level operations is deliberately small:

Action Structural effect
Replace Node content update
Repeal Tombstone version (not deletion — see §III.1)
Insert New node at specified position
Renumber Address change, identity preserved
Text-replace Substring substitution within a leaf
Text-repeal Substring removal

These operation families appear in LawVM’s typed model and in selected Finnish, UK, and Estonian source paths, although syntax, coverage, and authority differ. The shared vocabulary is an interface for the text-state layer, not a claim that the jurisdictions have identical amendment law.

III.1: Cases outside the text-operation vocabulary

The text-level operation vocabulary captures changes to serialized text. Changes in legal meaning require semantic or authority-layer operations, including:

Interpretive overlays. “Section 5 shall be read as if ‘the Board’ meant ‘the Council’.” The text of §5 is unchanged. Its meaning changes. This is a semantic operation, not a text operation. Common law “deeming clauses” and reading-down provisions operate this way.

Delegated legislation. An act empowers a minister to make regulations. This creates authority to produce new law — a meta-operation that generates future operations, not an operation on existing text.

Conditional applicability. “This section applies only to entities exceeding a turnover of €10M.” The text exists unconditionally; its legal effect is conditional. The condition is metadata, not a text operation.

Revivor. If a repealer is itself repealed, does the original provision revive? The answer is jurisdiction-dependent (no in some common law systems, yes in others). The tombstone model (repeal = version with null content) doesn’t inherently resolve this — it requires a policy decision at the VM level.

These are real phenomena. A compiler that claims to capture “what the law says” must either model them or explicitly scope itself to the text layer. LawVM takes the second approach: it compiles the text state — what each provision literally says at a point in time — and leaves the normative state (what the law means, how it applies, what obligations it creates) to downstream semantic tools. This is a deliberate separation of concerns: establish a declared textual substrate first, then attach interpretation and application claims to it.

IV. Multiple Time Axes

An amendment can be published before its provisions take effect. During that interval, the amendment exists in the publication record while the provisions it modifies remain under the prior legal-effect regime.

Law has at least two temporal dimensions:

  1. Event/publication time: when the amendment was enacted and published under the relevant source regime
  2. Legal effect time: when the changed provisions enter into force

These axes are independent. “What has parliament decided?” and “what is the law?” give different answers during the gap.

Replay may also need to represent:

  • A single amendment act can specify different effective dates for different provisions (§§1–5 immediately, §6 next year, §7 “when a decree so provides”).
  • Retroactive amendments in jurisdictions that permit them can assign a legal effect to an earlier period. A publication date alone therefore cannot determine every historical state.
  • Continuing application can preserve the relevance of a provision for past events after repeal. The text-state timeline and the applicability rule then answer different questions.

A third operational axis exists: corpus observation time — when the compiler ingested the data. If Finlex publishes a correction, the corpus before and after differs. Reproducibility requires recording which source version was used.

A normal version-control checkout exposes commit history. A legal point-in-time query also needs explicit models of effect, territory, sector, and contingency.

V. Granularity Follows the Amendment System

The tree structure suggests that provisions (sections, articles) are the atoms — the smallest units. In practice, the atom is whatever granularity the amendment system addresses.

Most amendments target structural nodes: replace this section, repeal this subsection. These are tree operations.

But text-level amendments go below any structural node: “In Section 12(2), the words ‘Secretary of State’ are replaced by the word ‘Minister’.” This targets a substring within a leaf node. The sentence is not a node in the tree. The amendment operates at a granularity finer than the tree’s resolution.

Two regimes:

  1. Structural operations: target a node. The tree handles these.
  2. Text operations: target content within a node. The tree represents the result (leaf text changed) but not the operation (which words and why).

A word substitution such as replacing “Secretary of State” with “Minister” can change statutory powers. The compiler records the text mutation; downstream analysis determines its normative consequence. Keeping those claims separate prevents a string-level result from being presented as an interpretation.

VI. Addressing and Identity

Systems that maintain hierarchical structures and expose fine-grained references often use path-based identifiers. Legal systems are one example.

  • Law: §12(2)(c) — path through the statute tree
  • ELI (European Legislation Identifier): /eli/fi/sd/2002/738/...
  • FRBR (Functional Requirements for Bibliographic Records): Work → Expression → Manifestation → Item hierarchy

Each example identifies an object by its place in a structured hierarchy, though the identity and update rules differ. LawVM uses legal addresses for operation targets and records lineage when a target is renumbered.

When multiple authors modify a hierarchy while external systems cite its parts, the path and the identity behind that path both need explicit rules. A path alone does not preserve identity through every amendment.

Path-based addresses have a known weakness: they are positional. Insertion of §11a between §11 and §12 doesn’t break §12’s path, but renumbering (§12 becomes §13) does. This is why renumber is an explicit operation in the vocabulary — it records address changes so that external references can be updated. FRBR and ELI handle this through abstraction levels (Work-level identity survives Expression-level renumbering). LawVM’s ProvisionTimeline preserves identity through renumber events — the same timeline, new address.

VII. Authority Models Vary

Jurisdictions assign different roles to consolidated texts. LawVM must declare that role before interpreting a divergence.

Finland: Finlex’s updated text is a derived comparison surface for this workflow; the enacted publication is the original Statute Book material and amending acts. LawVM therefore acts as an independent replay witness, and a mismatch remains a finding to investigate.

Estonia: Riigi Teataja’s publication regime gives its official consolidated texts a different legal role. LawVM therefore serves as an independent consistency check; an apparent divergence is legally sensitive and not automatically a defect.

United Kingdom: legislation.gov.uk maintains a revised electronic version with effect metadata. LawVM can check a declared version/effect surface independently.

The same text-operation vocabulary can support different review workflows because the authority and comparison roles differ.

VIII. Why General Replay Remains Hard

Prior legislative-consolidation systems and legal-informatics standards address parts of this problem: document structure, identifiers, linked data, rule representation, editorial consolidation, or versioned publication. The selected prior work linked in the parsing article makes the overlap concrete. These systems are relevant inputs and comparison surfaces; a general replay workflow still has to connect source acquisition, amendment parsing, target resolution, temporal policy, and evidence classification across jurisdictions.

LawVM occupies that narrower intersection: amendment text in, admitted typed operations and timelines out, with residuals retained instead of hidden. The claim is about an explicit boundary and an open artifact, not priority over prior work. The difficulty is the combination of language, source regimes, authority models, and time rules rather than any one missing data structure.

IX. The Resulting Design

These constraints explain the design choices for the declared source lanes:

  • A hierarchical node representation (IRNode) because many source statutes use nested document structure
  • Typed operations (LegalOperation) because amendments are structured operations, not prose edits
  • Typed path-based addressing (LegalAddress) because amendments target fine-grained document structure
  • A graph model (ProvisionTimeline + operation edges) because law operates as a graph despite being serialized as trees
  • Multiple temporal axes because law has irreducibly multi-dimensional time
  • Scope predicates because applicability varies along dimensions orthogonal to time and structure
  • Jurisdiction-agnostic core because the operation interface can be shared even though surface languages, coverage, and authority models differ
  • Explicit text/semantics boundary because compiling the text correctly is prerequisite to interpreting it correctly — and because the text layer is computationally tractable while the normative layer requires interpretation

The design target is a versioned legal-text substrate: provision versions as nodes, operations as edges, and queries for point-in-time materialization, cross-date diffs, lineage, and declared dependencies.

LawVM supplies that text-state and evidence boundary. Interpretation, doctrine, praxis, and products can attach claims to its anchors without being smuggled into replay output.


This essay explains the structural constraints behind LawVM, an open-source replay compiler for amendment-driven law. See the Finland benchmark snapshot for empirical evidence, or the repository.