7.13 The hints databases for Auto and EAuto

The hints for Auto and EAuto have been reorganized since Coq 6.2.3. They are stored in several databases. Each databases maps head symbols to list of hints. One can use the command Print Hint ident to display the hints associated to the head symbol ident (see 7.13.2). Each hint has a name, a cost that is an nonnegative integer, and a pattern. The hint is tried by Auto if the conclusion of current goal matches its pattern, and after hints with a lower cost. The general command to add a hint to a database is:

Hint name : database := hint_definition
where hint_definition is one of the following expressions:


Remark: There is currently (in the 6.3.1 release) no way to do pattern-matching on hypotheses.


Variants:
  1. Hint ident : ident1 ... identn := hint_expression
    This syntax allows to put the same hint in several databases.


    Remark: The current implementation of Auto has no optimization about hint duplication: if the same hint is present in two databases given as arguments to Auto, it will be tried twice. We recommend to put the same hint in two different databases only if you never use those databases together.

  2. Hint ident := hint_expression
    If no database name is given, the hint is registered in the "core" database.


    Remark: We do not recommend to put hints in this database in your developpements, except when the Hint command is inside a section. In this case the hint will be thrown when closing the section (see 7.13.3)
There are shortcuts that allow to define several goal at once:

7.13.1 Hint databases defined in the Coq standard library

Several hint databases are defined in the Coq standard library. There is no systematic relation between the directories of the library and the databases.

core
This special database is automatically used by Auto. It contains only basic lemmas about negation, conjunction, and so on from. Most of the hints in this database come from the INIT and LOGIC directories.

arith
This databases contains all lemmas about Peano's arithmetic proven in the directories INIT and ARITH

zarith
contains lemmas about binary signed integers from the directories theories/ZARITH and tactics/contrib/Omega. It contains also a hint with a high cost that calls Omega.

bool
contains lemmas about booleans, mostly from directory theories/BOOL.

datatypes
is for lemmas about about lists, trees, streams and so on that are proven in LISTS, TREES subdirectories.

sets
contains lemmas about sets and relations from the directory SETS and RELATIONS.
There is also a special database called "v62". It contains all things that are currently hinted in the 6.2.x releases. It will not be extended later. It is not included in the hint databases list used in the "Auto with *" tactic.

The only purpose of the database "v62" is to ensure compatibility for old developpements with further versions of Coq. If you have a developpement that used to compile with 6.2.2 and that not compiles with 6.2.4, try to replace "Auto" with "Auto with v62" using the script documented below. This will ensure your developpement will compile will further releases of Coq.

To write a new developpement, or to update a developpement not finished yet, you are strongly advised NOT to use this database, but the pre-defined databases. Furthermore, you are advised not to put your own Hints in the "core" database, but use one or several databases specific to your developpement.

7.13.2 Print Hint

This command displays all hints that apply to the current goal. It fails if no proof is being edited, while the two variants can be used at every moment.


Variants:
  1. Print Hint ident
    This command displays only tactics associated with ident in the hints list. This is independent of the goal being edited, to this command will not fail if no goal is being edited.

  2. Print Hint *
    This command displays all declared hints.

7.13.3 Hints and sections

Like grammar rules and structures for the Ring tactic, things added by the Hint command will be erased when closing a section.

Conversely, when the user does Require A., all hints of the module A that are not defined inside a section are loaded.