NormEngineer
Menu
Rules as codeSupported

Catala

Literate programming for law: default-logic rules beside the statute's text, typechecked and tested.

What it is

Catala is a programming language for law created at Inria, open source under Apache-2.0 and released about monthly. A Catala file is Markdown: the legal text, piece by piece, alternates with code that formalises it in default logic, where exceptions refine general rules. It is used for French tax and benefit law.

Good for

  • Computing whether a norm applies to a case, with exceptions in default logic.
  • Reviewing rules next to the provision they formalise, in one literate file.
  • Teams that compile rules to OCaml, Python, Java or C.

What an extraction gives you

The act becomes one scope; the parties and facts of a case are its inputs, each norm a labelled rule under its source quote and ELI link, exceptions and precedence exception rules; measured thresholds are typed (money, decimal, date, duration) and due dates are computed.

The download

One file, catala.catala_en: literate Markdown in Catala's English dialect. The disclaimer and the fidelity summary are a Markdown quote at the top of the literate text.

How norms appear

The graph and the file name each part of a norm in Catala's own terms.

How a norm's parts are named in Catala
In the actIn Catala
A party the norm addressesParty
ObligationObligation
PermissionPermission
ProhibitionProhibition
What the party doesAction
ConditionFact (under condition)
Exceptionexception
Precedence over another normexception (overriding norm)
Catala excerptDigital Operational Resilience Act (DORA, CELEX 32022R2554), Art. 19(1). From NormEngineer's test samples; their source quotes are abridged. Shortened: … marks lines left out of the file.
## Article 19

### Art. 19(1): dora.art19.1

“Financial entities shall report major ICT-related incidents to the relevant competent authority” ([Art. 19(1)](http://data.europa.eu/eli/reg/2022/2554/art_19/par_1/oj))

Obligation of Financial entity: report the incident to the relevant competent authority (to Relevant competent authority).

```catala
scope Norms:
  label dora_art19_1 rule dora_art19_1_applies
    under condition party_is_financial_entity and an_ict_related_incident_is_classified_as_major
    consequence fulfilled
```
…
```catala
#[test]
declaration scope TestDoraArt191:
  output when_it_applies content Norms

scope TestDoraArt191:
  definition when_it_applies equals
    output of Norms with {
      -- an_ict_related_incident_is_classified_as_major: true
      -- party_is_financial_entity: true
    }
  assertion when_it_applies.dora_art19_1_applies
```

On the extraction's page

Graph
The norms as a 2D or 3D graph in Catala's vocabulary, each traced to its source quote.
Source
The Catala file with its validation result, to read and download.
Fidelity
How fully each norm is expressed in Catala, and which checks ran.

How it is checked

  • Every source quote is verified against the act.
  • NormEngineer's structural validator checks the Catala file of every extraction.
  • The official toolchain, catala typecheck and clerk test, does not check each extraction. NormEngineer's tests check sample output written the same way with it; check your download with it to confirm.
  • The file includes a test per norm, written for clerk test; NormEngineer does not execute them on your extraction.

The Fidelity tab of each extraction says which checks ran on it. An extraction is AI-generated and not legal advice.

How fully it expresses a norm

When each norm applies, from its party, typed facts, exceptions and precedence, is computed by the scope, and so are due dates in days, months or years.

What Catala does not express fully

  • Partly expressed

    The DSL computes when the norm applies; whether it obliges, permits or prohibits, and what, is text rather than logic.

    Every norm: the scope decides whether it applies; what it requires is in the literate text.

  • Partly expressed

    The deadline, or part of it, is in a comment or prose and is not computed.

    When a deadline is in hours: Catala has no time of day.

  • Partly expressed

    A precedence over another norm is left out because it would make the rules circular.

    Rarely: when two norms would each take precedence over the other.

Each extraction's fidelity report counts the norms each of these applies to.