FresheningFreshening of various identifiers.
type subst = tval empty : tThe freshening that does nothing. This is the unique inactive freshening.
val is_empty : t -> boolActivate the freshening. Without activation, operations to request freshenings have no effect (cf. the documentation below for add_variable). As such, the inactive renaming is unique.
Given the inactive freshening, return the same; otherwise, return an empty active freshening.
val add_variable : t -> Variable.t -> Variable.t * tadd_variable t var If t is active: It returns a fresh variable new_var and adds var -> new_var to the freshening. If a renaming other_var -> var or symbol -> var was already present in t, it will also add other_var -> new_var and symbol -> new_var. If t is inactive, this is the identity.
val add_variables' : t -> Variable.t list -> Variable.t list * tLike add_variable, but for multiple variables, each freshened separately.
val add_variables : t -> (Variable.t * 'a) list -> (Variable.t * 'a) list * tLike add_variables', but passes through the second component of the input list unchanged.
val add_mutable_variable : t -> Mutable_variable.t -> Mutable_variable.t * tLike add_variable, but for mutable variables.
val add_static_exception : t -> Static_exception.t -> Static_exception.t * tAs for add_variable, but for static exception identifiers.
val apply_variable : t -> Variable.t -> Variable.tapply_variable t var applies the freshening t to var. If no renaming is specified in t for var it is returned unchanged.
val apply_mutable_variable : t -> Mutable_variable.t -> Mutable_variable.tAs for apply_variable, but for mutable variables.
val apply_static_exception : t -> Static_exception.t -> Static_exception.tAs for apply_variable, but for static exception identifiers.
val rewrite_recursive_calls_with_symbols : t -> Flambda.function_declarations -> make_closure_symbol:(Closure_id.t -> Symbol.t) -> Flambda.function_declarationsReplace recursive accesses to the closures in the set through Symbol by the corresponding Var. This is used to recover the recursive call when importing code from another compilation unit.
If the renaming is inactive, this is the identity.
module Project_var : sig ... endval apply_function_decls_and_free_vars : t -> (Flambda.specialised_to * 'a) Variable.Map.t -> Flambda.function_declarations -> only_freshen_parameters:bool
-> (Flambda.specialised_to * 'a) Variable.Map.t * Flambda.function_declarations * t * Project_var.tval does_not_freshen : t -> Variable.t list -> boolval print : Format.formatter -> t -> unitval freshen_projection_relation : Flambda.specialised_to Variable.Map.t -> freshening:t -> closure_freshening:Project_var.t -> Flambda.specialised_to Variable.Map.tN.B. This does not freshen the domain of the supplied map, only the range.
val freshen_projection_relation' : (Flambda.specialised_to * 'a) Variable.Map.t -> freshening:t -> closure_freshening:Project_var.t
-> (Flambda.specialised_to * 'a) Variable.Map.t