package catala

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Desugared.AstSource

Abstract syntax tree of the desugared representation

Sourcemodule Pos = Utils.Pos
Sourcemodule Uid = Utils.Uid

Names, Maps and Keys

Sourcemodule IdentMap : Map.S with type key = String.t
Sourcemodule RuleMap : Map.S with type key = RuleName.t
Sourcemodule RuleSet : Set.S with type elt = RuleName.t
Sourcemodule ScopeDef : sig ... end

Inside a scope, a definition can refer either to a scope def, or a subscope def

Sourcemodule ScopeDefMap : Map.S with type key = ScopeDef.t
Sourcemodule ScopeDefSet : Set.S with type elt = ScopeDef.t

AST

Sourcetype rule = {
  1. just : Scopelang.Ast.expr Pos.marked Bindlib.box;
  2. cons : Scopelang.Ast.expr Pos.marked Bindlib.box;
  3. parameter : (Scopelang.Ast.Var.t * Scopelang.Ast.typ Pos.marked) option;
  4. exception_to_rule : RuleName.t option;
}
Sourceval empty_rule : Pos.t -> Scopelang.Ast.typ Pos.marked option -> rule
Sourcetype assertion = Scopelang.Ast.expr Pos.marked Bindlib.box
Sourcetype variation_typ =
  1. | Increasing
  2. | Decreasing
Sourcetype reference_typ =
  1. | Decree
  2. | Law
Sourcetype meta_assertion =
  1. | FixedBy of reference_typ Pos.marked
  2. | VariesWith of unit * variation_typ Pos.marked option
Sourcetype scope = {
  1. scope_vars : Scopelang.Ast.ScopeVarSet.t;
  2. scope_sub_scopes : Scopelang.Ast.ScopeName.t Scopelang.Ast.SubScopeMap.t;
  3. scope_uid : Scopelang.Ast.ScopeName.t;
  4. scope_defs : (rule RuleMap.t * Scopelang.Ast.typ Pos.marked) ScopeDefMap.t;
  5. scope_assertions : assertion list;
  6. scope_meta_assertions : meta_assertion list;
}
Sourcetype program = {
  1. program_scopes : scope Scopelang.Ast.ScopeMap.t;
  2. program_enums : Scopelang.Ast.enum_ctx;
  3. program_structs : Scopelang.Ast.struct_ctx;
}

Helpers

Sourceval free_variables : rule RuleMap.t -> Pos.t ScopeDefMap.t
OCaml

Innovation. Community. Security.