package catala

  1. Overview
  2. Docs
Low-level language for tax code specification

Install

Dune Dependency

Authors

Maintainers

Sources

0.2.0.tar.gz
md5=4c6f725ef4d21c5ff91f60d74b454ef7
sha512=98806e03daa6f33740b80a0f78a37320fb70ebea8cb927ea8fed022673459189c32e2389ccba0fa25d93f754b0fa0128a5ee28e1bb9abefa330deb4be8cc7d95

doc/dcalc.html

Default calculus

This representation is the fourth in the compilation chain (see Architecture). Its main difference with the previous desugared representation is that scopes have been lowered into regular functions, and enums and structs have been lowered to sum and product types.

The module describing the abstract syntax tree is:

Printing helpers can be found in Dcalc.Print.

This intermediate representation corresponds to the default calculus presented in the Catala formalization.

Typing

Related modules:

  • Dcalc.Typing Typing for the default calculus. Because of the error terms, we perform type inference using the classical W algorithm with union-find unification.

This representation is where the typing is performed. Indeed, Dcalc.Typing implements the classical W algorithm corresponding to a Hindley-Milner type system, without type constraints.

Interpreter

Related modules:

Since this representation is currently the last of the compilation chain, an Dcalc.Interpreter module is provided to match the execution semantics of the default calculus.

Later, translations to a regular lambda calculus and/or a simple imperative language are bound to be added.

OCaml

Innovation. Community. Security.