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.9.0.tar.gz
md5=8f891209d18b6540df9c34b2d1a6a783
sha512=737770b87a057674bceefe77e8526720732552f51f424afcebcb6a628267eab522c4fd993caca1ae8ed7ace65a4a87e485af10c1676e51ca5939509a1b841ac2

doc/scopelang.html

The scope language

This representation is the third in the compilation chain (see Architecture). Its main difference with the previous desugared representation is that inside a scope, the definitions are ordered according to their computational dependency order, and each definition is a Shared_ast.base_gexpr.EDefault tree instead of a flat list of rules.

The module describing the abstract syntax tree is:

Printing helpers can be found in Scopelang.Print.

This intermediate representation corresponds to the scope language presented in the Catala formalization.

Translation to the default calculus

The translation from the scope language to the default calculus involves three big features:

  1. Translating structures and enums into simpler sum and product types
  2. Build thunked signatures for the scopes as functions
  3. Transform the list of scopes into a program

1 and 3 involve computing dependency graphs for respectively the structs and enums on one hand, and the inter-scope dependencies on the other hand. Both can be found in Scopelang.Dependency, while Dcalc.From_scopelang is mostly responsible for 2.

Related modules:

  • Scopelang.Dependency Graph representation of the dependencies between scopes in the Catala program. Vertices are functions, x -> y if x is used in the definition of y.
  • Dcalc.From_scopelang Scope language to default calculus translator
OCaml

Innovation. Community. Security.