Programming language for literate programming law specification
Go to file
2020-12-09 18:14:52 +01:00
.github/workflows Passing all tests! 2020-11-27 17:21:37 +01:00
doc Autoformat 2020-11-20 10:19:21 +01:00
examples Merge branch 'master' into dev 2020-12-04 15:09:07 +01:00
src Performing nearest rounding for money multiplication 2020-12-09 18:14:52 +01:00
syntax_highlighting Fix content/type lexer issue in nv 2020-12-06 18:09:48 +01:00
tests Performing nearest rounding for money multiplication 2020-12-09 18:14:52 +01:00
.gitignore Fixed beta reduction rules for defaults 2020-11-18 15:38:33 +01:00
.gitmodules Localized files extensions, syntax highlighting for non-verbose which is now the defaul 2020-08-08 19:07:28 +02:00
.ocamlformat Weaving to LaTeX 2020-03-07 18:20:04 -08:00
catala.opam Add non verbose lexing 2020-08-03 18:07:09 +02:00
CONTRIBUTING.md More readmes 2020-06-02 10:26:30 +02:00
dune Only look into src directory 2020-05-22 19:58:01 +02:00
dune-project Big code reorg with better dune config 2020-11-23 09:22:47 +01:00
generate_website_assets.sh Use rsync for correct results 2020-05-25 19:13:09 +02:00
install_opam.sh More doc! 2020-04-17 15:12:11 +02:00
INSTALL.md Added VSCode syntax highlighting! 2020-08-18 23:16:27 +02:00
LICENSE.txt Code reorg 2019-09-04 10:32:33 +02:00
Makefile Defined operators for dec and money 2020-12-09 14:51:22 +01:00
README.md Change screenshot with English 2020-10-31 21:06:51 +01:00

Catala logo

Catala

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

Concepts

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 :

Screenshot

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.

Screenshot

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 of Law 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.

Catala motivating example : French "allocations familiales"

In the example/allocations_familiales folder, you will find the allocations_familiales.catala file which contains the algorithm computing French family benefits. The algorithm consists of annotations to the legislative texts that define the family benetifs, using the literate programming paradigm. The Catala compiler can extract from the .catala file a lawyer-readable version of the annotated text.

Currently, this lawyer-readable version comes in the form of a LaTeX document. You will need to have a standard LaTeX distribution installed as well as the latexmk build tool in order to enjoy the automated document generation process.

To get that lawyer-readable version (which is a LaTeX-created) PDF, simply use

make -C allocations_familiales allocations_familiales.pdf

from the repository root, once you have managed to install the compiler using the dedicated readme. You can then open examples/allocations_familiales/allocations_familiales.pdf

Languages

The Catala language should be adapted to any legislative text that follows a general-to-specifics statutes order. Therefore, there exists multiple versions of the Catala surface syntax, adapted to the language of the lefislative text.

Currently, Catala supports English and French legislations via the --language=en or --language=fr option. Contact the authors if you are interested in adding support for another language.

Limitations and disclaimer

Early stage project

Catala is a research project from Inria, the French National Research Institute for Computer Science. The compiler is yet very unstable and lacks most of its features. Currently, it only parses the surface language to producde the lawyer-readable PDF, no interpreter or compiler backend is provided.

However, the language is bound to have a complete formal semantics in the near future. This semantics will guide the compiler implementation.

Installation

See the dedicated readme.

Test suite

See the dedicated readme.

Contributing

See the dedicated readme.

License

The library is released under the Apache license (version 2).

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 linformation 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.