package catala
Install
Dune Dependency
Authors
Maintainers
Sources
md5=b22e238d5d5c8452067109e9c7c0f427
sha512=ccc8c557c67c2f9d1bed4b957b2367f0f6afc0ef9b8b83237cf2a2912b3e8829b7e8af78ea7fe00b20ecf28b436ad04b591e5fff4f82fd08725d40a18c9924d0
doc/index.html
The Catala compiler
Architecture
The architecture of the Catala compiler is inspired by CompCert or the Nanopass framework, and is structured around many intermediate representations connected by successive translations passes.
Here is the recap picture of the different intermediate representations of the Catala compiler (made with an ASCII diagram tool):
+---------------+ | | | Surface AST | | | +---------------+ | | * Separate code from legislation | * Remove syntactic sugars | v +------------------+ | | | Desugared AST | | | +------------------+ | | * Build rule trees for each definition | * Order variable computations inside scope | v +--------------------+ | | | Scope language AST | | | +--------------------+ | | * Convert scopes into functions | * Thunking of subscope arguments | | v +----------------------+ | | | Default calculus AST | | | +----------------------+ | | | * Compile the default term | | v +----------------------+ | | | Lambda calculus AST | | | +----------------------+ | | * Turn expressions into statements | | v +--------------------------+ | | | Statement calculus AST | | | +--------------------------+
List of top-level modules
Each of those intermediate representation is bundled into its own `dune` bundle module. Click on the items below if you want to dive straight into the signatures.
More documentation can be found on each intermediate representations here.
- The surface representation
- The desugared representation
- The scope language
- The default calculus
- The lambda calculus
- The statement calculus
The main compilation chain is defined in:
Additionally, the compiler features a verification plugin that generates verification condition for proof backends. More information can be found here:
Last, two more modules contain additional features for the compiler: