deb12d2c4a
Changelog: --- A lot has been going on, with more than 530 patches and 70 PRs merged since 0.7.0 last summer. In summary: - Quite a lot of syntax improvements and changes. Checkout the latest [cheat-sheet](https://catalalang.github.io/catala/syntax.pdf) for an overview - Allow local `let ... equals ... in ...` definitions - Better error messages and positions throughout - Added the ability to directly call a scope and retrieve its outputs, like a function - Added disambiguation, allowing to access structure fields without specifying the structure type each time - Added automated resolution of operators, allowing e.g. to write just `+` in place of all the type-specific operators `+.`, `+$`, `+@`, `+^`, etc. - More consistent priority for operators. It is no longer allowed to write `a and b or c` without parenthesis. - Added and changed some operators (`date + duration` now allowed either way, `int / int` now returns a decimal, added `duration / duration`) - Added the ability to have variables and functions defined at top-level (outside of any scope). See annex A of the tutorial for details. - Added support for functions with multiple arguments - Some big refactors in the compiler, allowing much better code sharing between the different passes, and making it much easier to extend. Also added the possibility to run the type-checker earlier, etc. - Countless bug-fixes - Improvements to our proof backend with Z3 - A tool to automatically synchronise with the upstream French law from Legifrance |
||
---|---|---|
.. | ||
law_source | ||
api_web.ml | ||
api.ml | ||
api.mli | ||
bench.ml | ||
dune | ||
README.md |
OCaml French Law Library
This folder contains a ready-to-use OCaml library featuring French public algorithms coded up in Catala.
Organization
Law source
The law_source
folder contains the files generated by the Catala compiler.
These files are generated using the following rule from the top-level Makefile
of this repository:
make generate_french_law_library_ocaml
They can be compiled using
make build_french_law_library_ocaml
In particular, law_source/unit_tests/run_tests.ml
provides an executable
that runs the unit tests coming from the source Catala examples, and that can
be launched with
make run_french_law_library_ocaml_tests
The law_source
files rely on the Catala OCaml runtime, located in
runtimes/ocaml/runtime.{ml, mli}
. This runtime defines the types of the values
manipulated by the Catala programs in OCaml and the operations available for them.
Wrappers
Then, the api.{ml, mli}
module provides a wrapper around the functions
exported in law_source
. These wrappers mostly convert back and forth between
idiomatic OCaml types and the types expected by the Catala programs in OCaml.
api_web.ml
is used for the JS library (see the dedicated README).
Finally, bench.ml
provides a simple benchmarking executable that runs the
computations of each algorithm a bunch of times with random inputs. You can run it
from the root of this repository with
make run_french_law_library_benchmark_ocaml