package catala

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

Abstract syntax tree of the scope language

Identifiers

module ScopeName = Dcalc.Ast.ScopeName
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 StructName = Dcalc.Ast.StructName
module StructMap = Dcalc.Ast.StructMap
module StructFieldName = Dcalc.Ast.StructFieldName
module StructFieldMapLift : sig ... end
module EnumName = Dcalc.Ast.EnumName
module EnumMap = Dcalc.Ast.EnumMap
module EnumConstructor = Dcalc.Ast.EnumConstructor
module EnumConstructorMapLift : sig ... end

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 Utils.Pos.marked * typ Utils.Pos.marked
  5. | TArray of typ
  6. | TAny
val locations_used : expr Utils.Pos.marked -> LocationSet.t
type io_input =
  1. | NoInput
    (*

    For an internal variable defined only in the scope, and does not appear in the input.

    *)
  2. | OnlyInput
    (*

    For variables that should not be redefined in the scope, because they appear in the input.

    *)
  3. | Reentrant
    (*

    For variables defined in the scope that can also be redefined by the caller as they appear in the input.

    *)

This type characterizes the three levels of visibility for a given scope variable with regards to the scope's input and possible redefinitions inside the scope..

type io = {
  1. io_output : bool Utils.Pos.marked;
    (*

    true is present in the output of the scope.

    *)
  2. io_input : io_input Utils.Pos.marked;
}

Characterization of the input/output status of a scope variable.

type scope_decl = {
  1. scope_decl_name : ScopeName.t;
  2. scope_sig : (typ Utils.Pos.marked * io) ScopeVarMap.t;
  3. scope_decl_rules : rule list;
}
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
module VarMap : Map.S with type key = Var.t
type vars = expr Bindlib.mvar