This command displays on the screen informations about the declared or defined object referred by qualid.
Error messages:
Variants:
This command displays informations about the current state of the environment, including sections and modules.
Variants:
This command displays the type of term. When called in proof mode, the term is checked in the local context of the current subgoal.
This command performs the specified reduction on term, and displays the resulting term with its type. The term to be reduced may depend on hypothesis introduced in the first subgoal (if a proof is in progress).
See also: Section 8.5.
This command displays the extracted term from term. The extraction is processed according to the distinction between Set and Prop; that is to say, between logical and computational content (see Section 4.1.1). The extracted term is displayed in Objective Caml syntax, where global identifiers are still displayed as in Coq terms.
Variants:
See also: Chapter 18.
This command tells not to unfold the the constants qualid1 …qualidn in tactics using δ-conversion. Unfolding a constant is replacing it by its definition. Opaque can only apply on constants originally defined as Transparent.
Constants defined by a proof ended by Qed are automatically stamped as Opaque and can no longer be considered as Transparent. This is to keep with the usual mathematical practice of proof irrelevance: what matters in a mathematical development is the sequence of lemma statements, not their actual proofs. This distinguishes lemmas from the usual defined constants, whose actual values are of course relevant in general.
See also: sections 8.5, 8.12,
7.1.4
Error messages:
This command is the converse of Opaque and can only apply on constants originally defined as Transparent to restore their initial behaviour after an Opaque command.
The constants automatically declared transparent are the ones defined by a proof ended by Defined, or by a Definition or Local with an explicit body.
Warning: Transparent and Opaque are not synchronous
with the reset mechanism. If a constant was transparent at point A, if
you set it opaque at point B and reset to point A, you return to state
of point A with the difference that the constant is still opaque. This
can cause changes in tactic scripts behaviour.
At section or module closing, a constant recovers the status it got at the time of its definition.
Error messages:
See also: sections 8.5, 8.12,
7.1.4
This command displays the name and type of all theorems of the current
context whose statement’s conclusion has the form (qualid t1 ..
tn). This command is useful to remind the user of the name of
library lemmas.
Error messages:
Variants:
This restricts the search to constructions defined in modules module1 … modulen.
This restricts the search to constructions not defined in modules module1 … modulen.
Error messages:
This command displays the name and type of all objects (theorems, axioms, etc) of the current context whose statement contains qualid. This command is useful to remind the user of the name of library lemmas.
Error messages:
Variants:
This extension of SearchAbout searches for all objects whose statement mentions all of qualid of the list and whose name contains all string of the list.
Example:
SearchAbout term inside module1 … modulen. |
SearchAbout [ qualid-or-string … qualid-or-string ] inside module1 … modulen. |
This restricts the search to constructions defined in modules module1 … modulen.
SearchAbout term outside module1...modulen. |
SearchAbout [ qualid-or-string … qualid-or-string ] outside module1...modulen. |
This restricts the search to constructions not defined in modules module1 … modulen.
This command displays the name and type of all theorems of the current context whose statement’s conclusion matches the expression term where holes in the latter are denoted by “_”.
Patterns need not be linear: you can express that the same expression must occur in two places by using pattern variables ‘?ident”.
Variants:
This restricts the search to constructions defined in modules module1 … modulen.
This restricts the search to constructions not defined in modules module1 … modulen.
This command displays the name and type of all theorems of the current context whose statement’s conclusion is an equality of which one side matches the expression term=. Holes in term are denoted by “_”.
Variants:
This restricts the search to constructions defined in modules module1 … modulen.
This restricts the search to constructions not defined in modules module1 … modulen.
This command displays the full name of the qualified identifier qualid and consequently the Coq module in which it is defined.
See also: Section 11.1.10
Whelp is an experimental searching and browsing tool for the
whole Coq library and the whole set of Coq user contributions.
Whelp requires a browser to work. Whelp has been developed
at the University of Bologna as part of the HELM1 and MoWGLI2 projects. It can be invoked
directly from the Coq toplevel or from CoqIDE, assuming a
graphical environment is also running. The browser to use can be
selected by setting the environment variable COQREMOTEBROWSER. If not explicitly set, it defaults to
firefox -remote "OpenURL(%s)"
or
C:\\PROGRA~1\\INTERN~1\\IEXPLORE %s
, depending on the
underlying operating system (in the command, the string %s
serves as metavariable for the url to open).
The Whelp tool relies on a dedicated Whelp server and on another server
called Getter that retrieves formal documents. The default Whelp server name
can be obtained using the command Test Whelp Server
and the default Getter can be obtained
using the command: Test Whelp Getter . The Whelp server name can be changed using the command:
Set Whelp Server string.
where string is a URL (e.g. http://mowgli.cs.unibo.it:58080).
The Getter can be changed using the command:
Set Whelp Getter string.
where string is a URL (e.g. http://mowgli.cs.unibo.it:58081).
The Whelp commands are:
This command opens a browser window and displays the result of seeking for all names that match the regular expression reg_expr in the Coq library and user contributions. The regular expression can contain the special operators are * and ? that respectively stand for an arbitrary substring and for exactly one character.
Variant: Whelp Locate ident.
This is equivalent to Whelp Locate "ident".
This command opens a browser window and displays the result of seeking for all statements that match the pattern pattern. Holes in the pattern are represented by the wildcard character “_”.
This command opens a browser window and displays the result of seeking for all statements that are instances of the pattern pattern. The pattern is here assumed to be an universally quantified expression.
This command opens a browser window and displays the result of seeking for all statements that have the “form” of an elimination scheme over the type denoted by qualid.
This command opens a browser window and displays the result of seeking for all statements that can be instantiated so that to prove the statement term.
Variant: Whelp Hint.
This is equivalent to Whelp Hint
goal where goal is the current goal to prove. Notice that
Coq does not send the local environment of definitions to the Whelp tool so that it only works on requests strictly based on, only,
definitions of the standard library and user contributions.
Coq offers the possibility of loading different parts of a whole development stored in separate files. Their contents will be loaded as if they were entered from the keyboard. This means that the loaded files are ASCII files containing sequences of commands for Coq’s toplevel. This kind of file is called a script for Coq. The standard (and default) extension of Coq’s script files is .v.
This command loads the file named ident.v, searching successively in each of the directories specified in the loadpath. (see Section 6.5)
Variants:
~
and ..
abbreviations are allowed as well as shell variables. If no
extension is specified, Coq will use the default extension .v
Error messages:
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.
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’.
TODO: effect on the name table.
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:
These different variants can be combined.
Error messages:
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 6.5).
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 12
This command shows the currently loaded and currently opened (imported) modules.
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 6.5). Loading of Objective Caml files is only possible under the bytecode version of coqtop (i.e. coqtop called with options -byte, see chapter 12).
Error messages:
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 Section 6.5.10)
There are currently two loadpaths in Coq. A loadpath where seeking Coq files (extensions .v or .vo or .vi) and one where seeking Objective Caml files. The default loadpath contains the directory “.” denoting the current directory and mapped to the empty logical path (see Section 2.6.2).
This command displays the current working directory.
This command changes the current directory according to string which can be any valid path.
Variants:
This command adds the path string to the current Coq loadpath and maps it to the logical directory dirpath, which means that every file M.v physically lying in directory string becomes accessible through logical name “dirpath.M”.
Remark: Add LoadPath also adds string to the current ML loadpath.
Variants:
This command adds the directory string and all its subdirectories to the current Coq loadpath. The top directory string is mapped to the logical directory dirpath while any subdirectory pdir is mapped to logical directory dirpath.pdir and so on.
Remark: Add Rec LoadPath also recursively adds string to the current ML loadpath.
Variants:
This command removes the path string from the current Coq loadpath.
This command displays the current Coq loadpath.
This command adds the path string to the current Objective Caml loadpath (see the command Declare ML Module in the Section 6.4).
Remark: This command is implied by Add LoadPath string as dirpath.
This command adds the directory string and all its subdirectories to the current Objective Caml loadpath (see the command Declare ML Module in the Section 6.4).
Remark: This command is implied by Add Rec LoadPath string as dirpath.
This command displays the current Objective Caml loadpath. This command makes sense only under the bytecode version of coqtop, i.e. using option -byte (see the command Declare ML Module in the section 6.4).
This command displays the location of file string in the current loadpath. Typically, string is a .cmo or .vo or .v file.
This command gives the status of the Coq module dirpath. It tells if the module is loaded and if not searches in the load path for a module of logical name dirpath.
This command removes all the objects in the environment since ident was introduced, including ident. ident may be the name of a defined or declared object as well as the name of a section. One cannot reset over the name of a module or of an object inside a module.
Error messages:
This commands undoes all the effects of the last vernacular command. This does not include commands that only access to the environment like those described in the previous sections of this chapter (for instance Require and Load can be undone, but not Check and Locate). Commands read from a vernacular file are considered as a single command.
Variants:
Error messages:
This command is dedicated for the use in graphical interfaces. It allows to backtrack to a particular global state, i.e. typically a state corresponding to a previous line in a script. A global state includes declaration environment but also proof environment (see Chapter 7). The three numbers num1, num2 and num3 represent the following:
Notice that when in -emacs mode, Coq displays the current proof and environment state numbers in the prompt. More precisely the prompt in -emacs mode is the following:
<prompt>
idi <
num1
|
id1|
id2|
…|
idn
|
num2 < </prompt>
Where:
It is then possible to compute the Backtrack command to unbury the state corresponding to a particular prompt. For example, suppose the current prompt is:
<
goal4 <
35
|
goal1|
goal4|
goal3|
goal2|
|
8 < </prompt>
and we want to backtrack to a state labelled by:
<
goal2 <
32
|
goal1|
goal2
|
12 < </prompt>
We have to perform Backtrack 32 12 2
, i.e. perform 2
Aborts (to cancel goal4 and goal3), then rewind proof until
state 12 and finally go back to environment state 32. Notice that this
supposes that proofs are nested in a regular way (no Resume or
Suspend commands).
Variants:
Restores the state contained in the file string.
Variants:
Writes the current state into a file string for use in a further session. This file can be given as the inputstate argument of the commands coqtop and coqc.
Variants:
This command permits to quit Coq.
This is used mostly as a debug facility by Coq’s implementors and does not concern the casual user. This command permits to leave Coq temporarily and enter the Objective Caml toplevel. The Objective Caml command:
#use "include";;
add the right loadpaths and loads some toplevel printers for all abstract types of Coq- section_path, identfifiers, terms, judgements, …. You can also use the file base_include instead, that loads only the pretty-printers for section_paths and identifiers. You can return back to Coq with the command:
go();;
Warnings:
This command executes the vernac command command and display the time needed to execute it.
This command turns off the normal displaying.
This command turns the normal display on.
This command sets which left-aligned part of the width of the screen is used for display.
This command resets the width of the screen used for display to its default value (which is 78 at the time of writing this documentation).
This command displays the current screen width used for display.
This command sets the nesting depth of the formatter used for pretty-printing. Beyond this depth, display of subterms is replaced by dots.
This command resets the nesting depth of the formatter used for pretty-printing to its default value (at the time of writing this documentation, the default value is 50).
This command displays the current nesting depth used for display.
Coq comes with two algorithms to check the convertibility of types (see Section 4.3). The first algorithm lazily compares applicative terms while the other is a brute-force but efficient algorithm that first normalizes the terms before comparing them. The second algorithm is based on a bytecode representation of terms similar to the bytecode representation used in the ZINC virtual machine [85]. It is specially useful for intensive computation of algebraic values, such as numbers, and for reflexion-based tactics.
This activates the bytecode-based conversion algorithm.
This deactivates the bytecode-based conversion algorithm.
This tells if the bytecode-based conversion algorithm is activated. The default behavior is to have the bytecode-based conversion algorithm deactivated.
See also: sections 8.5.1 and 12.5.