jon.recoil.org

Module Flambda2_nominal.Name_occurrences

A structure for counting name-like entities that occur free in terms or types.

type t
include Flambda2_nominal.Contains_ids.S with type t := Flambda2_nominal.Name_occurrences.t

Gather all table identifiers to export them.

True if and only if not (equal (apply_renaming t renaming) t)

val singleton_continuation_in_trap_action : Flambda2_identifiers.Continuation.t -> Flambda2_nominal.Name_occurrences.t
val continuation_is_applied_with_traps : Flambda2_nominal.Name_occurrences.t -> Flambda2_identifiers.Continuation.t -> bool

Closure_variables and function slots in types count as both projection and declaration

If the use of the code ID is in a "newer version of" field, use add_newer_version_of_code_id, not this function -- see below.

add_newer_version_of_code_id registers a use of a code ID occurring in a "newer version of" field (e.g. in Flambda_static.Static_part.code).

diff t1 ~without:t2 removes from t1 all those names that occur in t2.

The number of occurrences of any names in the return value will be exactly the same as in t1.

Note that a code ID in t2 will not only be removed from the code ID set in t1 but also the newer-version-of code ID set in t1.

subset_domain t1 t2 is the usual "set subset" test on the names occurring in t1 and t2. The numbers of occurrences and the name_modes of those occurrences are ignored.

val no_variables : Flambda2_nominal.Name_occurrences.t -> bool
val no_continuations : Flambda2_nominal.Name_occurrences.t -> bool
val continuations_including_in_trap_actions : Flambda2_nominal.Name_occurrences.t -> Flambda2_identifiers.Continuation.Set.t
val restrict_to_value_slots_and_function_slots : Flambda2_nominal.Name_occurrences.t -> Flambda2_nominal.Name_occurrences.t
val code_ids_and_newer_version_of_code_ids : Flambda2_nominal.Name_occurrences.t -> Flambda2_identifiers.Code_id.Set.t
val with_only_names_and_code_ids_promoting_newer_version_of : Flambda2_nominal.Name_occurrences.t -> Flambda2_nominal.Name_occurrences.t

The value returned by this function only records occurrences in two fields:

  • names, as per the input
  • code IDs, containing *both* the code IDs and the "newer version of" code IDs from the input.

The "newer version of" code IDs field in the returned value will always be empty.

val value_slot_is_used_or_imported : Flambda2_nominal.Name_occurrences.t -> Flambda2_identifiers.Value_slot.t -> bool
val downgrade_occurrences_at_strictly_greater_name_mode : Flambda2_nominal.Name_occurrences.t -> Flambda2_nominal.Name_mode.t -> Flambda2_nominal.Name_occurrences.t
val fold_names : Flambda2_nominal.Name_occurrences.t -> init:'a -> f:('a -> Flambda2_identifiers.Name.t -> 'a) -> 'a
val fold_variables : Flambda2_nominal.Name_occurrences.t -> init:'a -> f:('a -> Flambda2_identifiers.Variable.t -> 'a) -> 'a
val fold_continuations_including_in_trap_actions : Flambda2_nominal.Name_occurrences.t -> init:'a -> f:('a -> Flambda2_identifiers.Continuation.t -> 'a) -> 'a
val fold_code_ids : Flambda2_nominal.Name_occurrences.t -> init:'a -> f:('a -> Flambda2_identifiers.Code_id.t -> 'a) -> 'a