catala/README.md

106 lines
3.7 KiB
Markdown
Raw Normal View History

2020-05-15 16:57:32 +03:00
<center>
2020-12-14 12:59:15 +03:00
<img src="https://github.com/CatalaLang/catala/raw/master/doc/images/logo.png" alt="Catala logo" width="100"/>
2020-05-15 16:57:32 +03:00
</center>
2020-04-16 18:47:35 +03:00
# Catala
2019-09-04 11:32:33 +03:00
2020-04-17 17:22:20 +03:00
Catala is a domain-specific language for deriving
2020-12-14 12:59:15 +03:00
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](https://catala-lang.org/en/examples/tutorial).
2019-09-04 11:32:33 +03:00
2020-04-17 17:22:20 +03:00
## Concepts
2020-12-14 12:59:15 +03:00
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.
2020-04-17 17:22:20 +03:00
2020-12-14 12:59:15 +03:00
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 :
2020-04-17 17:22:20 +03:00
2020-05-15 16:57:32 +03:00
<center>
2020-12-14 12:59:15 +03:00
<img src="https://github.com/CatalaLang/catala/raw/master/doc/images/ScreenShotVSCode.png" alt="Screenshot" height="500"/>
2020-05-15 16:57:32 +03:00
</center>
2020-04-17 17:22:20 +03:00
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.
2020-05-15 16:57:32 +03:00
<center>
2020-12-14 12:59:15 +03:00
<img src="https://github.com/CatalaLang/catala/raw/master/doc/images/CatalaScreenShot.png" alt="Screenshot" height="500"/>
2020-05-15 16:57:32 +03:00
</center>
2020-04-17 17:22:20 +03:00
The Catala language is special because its logical structure mimics
the logical structure of the law. Indeed, the core concept of
2020-12-14 12:59:15 +03:00
"definition-under-conditions" that builds on default logic has been formalized
by Professor of Law Sarah Lawsky in her article
[A Logic for Statutes](https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3088206).
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.
2020-04-17 17:22:20 +03:00
2020-12-14 12:59:15 +03:00
## Installation
2020-04-17 17:22:20 +03:00
2020-12-14 12:59:15 +03:00
See [the dedicated readme](INSTALL.md).
2020-04-17 17:22:20 +03:00
2020-12-14 12:59:15 +03:00
## Examples
2020-04-17 17:22:20 +03:00
2020-12-14 12:59:15 +03:00
See [the dedicated readme](examples/README.md).
2020-04-17 17:22:20 +03:00
2020-12-14 12:59:15 +03:00
## Contributing
2020-04-17 17:22:20 +03:00
2020-12-14 12:59:15 +03:00
See [the dedicated readme](CONTRIBUTING.md).
2020-04-27 11:04:13 +03:00
2020-12-14 12:59:15 +03:00
## Test suite
2020-04-27 11:04:13 +03:00
2020-12-14 12:59:15 +03:00
See [the dedicated readme](tests/README.md).
2020-04-27 11:04:13 +03:00
2020-12-14 12:59:15 +03:00
## Documentation
2020-04-17 17:22:20 +03:00
2020-12-14 12:59:15 +03:00
### Formal semantics
2020-04-17 17:22:20 +03:00
2020-12-14 12:59:15 +03:00
See [the dedicated readme](doc/formalization/README.md).
2020-04-17 17:22:20 +03:00
2020-12-14 12:59:15 +03:00
### Compiler documentation
2020-04-17 17:22:20 +03:00
2020-12-14 20:09:38 +03:00
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.
2020-04-17 17:22:20 +03:00
2020-12-14 12:59:15 +03:00
## License
2020-08-07 18:37:28 +03:00
2020-12-14 12:59:15 +03:00
The library is released under the [Apache license (version 2)](LICENSE.txt).
2020-08-07 18:37:28 +03:00
2020-12-14 12:59:15 +03:00
## Limitations and disclaimer
2020-04-17 14:02:15 +03:00
2020-12-14 12:59:15 +03:00
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. Currently, here is the list
of existing features:
2019-09-04 11:32:33 +03:00
2020-12-14 12:59:15 +03:00
* Literate programming output to HTML or LaTeX
* Typechecker and interpreter for most of the language
2019-09-04 11:32:33 +03:00
2020-04-16 19:58:05 +03:00
## 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,
2020-04-17 14:02:15 +03:00
acting as the public service of legislative documentation.