5.4 Compiled files
This feature allows to build files for a quick loading. When loaded,
the commands contained in a compiled file will not be replayed.
In particular, proofs will not be replayed. This avoids a useless
waste of time.
Remark: A module containing an opened section cannot be compiled.
5.4.1 Read Module qualid.
This looks for a physical file file.vo mapped to logical name
qualid in the current Coq loadpath, then loads its contents but
does not open it: its contents remains accesible to the user only by
using names prefixed by the module name (i.e. qualid or any other
qualified names denoting the same module).
5.4.2 Require dirpath.
This command looks in the loadpath for a file containing module
dirpath, then loads and opens (imports) its contents.
More precisely, if dirpath splits into a library dirpath dirpath' and a module name ident, then the file ident.vo is searched in a physical path mapped to the logical path dirpath'.
If the module required has already been loaded, Coq
simply opens it (as Import dirpath would do it).
If a module A contains a command Require B then the
command Require A loads the module B but does not
open it (See the Require Export variant below).
Variants:
-
Require Export qualid.
This command acts as Require qualid. But if a module A contains a command Require Export B, then the
command Require A opens the module B as if the
user would have typed RequireB.
- Require qualid string.
Specifies the file to load as being string but containing module
qualid which is then opened.
These different variants can be combined.
Error messages:
-
Cannot load ident: no physical path bound to dirpath
- Can't find module toto on loadpath
The command did not find the file toto.vo. Either toto.v exists but is not compiled or toto.vo is in a directory
which is not in your LoadPath (see section 5.5).
- Bad magic number
The file ident.vo was found but either it is not a Coq
compiled module, or it was compiled with an older and incompatible
version of Coq.
See also: chapter 11
5.4.3 Print Modules.
This command shows the currently loaded and currently opened
(imported) modules.
5.4.4 Declare ML Module string1 .. stringn.
This commands loads the Objective Caml compiled files string1 ...stringn (dynamic link). It is mainly used to load tactics
dynamically.
The files are
searched into the current Objective Caml loadpath (see the command Add ML Path in the section 5.5). Loading of Objective Caml
files is only possible under the bytecode version of coqtop
(i.e. coqtop called with options -byte, see chapter
11).
Error messages:
-
File not found on loadpath : string
- Loading of ML object file forbidden in a native Coq
5.4.5 Print ML Modules.
This print the name of all Objective Caml modules loaded with Declare
ML Module. To know from where these module were loaded, the user
should use the command Locate File (see page ??)