package catala

  1. Overview
  2. Docs

Abstract syntax tree of the scope language

module Pos = Utils.Pos
module Uid = Utils.Uid

Identifiers

module ScopeNameSet : Set.S with type elt = ScopeName.t
module ScopeMap : Map.S with type key = ScopeName.t
module SubScopeMap : Map.S with type key = SubScopeName.t
module ScopeVarSet : Set.S with type elt = ScopeVar.t
module ScopeVarMap : Map.S with type key = ScopeVar.t
module StructMap : Map.S with type key = StructName.t
module EnumMap : Map.S with type key = EnumName.t
type location =
  1. | ScopeVar of ScopeVar.t Pos.marked
  2. | SubScopeVar of ScopeName.t * SubScopeName.t Pos.marked * ScopeVar.t Pos.marked
module LocationSet : Set.S with type elt = location Pos.marked

Abstract syntax tree

type typ =
  1. | TLit of Dcalc.Ast.typ_lit
  2. | TStruct of StructName.t
  3. | TEnum of EnumName.t
  4. | TArrow of typ Pos.marked * typ Pos.marked

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

val locations_used : expr Pos.marked -> LocationSet.t
type rule =
  1. | Definition of location Pos.marked * typ Pos.marked * expr Pos.marked
  2. | Assertion of expr Pos.marked
  3. | Call of ScopeName.t * SubScopeName.t
type scope_decl = {
  1. scope_decl_name : ScopeName.t;
  2. scope_sig : typ Pos.marked ScopeVarMap.t;
  3. scope_decl_rules : rule list;
}
type struct_ctx = (StructFieldName.t * typ Pos.marked) list StructMap.t
type enum_ctx = (EnumConstructor.t * typ Pos.marked) list EnumMap.t
type program = {
  1. program_scopes : scope_decl ScopeMap.t;
  2. program_enums : enum_ctx;
  3. program_structs : struct_ctx;
}

Variable helpers

module Var : sig ... end
type vars = expr Bindlib.mvar
module VarMap : sig ... end
OCaml

Innovation. Community. Security.