package catala
Install
Dune Dependency
Authors
Maintainers
Sources
md5=6dbbc2f50c23693f26ab6f048e78172f
sha512=a5701e14932d8a866e2aa3731f76df85ff2a68b4fa943fd510c535913573274d66eaec1ae6fcae17f20b475876048a9ab196ef6d8c23d4ea6b90b986aa0a6daa
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, Desugared.Desugared_to_scope
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 Desugared.Desugared_to_scope
is the construction of the default trees (see Dcalc.Ast.expr.EDefault
) from the list of prioritized rules.
Related modules:
Desugared.Dependency
Scope dependencies computations using OCamlgraphDesugared.Desugared_to_scope
Translation fromDesugared.Ast
toScopelang.Ast