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

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 LabelMap : Map.S with type key = LabelName.t
Sourcemodule LabelSet : Set.S with type elt = LabelName.t
Sourcemodule ScopeVarSet : Set.S with type elt = ScopeVar.t
Sourcemodule ScopeVarMap : Map.S with type key = ScopeVar.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 marked_expr = expr Utils.Marked.pos

The expressions use the Bindlib library, based on higher-order abstract syntax

Sourcemodule ExprMap : Map.S with type key = expr

Variable helpers

Sourcemodule Var : sig ... end
Sourcemodule VarMap : Map.S with type key = Var.t
Sourcetype vars = expr Bindlib.mvar
Sourceval make_var : Var.t Utils.Marked.pos -> expr Utils.Marked.pos Bindlib.box
Sourceval make_abs : vars -> expr Utils.Marked.pos Bindlib.box -> Scopelang.Ast.typ Utils.Marked.pos list -> Utils.Pos.t -> expr Utils.Marked.pos Bindlib.box
Sourceval make_app : expr Utils.Marked.pos Bindlib.box -> expr Utils.Marked.pos Bindlib.box list -> Utils.Pos.t -> expr Utils.Marked.pos Bindlib.box
Sourceval make_let_in : Var.t -> Scopelang.Ast.typ Utils.Marked.pos -> expr Utils.Marked.pos Bindlib.box -> expr Utils.Marked.pos Bindlib.box -> expr Utils.Marked.pos Bindlib.box

Rules and scopes

Sourcetype exception_situation =
  1. | BaseCase
  2. | ExceptionToLabel of LabelName.t Utils.Marked.pos
  3. | ExceptionToRule of RuleName.t Utils.Marked.pos
Sourcetype label_situation =
  1. | ExplicitlyLabeled of LabelName.t Utils.Marked.pos
  2. | Unlabeled
Sourcetype rule = {
  1. rule_id : RuleName.t;
  2. rule_just : expr Utils.Marked.pos Bindlib.box;
  3. rule_cons : expr Utils.Marked.pos Bindlib.box;
  4. rule_parameter : (Var.t * Scopelang.Ast.typ Utils.Marked.pos) option;
  5. rule_exception : exception_situation;
  6. rule_label : label_situation;
}
Sourcemodule Rule : Set.OrderedType with type t = rule
Sourceval always_false_rule : Utils.Pos.t -> Scopelang.Ast.typ Utils.Marked.pos option -> rule
Sourcetype assertion = expr Utils.Marked.pos Bindlib.box
Sourcetype variation_typ =
  1. | Increasing
  2. | Decreasing
Sourcetype reference_typ =
  1. | Decree
  2. | Law
Sourcetype meta_assertion =
  1. | FixedBy of reference_typ Utils.Marked.pos
  2. | VariesWith of unit * variation_typ Utils.Marked.pos option
Sourcetype scope_def = {
  1. scope_def_rules : rule RuleMap.t;
  2. scope_def_typ : Scopelang.Ast.typ Utils.Marked.pos;
  3. scope_def_is_condition : bool;
  4. scope_def_io : Scopelang.Ast.io;
}
Sourcetype var_or_states =
  1. | WholeVar
  2. | States of StateName.t list
Sourcetype scope = {
  1. scope_vars : var_or_states ScopeVarMap.t;
  2. scope_sub_scopes : Scopelang.Ast.ScopeName.t Scopelang.Ast.SubScopeMap.t;
  3. scope_uid : Scopelang.Ast.ScopeName.t;
  4. scope_defs : scope_def 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 locations_used : expr Utils.Marked.pos -> LocationSet.t
OCaml

Innovation. Community. Security.