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.surface/Surface/Desugaring/index.html

Module Surface.DesugaringSource

Translation from Surface.Ast to Desugaring.Ast.

  • Removes syntactic sugars
  • Separate code from legislation
Sourcemodule Pos = Utils.Pos
Sourcemodule Errors = Utils.Errors
Sourcemodule Cli = Utils.Cli

Translating expressions

Sourceval translate_op_kind : Ast.op_kind -> Dcalc.Ast.op_kind
Sourceval translate_binop : Ast.binop -> Dcalc.Ast.binop
Sourceval translate_unop : Ast.unop -> Dcalc.Ast.unop

The two modules below help performing operations on map with the Bindlib.box. Indeed, Catala uses the Bindlib library to represent bound variables in the AST. In this translation, bound variables are used to represent function parameters or pattern macthing bindings.

module LiftStructFieldMap : sig ... end
module LiftEnumConstructorMap : sig ... end

Usage: translate_expr scope ctxt expr

Translates expr into its desugared equivalent. scope is used to disambiguate the scope and subscopes variables than occur in the expresion

Translating scope definitions

Sourceval merge_conditions : Scopelang.Ast.expr Pos.marked Bindlib.box option -> Scopelang.Ast.expr Pos.marked Bindlib.box option -> Pos.t -> Scopelang.Ast.expr Pos.marked Bindlib.box

A scope use can be annotated with a pervasive precondition, in which case this precondition has to be appended to the justifications of each definition in the subscope use. This is what this function does.

Wrapper around process_default that performs some name disambiguation

Translates a surface definition, rule or assertion

Translating top-level items

Translates a surface scope use, which is a bunch of definitions

Main function of this module

OCaml

Innovation. Community. Security.