package coq-core
Install
Dune Dependency
Authors
Maintainers
Sources
md5=5d1187d5e44ed0163f76fb12dabf012e
sha512=91bc81530fa4f6498961583ad51eac5001f139881788b88e360a866ad8e2a6e2c5bce86d1a580ab4cd4782bf49d48318767df82471ce33ba3ac143e5569ad33c
doc/coq-core.library/Lib/index.html
Module Lib
Source
Lib: record of operations, backtrack, low-level sections
This module provides a general mechanism to keep a trace of all operations and to backtrack (undo) those operations. It provides also the section mechanism (at a low level; discharge is not known at this step).
type 'summary node =
| CompilingLibrary of Nametab.object_prefix
| OpenedModule of is_type * export * Nametab.object_prefix * 'summary
| OpenedSection of Nametab.object_prefix * 'summary
Extract the object_prefix
component. Note that it is the prefix of the objects *inside* this node, eg in Module M.
we have OpenedModule
with prefix containing M
.
...
Adding operations (which call the cache
method, and getting the current list of operations (most recent ones coming first).
...
The function contents
gives access to the current entire segment
Functions relative to current path
User-side names
cwd()
is (prefix()).obj_dir
current_mp()
is (prefix()).obj_mp
Inside a library A.B module M section S, we have
- library_dp = A.B
- cwd = A.B.M.S
- cwd_except_section = A.B.M
- current_dirpath true = M.S
- current_dirpath false = S
- current_mp = MPdot(MPfile A.B, M)
make_path (resp make_path_except_section) uses cwd (resp cwd_except_section) make_kn uses current_mp
Kernel-side names
Are we inside an opened section
Are we inside an opened module type
The StagedLibS
abstraction describes operations and traversal for Lib at a given stage.
We provide two instances of StagedLibS
, corresponding to the Synterp and Interp stages.
Compilation units
val end_compilation :
Names.DirPath.t ->
Nametab.object_prefix
* Library_info.t list
* Interp.classified_objects
* Synterp.classified_objects
Finalize the compilation of a library and return respectively the library prefix, the regular objects, and the syntax-related objects.
The function library_dp
returns the DirPath.t
of the current compiling library (or default_library
)
Extract the library part of a name even if in a section
Section management for discharge
Discharge: decrease the section level if in the current section
Compatibility layer