Alba compiler
Parameter #1 Alba_core . Gamma_algo . Make . Gamma
type t
val count : t -> int

Number of variables in the context.

val is_valid_index : int -> t -> bool
val name_of_index : int -> t -> string
val push_local : string -> Term.typ -> t -> t

push_local name typ gamma

Add the local variable with name and typ to the context.


name <> ""
val type_of_literal : Value.t -> t -> Term.typ
val type_of_variable : int -> t -> Term.typ

type_of_variable idx gamma

Return the type of the variable idx. idx is the De Bruijn index i.e. and index of 0 points to the last variable and an index of count gamma - 1 points to the first variable.

val definition_term : int -> t -> Term.t option

definition_term idx gamma

If the variable idx has a definition, then return it. Otherwise return None.