Module Namegen
This file features facilities to generate fresh names.
type intro_pattern_naming_expr=|IntroIdentifier of Names.Id.t|IntroFresh of Names.Id.t|IntroAnonymousGeneral evar naming using intro patterns
val intro_pattern_naming_eq : intro_pattern_naming_expr -> intro_pattern_naming_expr -> boolEqualities on
intro_pattern_naming
val default_prop_ident : Names.Id.tval default_small_ident : Names.Id.tval default_type_ident : Names.Id.tval default_non_dependent_ident : Names.Id.tval default_dependent_ident : Names.Id.tval lowercase_first_char : Names.Id.t -> stringval sort_hdchar : Sorts.t -> stringval hdchar : Environ.env -> Evd.evar_map -> EConstr.types -> stringval id_of_name_using_hdchar : Environ.env -> Evd.evar_map -> EConstr.types -> Names.Name.t -> Names.Id.tval named_hd : Environ.env -> Evd.evar_map -> EConstr.types -> Names.Name.t -> Names.Name.tval head_name : Evd.evar_map -> EConstr.types -> Names.Id.t optionval mkProd_name : Environ.env -> Evd.evar_map -> (Names.Name.t Context.binder_annot * EConstr.types * EConstr.types) -> EConstr.typesval mkLambda_name : Environ.env -> Evd.evar_map -> (Names.Name.t Context.binder_annot * EConstr.types * EConstr.constr) -> EConstr.constrval prod_name : Environ.env -> Evd.evar_map -> (Names.Name.t Context.binder_annot * EConstr.types * EConstr.types) -> EConstr.typesDeprecated synonyms of
mkProd_nameandmkLambda_name
val lambda_name : Environ.env -> Evd.evar_map -> (Names.Name.t Context.binder_annot * EConstr.types * EConstr.constr) -> EConstr.constrval prod_create : Environ.env -> Evd.evar_map -> (Sorts.relevance * EConstr.types * EConstr.types) -> EConstr.constrval lambda_create : Environ.env -> Evd.evar_map -> (Sorts.relevance * EConstr.types * EConstr.constr) -> EConstr.constrval name_assumption : Environ.env -> Evd.evar_map -> EConstr.rel_declaration -> EConstr.rel_declarationval name_context : Environ.env -> Evd.evar_map -> EConstr.rel_context -> EConstr.rel_contextval mkProd_or_LetIn_name : Environ.env -> Evd.evar_map -> EConstr.types -> EConstr.rel_declaration -> EConstr.typesval mkLambda_or_LetIn_name : Environ.env -> Evd.evar_map -> EConstr.constr -> EConstr.rel_declaration -> EConstr.constrval it_mkProd_or_LetIn_name : Environ.env -> Evd.evar_map -> EConstr.types -> EConstr.rel_context -> EConstr.typesval it_mkLambda_or_LetIn_name : Environ.env -> Evd.evar_map -> EConstr.constr -> EConstr.rel_context -> EConstr.constrval next_ident_away_from : Names.Id.t -> (Names.Id.t -> bool) -> Names.Id.tAvoid clashing with a name satisfying some predicate
val next_ident_away : Names.Id.t -> Names.Id.Set.t -> Names.Id.tnext_ident_away original_id unwanted_idsreturns a new identifier as close as possible to theoriginal_idwhile avoiding allunwanted_ids.In particular:
- if
original_iddoes not appear in the list ofunwanted_ids, thenoriginal_idis returned. if
original_idappears in the list ofunwanted_ids, then this function returns a new id that:- has the same root as the
original_id, - does not occur in the list of
unwanted_ids, - has the smallest possible subscript.
- has the same root as the
where by subscript of some identifier we mean last part of it that is composed only from (decimal) digits and by root of some identifier we mean the whole identifier except for the subscript.
E.g. if we take
foo42, then42is the subscript, andfoois the root.- if
val next_ident_away_in_goal : Names.Id.t -> Names.Id.Set.t -> Names.Id.tAvoid clashing with a name already used in current module
val next_global_ident_away : Names.Id.t -> Names.Id.Set.t -> Names.Id.tAvoid clashing with a name already used in current module but tolerate overwriting section variables, as in goals
val next_name_away : Names.Name.t -> Names.Id.Set.t -> Names.Id.tDefault is
default_non_dependent_ident
val next_name_away_with_default : string -> Names.Name.t -> Names.Id.Set.t -> Names.Id.tval next_name_away_with_default_using_types : string -> Names.Name.t -> Names.Id.Set.t -> EConstr.types -> Names.Id.tval set_reserved_typed_name : (EConstr.types -> Names.Name.t) -> unit
type renaming_flags=|RenamingForCasesPattern of Names.Name.t list * EConstr.constravoid only global constructors
|RenamingForGoalavoid all globals (as in intro)
|RenamingElsewhereFor of Names.Name.t list * EConstr.constr
val make_all_name_different : Environ.env -> Evd.evar_map -> Environ.envval compute_displayed_name_in : Evd.evar_map -> renaming_flags -> Names.Id.Set.t -> Names.Name.t -> EConstr.constr -> Names.Name.t * Names.Id.Set.tval compute_and_force_displayed_name_in : Evd.evar_map -> renaming_flags -> Names.Id.Set.t -> Names.Name.t -> EConstr.constr -> Names.Name.t * Names.Id.Set.tval compute_displayed_let_name_in : Evd.evar_map -> renaming_flags -> Names.Id.Set.t -> Names.Name.t -> 'a -> Names.Name.t * Names.Id.Set.tval rename_bound_vars_as_displayed : Evd.evar_map -> Names.Id.Set.t -> Names.Name.t list -> EConstr.types -> EConstr.typesval compute_displayed_name_in_gen : (Evd.evar_map -> int -> 'a -> bool) -> Evd.evar_map -> Names.Id.Set.t -> Names.Name.t -> 'a -> Names.Name.t * Names.Id.Set.t