2.5 Logical paths of libraries and compilation units
Libraries
The theories developed in Coq are stored in libraries. A
library is characterized by a name called root of the
library. The standard library of Coq has root name Coq and is
known by default when a Coq session starts.
Libraries have a tree structure. E.g., the Coq library
contains the sub-libraries Init, Logic, Arith, Lists, ... The ``dot notation'' is used to separate the different
component of a library name. For instance, the Arith library of
Coq standard library is written ``Coq.Arith''.
Remark: no blank is allowed between the dot and the identifier on its
right, otherwise the dot is interpreted as the full stop (period) of
the command!
Physical paths vs logical paths
Libraries and sub-libraries are denoted by logical directory
paths (written dirpath and of which the syntax is the same as
qualid, see 1.2.2). Logical directory
paths can be mapped to physical directories of the
operating system using the command (see 5.5.3)
Add LoadPath physical_path as dirpath.
A library can inherit the tree structure of a physical directory by
using the -R option to coqtop or the
command (see 5.5.4)
Add Rec LoadPath physical_path as dirpath.
Compilation units (or modules)
At some point, (sub-)libraries contain modules which coincide
with files at the physical level.
As for sublibraries, the dot notation is used to denote a specific
module of a library. Typically, Coq.Init.Logic is the logical path
associated to the file Logic.v of Coq standard library.
If the physical directory where a file file.v lies is mapped to
the empty logical directory path (which is the default when using the
simple form of Add LoadPath or -I option to coqtop), then
the name of the module it defines is simply file.