Lambda calculus

This representation is the fifth in the compilation chain (see Architecture). Its main difference with the previous default calculus is the absence of the default term, which has been translated into option types and operator calls.

The module describing the abstract syntax tree is:

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

Compilation from default calculus

Lcalc.From_dcalc compiles the default term of the default calculus

Other optional transformations

Closure conversion

To target languages that don't have support for closures, we need to convert the closures to first-class functions in function-pointer-passing style computations.

Operator expansion

This transformation is intended to specialise calls to structural polymorphic operators, like =. This doesn't affect polymorphic operators that work on boxed elements, like list or option processing.

Monomorphisation

This transformation is required for backends that don't support boxed polymorphic operations. It generates specialised instances of options, tuples and arrays for every type they are actually used with.

Backends

The OCaml backend of the lambda calculus is merely a syntactic formatting, since the core of the OCaml value language is effectively a lambda calculus.

Related modules: