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. | 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 Utils.Pos.t * (expr, expr Utils.Pos.marked) Bindlib.mbinder * 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
Sourcetype vars = expr Bindlib.mvar
Sourceval make_var : Var.t Utils.Pos.marked -> expr Utils.Pos.marked Bindlib.box
Sourceval make_app : expr Utils.Pos.marked Bindlib.box -> expr Utils.Pos.marked Bindlib.box list -> Utils.Pos.t -> expr Utils.Pos.marked Bindlib.box
Sourceval make_let_in : Var.t -> Dcalc.Ast.typ Utils.Pos.marked -> expr Utils.Pos.marked Bindlib.box -> expr Utils.Pos.marked Bindlib.box -> expr Utils.Pos.marked Bindlib.box
Sourcetype binder = (expr, expr Utils.Pos.marked) Bindlib.binder
Sourcetype program = {
  1. decl_ctx : Dcalc.Ast.decl_ctx;
  2. scopes : (Var.t * expr Utils.Pos.marked) list;
}
OCaml

Innovation. Community. Security.