catala/compiler/dcalc/dcalc.mld

40 lines
1.4 KiB
Plaintext
Raw Normal View History

2020-12-14 20:09:38 +03:00
{0 Default calculus}
2021-03-19 19:49:56 +03:00
This representation is the fourth in the compilation chain
(see {{: index.html#architecture} Architecture}). Its main difference
with the previous {{: desugared.html} desugared representation} is that scopes
2020-12-14 20:09:38 +03:00
have been lowered into regular functions, and enums and structs have been
2021-03-19 19:49:56 +03:00
lowered to sum and product types. The default calculus can be later compiled
to a {{: lcalc.html} lambda calculus}.
2020-12-14 20:09:38 +03:00
The module describing the abstract syntax tree is:
{!modules: Dcalc.Ast}
Printing helpers can be found in {!module: Dcalc.Print}.
2021-03-19 19:49:56 +03:00
This intermediate representation corresponds to the default calculus
presented in the {{: https://arxiv.org/abs/2103.03198} Catala formalization}.
2020-12-14 20:09:38 +03:00
{1 Typing }
Related modules:
{!modules: Dcalc.Typing}
This representation is where the typing is performed. Indeed, {!module: Dcalc.Typing}
implements the classical {{: https://en.wikipedia.org/wiki/Hindley%E2%80%93Milner_type_system} W algorithm}
corresponding to a Hindley-Milner type system, without type constraints.
{1 Interpreter}
Related modules:
{!modules: Dcalc.Interpreter}
Since this representation is currently the last of the compilation chain,
an {!module: Dcalc.Interpreter} module is provided to match the execution
2021-03-19 19:49:56 +03:00
semantics of the default calculus.
2020-12-14 20:09:38 +03:00
2021-03-19 19:49:56 +03:00
Later, translations to a regular lambda calculus and/or a simple imperative
2020-12-14 20:09:38 +03:00
language are bound to be added.