package catala

  1. Overview
  2. Docs
Compiler and library for the literate programming language for tax code specification


Dune Dependency






Catala is a domain-specific language for deriving faithful-by-construction algorithms from legislative texts. See for more information

Published: 22 Mar 2023


Catala logo


Explore the docs »
View TutorialReport BugContributeJoin Zulip Chat

Catala is a domain-specific language for deriving faithful-by-construction algorithms from legislative texts. To learn quickly about the language and its features, you can jump right to the official Catala tutorial. You can join the Catala community on Zulip!

Table of Contents


Catala is a programming language adapted for socio-fiscal legislative literate programming. By annotating each line of the legislative text with its meaning in terms of code, one can derive an implementation of complex socio-fiscal mechanisms that enjoys a high level of assurance regarding the code-law faithfulness.

Concretely, you have to first gather all the laws, executive orders, previous cases, etc. that contain information about the socio-fiscal mechanism that you want to implement. Then, you can proceed to annotate the text article by article, in your favorite text editor :


Once your code is complete and tested, you can use the Catala compiler to produce a lawyer-readable PDF version of your implementation. The Catala language has been specially designed in collaboration with law professionals to ensure that the code can be reviewed and certified correct by the domain experts, which are in this case lawyers and not programmers.


The Catala language is special because its logical structure mimics the logical structure of the law. Indeed, the core concept of "definition-under-conditions" that builds on default logic has been formalized by Professor Sarah Lawsky in her article A Logic for Statutes. The Catala language is the only programming language to our knowledge that embeds default logic as a first-class feature, which is why it is the only language perfectly adapted to literate legislative programming.

Getting started

To get started, the best place is the tutorial of the language. A French version is also available but might be out of sync with the latest language features.

Building and installation

Catala is available as an opam package! If opam is installed on your machine, simply execute:

opam install catala

To get the cutting-edge, latest version of Catala, you can also do

opam pin add catala --dev-repo

However, if you wish to get the latest developments of the compiler, you probably want to compile it from the sources of this repository or use nix. For that, see the dedicated readme.



Use catala --help if you have installed it to get more information about the command line options available. The man page is also available online. To get the development version of the help, run make help_catala after make build. The catala binary corresponds to the Catala compiler.

The top-level Makefile contains a lot of useful targets to run. To display them, use

    make help

Plugin backends

While the compiler has some builtin backends for Catala (Python, Ocaml, etc.), it is also possible to add a custom backend to the Catala compiler without having to modify its source code. This plugin solution relies on dynamic linking: see the dedicated README.


Use clerk --help if you have installed it to get more information about the command line options available. To get the development version of the help, run make help_clerk after make build. The clerk binary corresponds to the Catala build system, responsible for testing among other things.

To get more information about Clerk, see the dedicated readme


Syntax cheat sheet

A complete and handy reference of the Catala syntax can be found in the cheat sheet (for French and English versions of the syntax).

Formal semantics

To audit the formal proof of the partial certification of the Catala compiler, see the dedicated readme.

Compiler documentation

The compiler documentation is auto-generated from its source code using dune and odoc. Use

make doc

to generate the documentation, then open the doc/odoc.html file in any browser. The documentation is also accessible online.


To explore the different programs written in Catala, see the dedicated readme.


To know how to use the code generated by the Catala compiler in your favorite programming language, head to the readme of the French law library


To know how you can contribute to the project, see the dedicated readme.

Test suite

To know how to run or improve the Catala reference test suite, see the dedicated readme.


The compiler and all the code contained in this repository is released under the Apache license (version 2) unless another license is explicited for a sub-directory.

Limitations and disclaimer

Catala is a research project from Inria, the French National Research Institute for Computer Science. The compiler is yet unstable and lacks some of its features.

Pierre Catala

The language is named after Pierre Catala, a professor of law who pionneered the French legaltech by creating a computer database of law cases, Juris-Data. The research group that he led in the late 1960s, the Centre d’études et de traitement de l’information juridique (CETIJ), has also influenced the creation by state conselor Lucien Mehl of the Centre de recherches et développement en informatique juridique (CENIJ), which eventually transformed into the entity managing the LegiFrance website, acting as the public service of legislative documentation.

Dependencies (22)

  1. zarith_stubs_js >= "v0.14.1"
  2. zarith >= "1.12"
  3. visitors >= "20200210"
  4. unionFind >= "20220109"
  5. ubase >= "0.05"
  6. uutf >= "1.0.3"
  7. sedlex >= "2.4"
  8. re >= "1.10.0"
  9. ppx_yojson_conv >= "v0.14.0" & < "v0.16.0"
  10. ocamlgraph >= "1.8.8"
  11. ocamlfind != "1.9.5"
  12. ocaml >= "4.14.0"
  13. menhirLib >= "20200211"
  14. menhir >= "20200211"
  15. js_of_ocaml-ppx >= "4.0.0"
  16. dune >= "3.0"
  17. dates_calc >= "0.0.4"
  18. cppo >= "1"
  19. cmdliner >= "1.1.0"
  20. bindlib >= "5.0.1"
  21. benchmark >= "1.6"
  22. ANSITerminal >= "0.8.2"

Dev Dependencies (2)

  1. odoc with-doc
  2. alcotest with-test & >= "1.5.0"

Used by


Conflicts (2)

  1. ocaml-option-bytecode-only
  2. z3 < "4.8.11"

Innovation. Community. Security.