package coq
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=513e953b7183d478acb75fd6e80e4dc32ac1a918cf4343ac31a859cfb4e9aad2
doc/coq-core.library/Nametab/index.html
Module NametabSource
This module contains the tables for globalization.
These globalization tables associate internal object references to qualified names (qualid). There are three classes of names:
- 1a) internal kernel names:
kernel_name,constant,inductive,module_path,DirPath.t
- 1b) other internal names:
global_reference,syndef_name,extended_global_reference,global_dir_reference, ...
- 2) full, non ambiguous user names:
full_path
- 3) non necessarily full, possibly ambiguous user names:
referenceandqualid
Most functions in this module fall into one of the following categories:
push : visibility -> full_user_name -> object_reference -> unitRegisters the
object_referenceto be referred to by thefull_user_name(and its suffixes according tovisibility).full_user_namecan either be afull_pathor aDirPath.t.exists : full_user_name -> boolIs the
full_user_namealready attributed as an absolute user name of some object?locate : qualid -> object_referenceFinds the object referred to by
qualidor raisesNot_foundfull_name : qualid -> full_user_nameFinds the full user name referred to by
qualidor raisesNot_foundshortest_qualid_of : object_reference -> user_nameThe
user_namecan be for example the shortest non ambiguousqualidor thefull_user_nameorId.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, obj_mp is the current "module" prefix and obj_sec is the "section" prefix.
Thus, for an object living inside Module A. Section B. the prefix would be:
{ obj_dir = "A.B"; obj_mp = "A"; obj_sec = "B" }
Note that both obj_dir and obj_sec are "paths" 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
Register visibility of things
The visibility can be registered either
- for all suffixes not shorter then a given int -- when the object is loaded inside a module -- or
- for a precise suffix, when the module containing (the module containing ...) the object is opened (imported)
The following functions perform globalization of qualified names
These functions globalize a (partially) qualified name or fail with Not_found
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
These functions tell if the given absolute name is already taken
These functions locate qualids into full user names
Reverse lookup
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_syndef :
?loc:Loc.t ->
Names.Id.Set.t ->
Globnames.syndef_name ->
Libnames.qualidval shortest_qualid_of_universe :
?loc:Loc.t ->
'u Names.Id.Map.t ->
Univ.Level.UGlobal.t ->
Libnames.qualidIn general we have a UnivNames.universe_binders around rather than a Id.Set.t
Generic name handling
NOT FOR PUBLIC USE YET. Plugin writers, please do not rely on this API.