package rocq-runtime
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=b236dc44f92e1eeca6877c7ee188a90c2303497fe7beb99df711ed5a7ce0d824
doc/rocq-runtime.library/Lib/index.html
Module LibSource
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 Libobject.object_prefix| OpenedModule of is_type * export * Libobject.object_prefix * 'summary| OpenedSection of Libobject.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 = M
- 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
type discharged_item = | DischargedExport of Libobject.ExportObj.t| DischargedLeaf of Libobject.discharged_obj
type classified_objects = {substobjs : Libobject.t list;keepobjs : Libobject.keep_objects;escapeobjs : Libobject.escape_objects;anticipateobjs : Libobject.t list;
}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
type compilation_result = {info : Library_info.t;synterp_objects : classified_objects;interp_objects : classified_objects;
}Finalize the compilation of a library.
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
Compatibility layer
This also does init_summaries