package catala

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

Module Lcalc.AstSource

Abstract syntax tree for the lambda calculus

Abstract syntax tree

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

Sourcetype lit =
  1. | LBool of bool
  2. | LInt of Runtime.integer
  3. | LRat of Runtime.decimal
  4. | LMoney of Runtime.money
  5. | LUnit
  6. | LDate of Runtime.date
  7. | LDuration of Runtime.duration
Sourcetype except =
  1. | ConflictError
  2. | EmptyError
  3. | NoValueProvided
  4. | Crash
Sourcetype expr =
  1. | EVar of expr Bindlib.var Utils.Pos.marked
  2. | ETuple of expr Utils.Pos.marked list * Dcalc.Ast.StructName.t option
    (*

    The MarkedString.info is the former struct field name

    *)
  3. | ETupleAccess of expr Utils.Pos.marked * int * Dcalc.Ast.StructName.t option * Dcalc.Ast.typ Utils.Pos.marked list
    (*

    The MarkedString.info is the former struct field name

    *)
  4. | EInj of expr Utils.Pos.marked * int * Dcalc.Ast.EnumName.t * Dcalc.Ast.typ Utils.Pos.marked list
    (*

    The MarkedString.info is the former enum case name

    *)
  5. | EMatch of expr Utils.Pos.marked * expr Utils.Pos.marked list * Dcalc.Ast.EnumName.t
    (*

    The MarkedString.info is the former enum case name

    *)
  6. | EArray of expr Utils.Pos.marked list
  7. | ELit of lit
  8. | EAbs of (expr, expr Utils.Pos.marked) Bindlib.mbinder Utils.Pos.marked * Dcalc.Ast.typ Utils.Pos.marked list
  9. | EApp of expr Utils.Pos.marked * expr Utils.Pos.marked list
  10. | EAssert of expr Utils.Pos.marked
  11. | EOp of Dcalc.Ast.operator
  12. | EIfThenElse of expr Utils.Pos.marked * expr Utils.Pos.marked * expr Utils.Pos.marked
  13. | ERaise of except
  14. | ECatch of expr Utils.Pos.marked * except * expr Utils.Pos.marked

Variable helpers

Sourcemodule Var : sig ... end
Sourcemodule VarMap : Map.S with type key = Var.t
Sourceval option_enum : Dcalc.Ast.EnumName.t

e' = make_matchopt'' pos v e e_none e_some Builds the term corresponding to match e with | None -> fun () -> e_none |Some -> fun v -> e_some.

Sourceval handle_default : Var.t
Sourceval handle_default_opt : Var.t
Sourcetype scope_body = {
  1. scope_body_name : Dcalc.Ast.ScopeName.t;
  2. scope_body_var : Var.t;
  3. scope_body_expr : expr Utils.Pos.marked;
}
Sourcetype program = {
  1. decl_ctx : Dcalc.Ast.decl_ctx;
  2. scopes : scope_body list;
}
OCaml

Innovation. Community. Security.