NametabSourceThis module contains the tables for globalization.
These globalization tables associate internal object references to qualified names (qualid). There are three classes of names:
kernel_name, constant, inductive, module_path, DirPath.tglobal_reference, abbreviation, extended_global_reference, global_dir_reference, ...full_pathreference and qualidMost functions in this module fall into one of the following categories:
push : visibility -> full_user_name -> object_reference -> unit
Registers the object_reference to be referred to by the full_user_name (and its suffixes according to visibility). full_user_name can either be a full_path or a DirPath.t.
exists : full_user_name -> bool
Is the full_user_name already attributed as an absolute user name of some object?
locate : qualid -> object_reference
Finds the object referred to by qualid or raises Not_found
full_name : qualid -> full_user_name
Finds the full user name referred to by qualid or raises Not_found
shortest_qualid_of : object_reference -> user_name
The user_name can be for example the shortest non ambiguous qualid or the full_user_name or Id.t. Such a function can also have a local context argument.
Object prefix morally contains the "prefix" naming of an object to be stored by library, where obj_dir is the "absolute" path and obj_mp is the current "module" prefix.
Thus, for an object living inside Module A. Section B. the prefix would be:
{ obj_dir = "A.B"; obj_mp = "A"; }
Note that obj_dir is a "path" that is to say, as opposed to obj_mp which is a single module name.
to this type are mapped DirPath.t's in the nametab
Raises a globalization error
The visibility can be registered either
val push :
?user_warns:UserWarn.t ->
visibility ->
Libnames.full_path ->
Names.GlobRef.t ->
unitval push_abbreviation :
?user_warns:UserWarn.t ->
visibility ->
Libnames.full_path ->
Globnames.abbreviation ->
unitDeprecation and user warn info
val warn_user_warn_xref :
?loc:Loc.t ->
UserWarn.t ->
Globnames.extended_global_reference ->
unitThese functions globalize a (partially) qualified name or fail with Not_found
Remove the binding to an abbreviation
These functions globalize user-level references into global references, like locate and co, but raise a nice error message in case of failure
These functions locate all global references with a given suffix; if qualid is valid as such, it comes first in the list
Experimental completion support, API is _unstable_
completion_canditates qualid will return the list of global references that have qualid as a prefix. UI usually will want to compose this with shortest_qualid_of_global
Mapping a full path to a global reference
Finding user names corresponding to the given internal name
Returns the full path bound to a global reference or syntactic definition, and the (full) dirpath associated to a module path
A universe_id might not be registered with a corresponding user name.
Returns in particular the dirpath or the basename of the full path associated to global reference
Printing of global references using names as short as possible.
The shortest_qualid functions given an object with user_name Coq.A.B.x, try to find the shortest among x, B.x, A.B.x and Coq.A.B.x that denotes the same object.
val shortest_qualid_of_global :
?loc:Loc.t ->
Names.Id.Set.t ->
Names.GlobRef.t ->
Libnames.qualidval shortest_qualid_of_abbreviation :
?loc:Loc.t ->
Names.Id.Set.t ->
Globnames.abbreviation ->
Libnames.qualidval shortest_qualid_of_universe :
?loc:Loc.t ->
'u Names.Id.Map.t ->
Univ.UGlobal.t ->
Libnames.qualidIn general we have a UnivNames.universe_binders around rather than a Id.Set.t
NOT FOR PUBLIC USE YET. Plugin writers, please do not rely on this API.