jon.recoil.org

Module Flambda2_term_basics.Rec_info_expr

include module type of struct include Flambda2_identifiers.Int_ids.Rec_info_expr end
type t = private Flambda2_identifiers.Int_ids.Rec_info_expr.t =
  1. | Const of {
    1. depth : int Flambda2_numbers.Or_infinity.t;
    2. unrolling : Unrolling_state.t;
    }
  2. | Var of variable
    (*

    A variable of kind Flambda_kind.rec_info.

    *)
  3. | Succ of t
    (*

    The next depth. If we inline an occurrence with depth d, then in the inlined body, recursive references will have depth succ d.

    *)
  4. | Unroll_to of int * t
    (*

    Indicate the depth to which unrolling should proceed. The unroll depth is decremented by Succ until it reaches zero, at which point all unrolling should stop.

    *)

An expression for the state of recursive inlining at a given occurrence. Forms the right-hand side of a Let_expr binding for a depth variable.

val initial : t
val unknown : t
val do_not_inline : t
val const : depth:int Flambda2_numbers.Or_infinity.t -> unrolling:Unrolling_state.t -> t
val var : variable -> t
val succ : t -> t
val unroll_to : int -> t -> t
val is_obviously_initial : t -> bool
val equal : t -> t -> bool
val hash : t -> int
val map_depth_variables : t -> f:(variable -> variable) -> t
val erase_variables : t -> t
val print : Format.formatter -> t -> unit
include Flambda2_nominal.Contains_names.S with type t := t

Compute the free names of a term. Such computation covers all kinds of bindable names (variables, continuations, ...)

val apply_renaming : t -> Flambda2_nominal.Renaming.t -> t

Apply a renaming throughout a term.

include Flambda2_nominal.Contains_ids.S with type t := t
val ids_for_export : t -> Flambda2_nominal.Ids_for_export.t

Gather all table identifiers to export them.

val free_names_in_types : t -> Flambda2_nominal.Name_occurrences.t