package catala

  1. Overview
  2. Docs
Compiler and library for the literate programming language for tax code specification

Install

Dune Dependency

Authors

Maintainers

Sources

0.10.0.tar.gz
md5=5abd76e8c51a47670645e91b21b57fc5
sha512=9c6fbe50c0b5a60566e877eeddadca0a339e2ce35deb5c1beceb03bc40eb6af2d519313e71859d88645b53fad591d4fa5288c633b185c9d765603da0f5b7dd7b

doc/desugared.html

Desugared representation

This representation is the second in the compilation chain (see Architecture). Its main difference with the surface representation is that the legislative text has been discarded and all the definitions of each variables have been collected in the same place rather than being scattered across the code base.

The module describing the abstract syntax tree is:

  • Desugared.Ast Abstract syntax tree of the desugared representation

Translation to the scope language

Before the translation to the scope language, Desugared.Dependency checks that within a scope, there is no computational circular dependency between the variables of the scope. When the dependency graph is a DAG, Scopelang.From_desugared performs a topological ordering to produce an ordered list of the scope definitions compatible with the computation order. All the graph computations are done using the Ocamlgraph library.

The other important piece of work performed by Scopelang.From_desugared is the construction of the default trees (see Shared_ast.base_gexpr.EDefault) from the list of prioritized rules.

Related modules:

OCaml

Innovation. Community. Security.