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/catala.desugared/Desugared/Desugared_to_scope/index.html

Module Desugared.Desugared_to_scopeSource

Translation from Desugared.Ast to Scopelang.Ast

Sourcemodule Pos = Utils.Pos
Sourcemodule Errors = Utils.Errors
Sourcemodule Cli = Utils.Cli

Rule tree construction

Sourcetype rule_tree =
  1. | Leaf of Ast.rule
  2. | Node of rule_tree list * Ast.rule

Transforms a flat list of rules into a tree, taking into account the priorities declared between rules

Invariant: there are no exceptions cycles

Invariant: there are no dandling exception pointers in the rules

Sourceval rule_tree_to_expr : toplevel:bool -> Scopelang.Ast.Var.t option -> rule_tree -> Scopelang.Ast.expr Pos.marked Bindlib.box

From the rule_tree, builds an Dcalc.Ast.EDefault expression in the scope language. The ~toplevel parameter is used to know when to place the toplevel binding in the case of functions.

AST translation

Translates a definition inside a scope, the resulting expression should be an Dcalc.Ast.EDefault

Sourceval translate_scope : Ast.scope -> Scopelang.Ast.scope_decl

Translates a scope

API

Sourceval translate_program : Ast.program -> Scopelang.Ast.program
OCaml

Innovation. Community. Security.