aboutsummaryrefslogtreecommitdiff
path: root/doc/sphinx
diff options
context:
space:
mode:
Diffstat (limited to 'doc/sphinx')
-rw-r--r--doc/sphinx/_static/notations.css10
-rw-r--r--doc/sphinx/addendum/generalized-rewriting.rst14
-rw-r--r--doc/sphinx/addendum/micromega.rst4
-rw-r--r--doc/sphinx/addendum/type-classes.rst16
-rw-r--r--doc/sphinx/addendum/universe-polymorphism.rst2
-rw-r--r--doc/sphinx/changes.rst713
-rwxr-xr-xdoc/sphinx/conf.py6
-rw-r--r--doc/sphinx/language/core/assumptions.rst2
-rw-r--r--doc/sphinx/language/core/coinductive.rst3
-rw-r--r--doc/sphinx/language/core/definitions.rst15
-rw-r--r--doc/sphinx/language/core/inductive.rst33
-rw-r--r--doc/sphinx/language/core/modules.rst3
-rw-r--r--doc/sphinx/language/core/sections.rst3
-rw-r--r--doc/sphinx/language/extensions/arguments-command.rst16
-rw-r--r--doc/sphinx/language/extensions/canonical.rst4
-rw-r--r--doc/sphinx/proof-engine/ltac.rst19
-rw-r--r--doc/sphinx/proof-engine/ltac2.rst2
-rw-r--r--doc/sphinx/proof-engine/tactics.rst159
-rw-r--r--doc/sphinx/proof-engine/vernacular-commands.rst20
-rw-r--r--doc/sphinx/proofs/automatic-tactics/auto.rst671
-rw-r--r--doc/sphinx/proofs/writing-proofs/rewriting.rst42
-rw-r--r--doc/sphinx/user-extensions/syntax-extensions.rst115
22 files changed, 1331 insertions, 541 deletions
diff --git a/doc/sphinx/_static/notations.css b/doc/sphinx/_static/notations.css
index 8c3f7ac3c1..abb08d98cc 100644
--- a/doc/sphinx/_static/notations.css
+++ b/doc/sphinx/_static/notations.css
@@ -266,3 +266,13 @@ code span.error {
.rst-content tt.literal, .rst-content tt.literal, .rst-content code.literal {
color: inherit !important;
}
+
+/* make the error message index readable */
+.indextable code {
+ white-space: inherit; /* break long lines */
+}
+
+.indextable tr td + td {
+ padding-left: 2em; /* indent 2nd & subsequent lines */
+ text-indent: -2em;
+}
diff --git a/doc/sphinx/addendum/generalized-rewriting.rst b/doc/sphinx/addendum/generalized-rewriting.rst
index 27ae7cea3a..039a23e8c2 100644
--- a/doc/sphinx/addendum/generalized-rewriting.rst
+++ b/doc/sphinx/addendum/generalized-rewriting.rst
@@ -535,11 +535,19 @@ pass additional arguments such as ``using relation``.
.. tacn:: setoid_reflexivity
setoid_symmetry {? in @ident }
setoid_transitivity @one_term
- setoid_rewrite {? {| -> | <- } } @one_term {? with @bindings } {? at @occurrences } {? in @ident }
- setoid_rewrite {? {| -> | <- } } @one_term {? with @bindings } in @ident at @occurrences
+ setoid_rewrite {? {| -> | <- } } @one_term {? with @bindings } {? at @rewrite_occs } {? in @ident }
+ setoid_rewrite {? {| -> | <- } } @one_term {? with @bindings } in @ident at @rewrite_occs
setoid_replace @one_term with @one_term {? using relation @one_term } {? in @ident } {? at {+ @int_or_var } } {? by @ltac_expr3 }
:name: setoid_reflexivity; setoid_symmetry; setoid_transitivity; setoid_rewrite; _; setoid_replace
+ .. todo: move rewrite_occs to rewrite chapter when that chapter is revised
+
+ .. insertprodn rewrite_occs rewrite_occs
+
+ .. prodn::
+ rewrite_occs ::= {+ @integer }
+ | @ident
+
The ``using relation`` arguments cannot be passed to the unprefixed form.
The latter argument tells the tactic what parametric relation should
be used to replace the first tactic argument with the second one. If
@@ -714,6 +722,8 @@ instances are tried at each node of the search tree). To speed it up,
declare your constant as rigid for proof search using the command
:cmd:`Typeclasses Opaque`.
+.. _strategies4rewriting:
+
Strategies for rewriting
------------------------
diff --git a/doc/sphinx/addendum/micromega.rst b/doc/sphinx/addendum/micromega.rst
index fb9965e43a..28b60878d2 100644
--- a/doc/sphinx/addendum/micromega.rst
+++ b/doc/sphinx/addendum/micromega.rst
@@ -250,11 +250,11 @@ proof by abstracting monomials by variables.
`psatz`: a proof procedure for non-linear arithmetic
----------------------------------------------------
-.. tacn:: psatz @one_term {? @int_or_var }
+.. tacn:: psatz @one_term {? @nat_or_var }
:name: psatz
This tactic explores the *Cone* by increasing degrees – hence the
- depth parameter *n*. In theory, such a proof search is complete – if the
+ depth parameter :token:`nat_or_var`. In theory, such a proof search is complete – if the
goal is provable the search eventually stops. Unfortunately, the
external oracle is using numeric (approximate) optimization techniques
that might miss a refutation.
diff --git a/doc/sphinx/addendum/type-classes.rst b/doc/sphinx/addendum/type-classes.rst
index 22527dc379..4143d836c4 100644
--- a/doc/sphinx/addendum/type-classes.rst
+++ b/doc/sphinx/addendum/type-classes.rst
@@ -335,12 +335,6 @@ Summary of the commands
.. cmd:: Instance {? @ident_decl {* @binder } } : @type {? @hint_info } {? {| := %{ {* @field_def } %} | := @term } }
- .. insertprodn hint_info one_pattern
-
- .. prodn::
- hint_info ::= %| {? @natural } {? @one_pattern }
- one_pattern ::= @one_term
-
Declares a typeclass instance named
:token:`ident_decl` of the class :n:`@type` with the specified parameters and with
fields defined by :token:`field_def`, where each field must be a declared field of
@@ -405,7 +399,7 @@ Summary of the commands
Shows the list of instances associated with the typeclass :token:`reference`.
-.. tacn:: typeclasses eauto {? bfs } {? @int_or_var } {? with {+ @ident } }
+.. tacn:: typeclasses eauto {? bfs } {? @nat_or_var } {? with {+ @ident } }
This proof search tactic uses the resolution engine that is run
implicitly during type checking. This tactic uses a different resolution
@@ -445,11 +439,11 @@ Summary of the commands
+ Use the :cmd:`Typeclasses eauto` command to customize the behavior of
this tactic.
- :n:`@int_or_var`
+ :n:`@nat_or_var`
Specifies the maximum depth of the search.
.. warning::
- The semantics for the limit :n:`@int_or_var`
+ The semantics for the limit :n:`@nat_or_var`
are different than for :tacn:`auto`. By default, if no limit is given, the
search is unbounded. Unlike :tacn:`auto`, introduction steps count against
the limit, which might result in larger limits being necessary when
@@ -503,7 +497,7 @@ Typeclasses Transparent, Typeclasses Opaque
It is useful when some constants prevent some unifications and make
resolution fail. It is also useful to declare constants which
- should never be unfolded during proof-search, like fixpoints or
+ should never be unfolded during proof search, like fixpoints or
anything which does not look like an abbreviation. This can
additionally speed up proof search as the typeclass map can be
indexed by such rigid constants (see
@@ -555,7 +549,7 @@ Settings
This can be expensive as it requires rebuilding hint
clauses dynamically, and does not benefit from the invertibility
status of the product introduction rule, resulting in potentially more
- expensive proof-search (i.e. more useless backtracking).
+ expensive proof search (i.e. more useless backtracking).
.. flag:: Typeclass Resolution For Conversion
diff --git a/doc/sphinx/addendum/universe-polymorphism.rst b/doc/sphinx/addendum/universe-polymorphism.rst
index 4615a8dfca..bb78b142ca 100644
--- a/doc/sphinx/addendum/universe-polymorphism.rst
+++ b/doc/sphinx/addendum/universe-polymorphism.rst
@@ -412,7 +412,7 @@ Explicit Universes
| _
| @qualid
univ_decl ::= @%{ {* @ident } {? + } {? %| {*, @univ_constraint } {? + } } %}
- cumul_univ_decl ::= @%{ {* {? {| = | + | * } } @ident } {? + } {? %| {*, @univ_constraint } {? + } } %}
+ cumul_univ_decl ::= @%{ {* {? {| + | = | * } } @ident } {? + } {? %| {*, @univ_constraint } {? + } } %}
univ_constraint ::= @universe_name {| < | = | <= } @universe_name
The syntax has been extended to allow users to explicitly bind names
diff --git a/doc/sphinx/changes.rst b/doc/sphinx/changes.rst
index 24fa71059c..fcb150e3da 100644
--- a/doc/sphinx/changes.rst
+++ b/doc/sphinx/changes.rst
@@ -8,6 +8,688 @@ Recent changes
.. include:: ../unreleased.rst
+Version 8.13
+------------
+
+Summary of changes
+~~~~~~~~~~~~~~~~~~
+
+Coq version 8.13 integrates many usability improvements, as well
+as extensions of the core language.
+The main changes include:
+
+ - :ref:`Introduction <813PrimArrays>` of :ref:`primitive persistent arrays<primitive-arrays>`
+ in the core language, implemented using imperative persistent arrays.
+ - Introduction of :ref:`definitional proof irrelevance <813UIP>` for the equality type
+ defined in the SProp sort.
+ - Cumulative record and inductive type declarations can now
+ :ref:`specify <813VarianceDecl>` the variance of their universes.
+ - Various bugfixes and uniformization of behavior with respect to the use of
+ implicit arguments and the handling of existential variables in
+ declarations, unification and tactics.
+ - New warning for :ref:`unused variables <813UnusedVar>` in catch-all match
+ branches that match multiple distinct patterns.
+ - New :ref:`warning <813HintWarning>` for `Hint` commands outside
+ sections without a locality attribute, whose goal is to eventually
+ remove the fragile default behavior of importing hints only when
+ using `Require`. The recommended fix is to declare hints as `export`,
+ instead of the current default `global`, meaning that they are imported
+ through `Require Import` only, not `Require`.
+ See the following `rationale and guidelines <https://coq.discourse.group/t/change-of-default-locality-for-hint-commands-in-coq-8-13/1140>`_
+ for details.
+ - General support for :ref:`boolean attributes <813BooleanAttrs>`.
+ - Many improvements to the handling of :ref:`notations <813Notations>`,
+ including number notations, recursive notations and notations with bindings.
+ A new algorithm chooses the most precise notation available to print an expression,
+ which might introduce changes in printing behavior.
+ - Tactic :ref:`improvements <813Tactics>` in :tacn:`lia` and its :tacn:`zify` preprocessing step,
+ now supporting reasoning on boolean operators such as :g:`Z.leb` and supporting
+ primitive integers :g:`Int63`.
+ - Typing flags can now be specified :ref:`per-constant / inductive <813TypingFlags>`.
+ - Improvements to the reference manual including updated syntax
+ descriptions that match Coq's grammar in several chapters, and splitting parts of
+ the tactics chapter to independent sections.
+
+See the `Changes in 8.13+beta1`_ section and following sections for the
+detailed list of changes, including potentially breaking changes marked
+with **Changed**.
+
+Coq's documentation is available at https://coq.github.io/doc/v8.13/refman (reference
+manual), and https://coq.github.io/doc/v8.13/stdlib (documentation of
+the standard library). Developer documentation of the ML API is available
+at https://coq.github.io/doc/v8.13/api.
+
+Maxime Dénès, Emilio Jesús Gallego Arias, Gaëtan Gilbert, Michael
+Soegtrop and Théo Zimmermann worked on maintaining and improving the
+continuous integration system and package building infrastructure.
+
+Erik Martin-Dorel has maintained the `Coq Docker images
+<https://hub.docker.com/r/coqorg/coq>`_ that are used in many Coq
+projects for continuous integration.
+
+The OPAM repository for Coq packages has been maintained by
+Guillaume Claret, Karl Palmskog, Matthieu Sozeau and Enrico Tassi with
+contributions from many users. A list of packages is available at
+https://coq.inria.fr/opam/www/.
+
+Our current 32 maintainers are Yves Bertot, Frédéric Besson, Tej
+Chajed, Cyril Cohen, Pierre Corbineau, Pierre Courtieu, Maxime Dénès,
+Jim Fehrle, Julien Forest, Emilio Jesús Gallego Arias, Gaëtan Gilbert,
+Georges Gonthier, Benjamin Grégoire, Jason Gross, Hugo Herbelin,
+Vincent Laporte, Olivier Laurent, Assia Mahboubi, Kenji Maillard,
+Guillaume Melquiond, Pierre-Marie Pédrot, Clément Pit-Claudel,
+Kazuhiko Sakaguchi, Vincent Semeria, Michael Soegtrop, Arnaud Spiwack,
+Matthieu Sozeau, Enrico Tassi, Laurent Théry, Anton Trunov, Li-yao Xia
+and Théo Zimmermann.
+
+The 52 contributors to this version are Reynald Affeldt, Tanaka Akira, Frédéric
+Besson, Lasse Blaauwbroek, Clément Blaudeau, Martin Bodin, Ali Caglayan, Tej Chajed,
+Cyril Cohen, Julien Coolen, Matthew Dempsky, Maxime Dénès, Andres Erbsen,
+Jim Fehrle, Emilio Jesús Gallego Arias, Paolo G. Giarrusso, Attila Gáspár, Gaëtan Gilbert,
+Jason Gross, Benjamin Grégoire, Hugo Herbelin, Wolf Honore, Jasper Hugunin, Ignat Insarov,
+Ralf Jung, Fabian Kunze, Vincent Laporte, Olivier Laurent, Larry D. Lee Jr,
+Thomas Letan, Yishuai Li, Xia Li-yao, James Lottes, Jean-Christophe Léchenet,
+Kenji Maillard, Erik Martin-Dorel, Yusuke Matsushita, Guillaume Melquiond,
+Carl Patenaude-Poulin, Clément Pit-Claudel, Pierre-Marie Pédrot, Pierre Roux,
+Kazuhiko Sakaguchi, Vincent Semeria, Michael Soegtrop, Matthieu Sozeau,
+Enrico Tassi, Anton Trunov, Edward Wang, Li-yao Xia, Beta Ziliani and Théo Zimmermann.
+
+The Coq community at large helped improve the design of this new version via
+the GitHub issue and pull request system, the Coq development mailing list
+coqdev@inria.fr, the coq-club@inria.fr mailing list, the `Discourse forum
+<https://coq.discourse.group/>`_ and the `Coq Zulip chat <http://coq.zulipchat.com>`_.
+
+Version 8.13's development spanned 5 months from the release of
+Coq 8.12.0. Enrico Tassi and Maxime Dénès are the release managers of Coq 8.13.
+This release is the result of 400 merged PRs, closing ~100 issues.
+
+| Nantes, November 2020,
+| Matthieu Sozeau for the Coq development team
+|
+
+
+Changes in 8.13+beta1
+~~~~~~~~~~~~~~~~~~~~~
+
+.. contents::
+ :local:
+
+Kernel
+^^^^^^
+
+ .. _813UIP:
+
+- **Added:**
+ Definitional UIP, only when :flag:`Definitional UIP` is enabled.
+ This models definitional uniqueness of identity proofs for the equality
+ type in SProp. It is deactivated by default as it can lead to
+ non-termination in combination with impredicativity.
+ Use of this flag is also printed by :cmd:`Print Assumptions`. See
+ documentation of the flag for details.
+ (`#10390 <https://github.com/coq/coq/pull/10390>`_,
+ by Gaëtan Gilbert).
+
+ .. _813PrimArrays:
+
+- **Added:**
+ Built-in support for persistent arrays, which expose a functional
+ interface but are implemented using an imperative data structure, for
+ better performance.
+ (`#11604 <https://github.com/coq/coq/pull/11604>`_,
+ by Maxime Dénès and Benjamin Grégoire, with help from Gaëtan Gilbert).
+
+ Primitive arrays are irrelevant in their single
+ polymorphic universe (same as a polymorphic cumulative list
+ inductive would be) (`#13356
+ <https://github.com/coq/coq/pull/13356>`_, fixes `#13354
+ <https://github.com/coq/coq/issues/13354>`_, by Gaëtan Gilbert).
+
+- **Fixed:**
+ A loss of definitional equality for declarations obtained through
+ :cmd:`Include` when entering the scope of a :cmd:`Module` or
+ :cmd:`Module Type` was causing :cmd:`Search` not to see the included
+ declarations
+ (`#12537 <https://github.com/coq/coq/pull/12537>`_, fixes `#12525
+ <https://github.com/coq/coq/pull/12525>`_ and `#12647
+ <https://github.com/coq/coq/pull/12647>`_, by Hugo Herbelin).
+
+- **Fixed:**
+ Fix an incompleteness in the typechecking of `match` for
+ cumulative inductive types. This could result in breaking subject
+ reduction.
+ (`#13501 <https://github.com/coq/coq/pull/13501>`_,
+ fixes `#13495 <https://github.com/coq/coq/issues/13495>`_,
+ by Matthieu Sozeau).
+
+Specification language, type inference
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+ .. _813BooleanAttrs:
+
+- **Changed:**
+ :term:`Boolean attributes <boolean attribute>` are now specified using
+ key/value pairs, that is to say :n:`@ident__attr{? = {| yes | no } }`.
+ If the value is missing, the default is :n:`yes`. The old syntax is still
+ supported, but produces the ``deprecated-attribute-syntax`` warning.
+
+ Deprecated attributes are :attr:`universes(monomorphic)`,
+ :attr:`universes(notemplate)` and :attr:`universes(noncumulative)`, which are
+ respectively replaced by :attr:`universes(polymorphic=no) <universes(polymorphic)>`,
+ :attr:`universes(template=no) <universes(template)>`
+ and :attr:`universes(cumulative=no) <universes(cumulative)>`.
+ Attributes :attr:`program` and :attr:`canonical` are also affected,
+ with the syntax :n:`@ident__attr(false)` being deprecated in favor of
+ :n:`@ident__attr=no`.
+ (`#13312 <https://github.com/coq/coq/pull/13312>`_,
+ by Emilio Jesus Gallego Arias).
+- **Changed:** Heuristics for universe minimization to :g:`Set`: also
+ use constraints ``Prop <= i`` (`#10331
+ <https://github.com/coq/coq/pull/10331>`_, by Gaëtan Gilbert with
+ help from Maxime Dénès and Matthieu Sozeau, fixes `#12414
+ <https://github.com/coq/coq/issues/12414>`_).
+- **Changed:** The type given to :cmd:`Instance` is no longer automatically
+ generalized over unbound and :ref:`generalizable <implicit-generalization>` variables.
+ Use ``Instance : `{type}`` instead of :n:`Instance : @type` to get the old behaviour, or
+ enable the compatibility flag :flag:`Instance Generalized Output`.
+ (`#13188 <https://github.com/coq/coq/pull/13188>`_, fixes `#6042
+ <https://github.com/coq/coq/issues/6042>`_, by Gaëtan Gilbert).
+- **Changed:**
+ Tweaked the algorithm giving default names to arguments.
+ Should reduce the frequency that argument names get an
+ unexpected suffix.
+ Also makes :flag:`Mangle Names` not mess up argument names.
+ (`#12756 <https://github.com/coq/coq/pull/12756>`_,
+ fixes `#12001 <https://github.com/coq/coq/issues/12001>`_
+ and `#6785 <https://github.com/coq/coq/issues/6785>`_,
+ by Jasper Hugunin).
+- **Removed:**
+ Undocumented and experimental forward class hint feature ``:>>``.
+ Use ``:>`` (see :n:`@of_type`) instead
+ (`#13106 <https://github.com/coq/coq/pull/13106>`_,
+ by Pierre-Marie Pédrot).
+
+ .. _813VarianceDecl:
+
+- **Added:** Commands :cmd:`Inductive`, :cmd:`Record` and synonyms now
+ support syntax `Inductive foo@{=i +j *k l}` to specify variance
+ information for their universes (in :ref:`Cumulative <cumulative>`
+ mode) (`#12653 <https://github.com/coq/coq/pull/12653>`_, by Gaëtan
+ Gilbert).
+
+ .. _813UnusedVar:
+
+- **Added:**
+ Warning on unused variables in pattern-matching branches of
+ :n:`match` serving as catch-all branches for at least two distinct
+ patterns.
+ (`#12768 <https://github.com/coq/coq/pull/12768>`_,
+ fixes `#12762 <https://github.com/coq/coq/issues/12762>`_,
+ by Hugo Herbelin).
+- **Added:**
+ Definition and (Co)Fixpoint now support the :attr:`using` attribute.
+ It has the same effect as :cmd:`Proof using`, which is only available in
+ interactive mode.
+ (`#13183 <https://github.com/coq/coq/pull/13183>`_,
+ by Enrico Tassi).
+
+ .. _813TypingFlags:
+
+- **Added:**
+ Typing flags can now be specified per-constant / inductive, this
+ allows to fine-grain specify them from plugins or attributes. See
+ :ref:`controlling-typing-flags` for details on attribute syntax.
+ (`#12586 <https://github.com/coq/coq/pull/12586>`_,
+ by Emilio Jesus Gallego Arias).
+
+- **Added:**
+ Inference of return predicate of a :g:`match` by inversion takes
+ sort elimination constraints into account
+ (`#13290 <https://github.com/coq/coq/pull/13290>`_,
+ grants `#13278 <https://github.com/coq/coq/issues/13278>`_,
+ by Hugo Herbelin).
+- **Fixed:**
+ Implicit arguments taken into account in defined fields of a record type declaration
+ (`#13166 <https://github.com/coq/coq/pull/13166>`_,
+ fixes `#13165 <https://github.com/coq/coq/issues/13165>`_,
+ by Hugo Herbelin).
+- **Fixed:**
+ Allow use of typeclass inference for the return predicate of a :n:`match`
+ (was deactivated in versions 8.10 to 8.12, `#13217 <https://github.com/coq/coq/pull/13217>`_,
+ fixes `#13216 <https://github.com/coq/coq/issues/13216>`_,
+ by Hugo Herbelin).
+- **Fixed:**
+ A case of unification raising an anomaly IllTypedInstance
+ (`#13376 <https://github.com/coq/coq/pull/13376>`_,
+ fixes `#13266 <https://github.com/coq/coq/issues/13266>`_,
+ by Hugo Herbelin).
+- **Fixed:**
+ Using :n:`{wf ...}` in local fixpoints is an error, not an anomaly
+ (`#13383 <https://github.com/coq/coq/pull/13383>`_,
+ fixes `#11816 <https://github.com/coq/coq/issues/11816>`_,
+ by Hugo Herbelin).
+- **Fixed:**
+ Issue when two expressions involving different projections and one is
+ primitive need to be unified
+ (`#13386 <https://github.com/coq/coq/pull/13386>`_,
+ fixes `#9971 <https://github.com/coq/coq/issues/9971>`_,
+ by Hugo Herbelin).
+- **Fixed:**
+ A bug producing ill-typed instances of existential variables when let-ins
+ interleaved with assumptions
+ (`#13387 <https://github.com/coq/coq/pull/13387>`_,
+ fixes `#12348 <https://github.com/coq/coq/issues/13387>`_,
+ by Hugo Herbelin).
+
+ .. _813Notations:
+
+Notations
+^^^^^^^^^
+
+- **Changed:**
+ In notations (except in custom entries), the misleading :n:`@syntax_modifier`
+ :n:`@ident ident` (which accepted either an identifier or
+ a :g:`_`) is deprecated and should be replaced by :n:`@ident name`. If
+ the intent was really to only parse identifiers, this will
+ eventually become possible, but only as of Coq 8.15.
+ In custom entries, the meaning of :n:`@ident ident` is silently changed
+ from parsing identifiers or :g:`_` to parsing only identifiers
+ without warning, but this presumably affects only rare, recent and
+ relatively experimental code
+ (`#11841 <https://github.com/coq/coq/pull/11841>`_,
+ fixes `#9514 <https://github.com/coq/coq/pull/9514>`_,
+ by Hugo Herbelin).
+- **Changed:**
+ Improved support for notations/abbreviations with mixed terms and patterns (such as the forcing modality)
+ (`#12099 <https://github.com/coq/coq/pull/12099>`_,
+ by Hugo Herbelin).
+- **Changed**
+ Rational and real constants are parsed differently.
+ The exponent is now encoded separately from the fractional part
+ using ``Z.pow_pos``. This way, parsing large exponents can no longer
+ blow up and constants are printed in a form closer to the one in which they
+ were parsed (i.e., ``102e-2`` is reprinted as such and not ``1.02``).
+ (`#12218 <https://github.com/coq/coq/pull/12218>`_,
+ by Pierre Roux).
+- **Changed:**
+ Scope information is propagated in indirect applications to a
+ reference prefixed with :g:`@`; this covers for instance the case
+ :g:`r.(@p) t` where scope information from :g:`p` is now taken into
+ account for interpreting :g:`t` (`#12685
+ <https://github.com/coq/coq/pull/12685>`_, by Hugo Herbelin).
+- **Changed:**
+ New model for ``only parsing`` and ``only printing`` notations with
+ support for at most one parsing-and-printing or only-parsing
+ notation per notation and scope, but an arbitrary number of
+ only-printing notations
+ (`#12950 <https://github.com/coq/coq/pull/12950>`_,
+ fixes `#4738 <https://github.com/coq/coq/issues/4738>`_
+ and `#9682 <https://github.com/coq/coq/issues/9682>`_
+ and part 2 of `#12908 <https://github.com/coq/coq/issues/12908>`_,
+ by Hugo Herbelin).
+- **Changed:**
+ Redeclaring a notation also reactivates its printing rule; in
+ particular a second :cmd:`Import` of the same module reactivates the
+ printing rules declared in this module. In theory, this leads to
+ changes in behavior for printing. However, this is mitigated in
+ general by the adoption in `#12986
+ <https://github.com/coq/coq/pull/12986>`_ of a priority given to
+ notations which match a larger part of the term to print
+ (`#12984 <https://github.com/coq/coq/pull/12984>`_,
+ fixes `#7443 <https://github.com/coq/coq/issues/7443>`_
+ and `#10824 <https://github.com/coq/coq/issues/10824>`_,
+ by Hugo Herbelin).
+- **Changed:**
+ Use of notations for printing now gives preference
+ to notations which match a larger part of the term to abbreviate
+ (`#12986 <https://github.com/coq/coq/pull/12986>`_,
+ by Hugo Herbelin).
+- **Removed**
+ OCaml parser and printer for real constants have been removed.
+ Real constants are now handled with proven Coq code.
+ (`#12218 <https://github.com/coq/coq/pull/12218>`_,
+ by Pierre Roux).
+- **Deprecated**
+ ``Numeral.v`` is deprecated, please use ``Number.v`` instead.
+ (`#12218 <https://github.com/coq/coq/pull/12218>`_,
+ by Pierre Roux).
+- **Deprecated:**
+ `Numeral Notation`, please use :cmd:`Number Notation` instead
+ (`#12979 <https://github.com/coq/coq/pull/12979>`_,
+ by Pierre Roux).
+- **Added:**
+ :flag:`Printing Float` flag to print primitive floats as hexadecimal
+ instead of decimal values. This is included in the :flag:`Printing All` flag
+ (`#11986 <https://github.com/coq/coq/pull/11986>`_,
+ by Pierre Roux).
+- **Added:**
+ :ref:`Number Notation <number-notations>` and :ref:`String Notation
+ <string-notations>` commands now
+ support parameterized inductive and non inductive types
+ (`#12218 <https://github.com/coq/coq/pull/12218>`_,
+ fixes `#12035 <https://github.com/coq/coq/issues/12035>`_,
+ by Pierre Roux, review by Jason Gross and Jim Fehrle for the
+ reference manual).
+- **Added:**
+ Added support for encoding notations of the form :g:`x ⪯ y ⪯ .. ⪯ z ⪯ t`.
+ This feature is considered experimental.
+ (`#12765 <https://github.com/coq/coq/pull/12765>`_,
+ by Hugo Herbelin).
+- **Added:**
+ The :n:`@binder` entry of :cmd:`Notation` can now be used in
+ notations expecting a single (non-recursive) binder
+ (`#13265 <https://github.com/coq/coq/pull/13265>`_,
+ by Hugo Herbelin, see section :ref:`notations-and-binders` of the
+ reference manual).
+- **Fixed:**
+ Issues in the presence of notations recursively referring to another
+ applicative notations, such as missing scope propagation, or failure
+ to use a notation for printing
+ (`#12960 <https://github.com/coq/coq/pull/12960>`_,
+ fixes `#9403 <https://github.com/coq/coq/issues/9403>`_
+ and `#10803 <https://github.com/coq/coq/issues/10803>`_,
+ by Hugo Herbelin).
+- **Fixed:**
+ Capture the names of global references by
+ binders in the presence of notations for binders
+ (`#12965 <https://github.com/coq/coq/pull/12965>`_,
+ fixes `#9569 <https://github.com/coq/coq/issues/9569>`_,
+ by Hugo Herbelin).
+- **Fixed:**
+ Preventing notations for constructors to involve binders
+ (`#13092 <https://github.com/coq/coq/pull/13092>`_,
+ fixes `#13078 <https://github.com/coq/coq/issues/13078>`_,
+ by Hugo Herbelin).
+- **Fixed:** Notations understand universe names without getting
+ confused by different imported modules between declaration and use
+ locations (`#13415 <https://github.com/coq/coq/pull/13415>`_, fixes
+ `#13303 <https://github.com/coq/coq/issues/13303>`_, by Gaëtan
+ Gilbert).
+
+ .. _813Tactics:
+
+Tactics
+^^^^^^^
+
+- **Changed:**
+ In :tacn:`refine`, new existential variables unified with existing ones are no
+ longer considered as fresh. The behavior of :tacn:`simple refine` no longer depends on
+ the orientation of evar-evar unification problems, and new existential variables
+ are always turned into (unshelved) goals. This can break compatibility in
+ some cases (`#7825 <https://github.com/coq/coq/pull/7825>`_, by Matthieu
+ Sozeau, with help from Maxime Dénès, review by Pierre-Marie Pédrot and
+ Enrico Tassi, fixes `#4095 <https://github.com/coq/coq/issues/4095>`_ and
+ `#4413 <https://github.com/coq/coq/issues/4413>`_).
+- **Changed:**
+ Giving an empty list of occurrences after :n:`in` in tactics is no
+ longer permitted. Omitting the :n:`in` gives the same behavior
+ (`#13237 <https://github.com/coq/coq/pull/13236>`_,
+ fixes `#13235 <https://github.com/coq/coq/issues/13235>`_,
+ by Hugo Herbelin).
+- **Removed:**
+ :n:`at @occs_nums` clauses in tactics such as :tacn:`unfold`
+ no longer allow negative values. A "-" before the
+ list (for set complement) is still supported. Ex: "at -1 -2"
+ is no longer supported but "at -1 2" is.
+ (`#13403 <https://github.com/coq/coq/pull/13403>`_,
+ by Jim Fehrle).
+- **Removed:**
+ A number of tactics that formerly accepted negative
+ numbers as parameters now give syntax errors for negative
+ values. These include {e}constructor, do, timeout,
+ 9 {e}auto tactics and psatz*.
+ (`#13417 <https://github.com/coq/coq/pull/13417>`_,
+ by Jim Fehrle).
+- **Removed:**
+ The deprecated and undocumented `prolog` tactic was removed
+ (`#12399 <https://github.com/coq/coq/pull/12399>`_,
+ by Pierre-Marie Pédrot).
+- **Removed:** `info` tactic that was deprecated in 8.5.
+ (`#12423 <https://github.com/coq/coq/pull/12423>`_, by Jim Fehrle).
+- **Deprecated:**
+ Undocumented :n:`eauto @nat_or_var @nat_or_var` syntax in favor of new :tacn:`bfs eauto`.
+ Also deprecated 2-integer syntax for :tacn:`debug eauto` and :tacn:`info_eauto`.
+ (Use :tacn:`bfs eauto` with the :flag:`Info Eauto` or :flag:`Debug Eauto` flags instead.)
+ (`#13381 <https://github.com/coq/coq/pull/13381>`_,
+ by Jim Fehrle).
+- **Added:**
+ :tacn:`lia` is extended to deal with boolean operators e.g. `andb` or `Z.leb`.
+ (As `lia` gets more powerful, this may break proof scripts relying on `lia` failure.)
+ (`#11906 <https://github.com/coq/coq/pull/11906>`_, by Frédéric Besson).
+- **Added:**
+ :tacn:`apply … in` supports several hypotheses
+ (`#12246 <https://github.com/coq/coq/pull/12246>`_,
+ by Hugo Herbelin; grants
+ `#9816 <https://github.com/coq/coq/pull/9816>`_).
+- **Added:**
+ The :tacn:`zify` tactic can now be extended by redefining the `zify_pre_hook`
+ tactic. (`#12552 <https://github.com/coq/coq/pull/12552>`_,
+ by Kazuhiko Sakaguchi).
+- **Added:**
+ The :tacn:`zify` tactic provides support for primitive integers (module :g:`ZifyInt63`).
+ (`#12648 <https://github.com/coq/coq/pull/12648>`_, by Frédéric Besson).
+- **Fixed:**
+ Avoid exposing an internal name of the form :n:`_tmp` when applying the
+ :n:`_` introduction pattern which would break a dependency
+ (`#13337 <https://github.com/coq/coq/pull/13337>`_,
+ fixes `#13336 <https://github.com/coq/coq/issues/13336>`_,
+ by Hugo Herbelin).
+- **Fixed:**
+ The case of tactics, such as :tacn:`eapply`, producing existential variables
+ under binders with an ill-formed instance
+ (`#13373 <https://github.com/coq/coq/pull/13373>`_,
+ fixes `#13363 <https://github.com/coq/coq/issues/13363>`_,
+ by Hugo Herbelin).
+
+Tactic language
+^^^^^^^^^^^^^^^
+
+- **Added:**
+ An if-then-else syntax to Ltac2
+ (`#13232 <https://github.com/coq/coq/pull/13232>`_,
+ fixes `#10110 <https://github.com/coq/coq/issues/10110>`_,
+ by Pierre-Marie Pédrot).
+- **Fixed:**
+ Printing of the quotation qualifiers when printing :g:`Ltac` functions
+ (`#13028 <https://github.com/coq/coq/pull/13028>`_,
+ fixes `#9716 <https://github.com/coq/coq/issues/9716>`_
+ and `#13004 <https://github.com/coq/coq/issues/13004>`_,
+ by Hugo Herbelin).
+
+SSReflect
+^^^^^^^^^
+
+- **Added:**
+ SSReflect intro pattern ltac views ``/[dup]``, ``/[swap]`` and ``/[apply]``
+ (`#13317 <https://github.com/coq/coq/pull/13317>`_,
+ by Cyril Cohen).
+- **Fixed:**
+ Working around a bug of interaction between + and /(ltac:(...)) cf
+ `#13458 <https://github.com/coq/coq/issues/13458>`_
+ (`#13459 <https://github.com/coq/coq/pull/13459>`_,
+ by Cyril Cohen).
+
+Commands and options
+^^^^^^^^^^^^^^^^^^^^
+
+- **Changed:**
+ Drop prefixes from grammar non-terminal names,
+ e.g. "constr:global" -> "global", "Prim.name" -> "name".
+ Visible in the output of :cmd:`Print Grammar` and :cmd:`Print Custom Grammar`.
+ (`#13096 <https://github.com/coq/coq/pull/13096>`_,
+ by Jim Fehrle).
+- **Changed:**
+ When declaring arbitrary terms as hints, unsolved
+ evars are not abstracted implicitly anymore and instead
+ raise an error
+ (`#13139 <https://github.com/coq/coq/pull/13139>`_,
+ by Pierre-Marie Pédrot).
+- **Removed:**
+ In the :cmd:`Extraction Language` command, remove `Ocaml` as a valid value.
+ Use `OCaml` instead. This was deprecated in Coq 8.8, `#6261 <https://github.com/coq/coq/pull/6261>`_
+ (`#13016 <https://github.com/coq/coq/pull/13016>`_, by Jim Fehrle).
+
+ .. _813HintWarning:
+
+- **Deprecated:**
+ The default value for hint locality is currently :attr:`local` in a section and
+ :attr:`global` otherwise, but is scheduled to change in a future release. For the
+ time being, adding hints outside of sections without specifying an explicit
+ locality is therefore triggering a deprecation warning. It is recommended to
+ use :attr:`export` whenever possible
+ (`#13384 <https://github.com/coq/coq/pull/13384>`_,
+ by Pierre-Marie Pédrot).
+- **Deprecated:**
+ :cmd:`Grab Existential Variables` and :cmd:`Existential` commands
+ (`#12516 <https://github.com/coq/coq/pull/12516>`_,
+ by Maxime Dénès).
+- **Added:**
+ The :attr:`export` locality can now be used for all Hint commands,
+ including :cmd:`Hint Cut`, :cmd:`Hint Mode`, :cmd:`Hint Transparent` /
+ :cmd:`Opaque <Hint Opaque>` and
+ :cmd:`Remove Hints`
+ (`#13388 <https://github.com/coq/coq/pull/13388>`_,
+ by Pierre-Marie Pédrot).
+- **Added:**
+ Support for automatic insertion of coercions in :cmd:`Search`
+ patterns. Additionally, head patterns are now automatically
+ interpreted as types
+ (`#13255 <https://github.com/coq/coq/pull/13255>`_,
+ fixes `#13244 <https://github.com/coq/coq/issues/13244>`_,
+ by Hugo Herbelin).
+- **Added:**
+ The :cmd:`Proof using` command can now be used without loading the
+ Ltac plugin (`-noinit` mode)
+ (`#13339 <https://github.com/coq/coq/pull/13339>`_,
+ by Théo Zimmermann).
+- **Added:**
+ Clarify in the documentation that :cmd:`Add ML Path` is not exported to compiled files
+ (`#13345 <https://github.com/coq/coq/pull/13345>`_,
+ fixes `#13344 <https://github.com/coq/coq/issues/13344>`_,
+ by Hugo Herbelin).
+
+Tools
+^^^^^
+
+- **Changed:**
+ Option `-native-compiler` of the configure script now impacts the
+ default value of the `-native-compiler` option of coqc. The
+ `-native-compiler` option of the configure script supports a new `ondemand`
+ value, which becomes the default, thus preserving the previous default
+ behavior.
+ The stdlib is still precompiled when configuring with `-native-compiler
+ yes`. It is not precompiled otherwise.
+ This an implementation of point 2 of
+ `CEP #48 <https://github.com/coq/ceps/pull/48>`_
+ (`#13352 <https://github.com/coq/coq/pull/13352>`_,
+ by Pierre Roux).
+- **Changed:**
+ Added the ability for coq_makefile to directly set the installation folders,
+ through the `COQLIBINSTALL` and `COQDOCINSTALL` variables.
+ See :ref:`coqmakefilelocal`.
+ (`#12389 <https://github.com/coq/coq/pull/12389>`_, by Martin Bodin, review of Enrico Tassi).
+- **Removed:** The option ``-I`` of coqchk was removed (it was
+ deprecated in Coq 8.8) (`#12613
+ <https://github.com/coq/coq/pull/12613>`_, by Gaëtan Gilbert).
+- **Fixed:**
+ ``coqchk`` no longer reports names from inner modules of opaque modules as
+ axioms (`#12862 <https://github.com/coq/coq/pull/12862>`_, fixes `#12845
+ <https://github.com/coq/coq/issues/12845>`_, by Jason Gross).
+
+CoqIDE
+^^^^^^
+
+- **Added:**
+ Support showing diffs for :cmd:`Show Proof` in CoqIDE from the :n:`View` menu.
+ See :ref:`showing_proof_diffs`.
+ (`#12874 <https://github.com/coq/coq/pull/12874>`_,
+ by Jim Fehrle and Enrico Tassi)
+- **Added:**
+ Support for flag :flag:`Printing Goal Names` in View menu
+ (`#13145 <https://github.com/coq/coq/pull/13145>`_,
+ by Hugo Herbelin).
+
+Standard library
+^^^^^^^^^^^^^^^^
+
+- **Changed:**
+ In the reals theory changed the epsilon in the definition of the modulus of convergence for CReal from 1/n (n in positive) to 2^z (z in Z)
+ so that a precision coarser than one is possible. Also added an upper bound to CReal to enable more efficient computations.
+ (`#12186 <https://github.com/coq/coq/pull/12186>`_,
+ by Michael Soegtrop).
+- **Changed:**
+ Int63 notations now match up with the rest of the standard library: :g:`a \%
+ m`, :g:`m == n`, :g:`m < n`, :g:`m <= n`, and :g:`m ≤ n` have been replaced
+ with :g:`a mod m`, :g:`m =? n`, :g:`m <? n`, :g:`m <=? n`, and :g:`m ≤? n`.
+ The old notations are still available as deprecated notations. Additionally,
+ there is now a ``Coq.Numbers.Cyclic.Int63.Int63.Int63Notations`` module that
+ users can import to get the ``Int63`` notations without unqualifying the
+ various primitives (`#12479 <https://github.com/coq/coq/pull/12479>`_, fixes
+ `#12454 <https://github.com/coq/coq/issues/12454>`_, by Jason Gross).
+- **Changed:**
+ PrimFloat notations now match up with the rest of the standard library: :g:`m
+ == n`, :g:`m < n`, and :g:`m <= n` have been replaced with :g:`m =? n`, :g:`m
+ <? n`, and :g:`m <=? n`. The old notations are still available as deprecated
+ notations. Additionally, there is now a
+ ``Coq.Floats.PrimFloat.PrimFloatNotations`` module that users can import to
+ get the ``PrimFloat`` notations without unqualifying the various primitives
+ (`#12556 <https://github.com/coq/coq/pull/12556>`_, fixes `#12454
+ <https://github.com/coq/coq/issues/12454>`_, by Jason Gross).
+- **Changed:** the sort of cyclic numbers from Type to Set.
+ For backward compatibility, a dynamic sort was defined in the 3 packages bignums, coqprime and color.
+ See for example commit 6f62bda in bignums.
+ (`#12801 <https://github.com/coq/coq/pull/12801>`_,
+ by Vincent Semeria).
+- **Changed:**
+ ``Require Import Coq.nsatz.NsatzTactic`` now allows using :tacn:`nsatz`
+ with `Z` and `Q` without having to supply instances or using ``Require Import Coq.nsatz.Nsatz``, which
+ transitively requires unneeded files declaring axioms used in the reals
+ (`#12861 <https://github.com/coq/coq/pull/12861>`_,
+ fixes `#12860 <https://github.com/coq/coq/issues/12860>`_,
+ by Jason Gross).
+- **Deprecated:**
+ ``prod_curry`` and ``prod_uncurry``, in favor of ``uncurry`` and ``curry``
+ (`#12716 <https://github.com/coq/coq/pull/12716>`_,
+ by Yishuai Li).
+- **Added:**
+ New lemmas about ``repeat`` in ``List`` and ``Permutation``: ``repeat_app``, ``repeat_eq_app``, ``repeat_eq_cons``, ``repeat_eq_elt``, ``Forall_eq_repeat``, ``Permutation_repeat``
+ (`#12799 <https://github.com/coq/coq/pull/12799>`_,
+ by Olivier Laurent).
+- **Added:**
+ Extend some list lemmas to both directions: `app_inj_tail_iff`, `app_inv_head_iff`, `app_inv_tail_iff`.
+ (`#12094 <https://github.com/coq/coq/pull/12094>`_,
+ fixes `#12093 <https://github.com/coq/coq/issues/12093>`_,
+ by Edward Wang).
+- **Added:**
+ ``Decidable`` instance for negation
+ (`#12420 <https://github.com/coq/coq/pull/12420>`_,
+ by Yishuai Li).
+- **Fixed:**
+ `Coq.Program.Wf.Fix_F_inv` and `Coq.Program.Wf.Fix_eq` are now axiom-free. They no longer assume proof irrelevance.
+ (`#13365 <https://github.com/coq/coq/pull/13365>`_,
+ by Li-yao Xia).
+
+Infrastructure and dependencies
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+- **Changed:**
+ When compiled with OCaml >= 4.10.0, Coq will use the new best-fit GC
+ policy, which should provide some performance benefits. Coq's policy
+ is optimized for speed, but could increase memory consumption in
+ some cases. You are welcome to tune it using the ``OCAMLRUNPARAM``
+ variable and report back on good settings so we can improve the defaults.
+ (`#13040 <https://github.com/coq/coq/pull/13040>`_,
+ fixes `#11277 <https://github.com/coq/coq/issues/11277>`_,
+ by Emilio Jesus Gallego Arias).
+- **Changed:**
+ Coq now uses the `zarith <https://github.com/ocaml/Zarith>`_
+ library, based on GNU's gmp instead of ``num`` which is
+ deprecated upstream. The custom ``bigint`` module is
+ no longer provided.
+ (`#11742 <https://github.com/coq/coq/pull/11742>`_,
+ `#13007 <https://github.com/coq/coq/pull/13007>`_,
+ by Emilio Jesus Gallego Arias and Vicent Laporte, with help from
+ Frédéric Besson).
+
Version 8.12
------------
@@ -551,7 +1233,7 @@ Flags, options and attributes
``Private`` (`#11665 <https://github.com/coq/coq/pull/11665>`_, by
Théo Zimmermann).
- **Added:**
- The :cmd:`Hint` commands now accept the :attr:`export` locality as
+ The :ref:`Hint <creating_hints>` commands now accept the :attr:`export` locality as
an attribute, allowing to make import-scoped hints
(`#11812 <https://github.com/coq/coq/pull/11812>`_,
by Pierre-Marie Pédrot).
@@ -1336,6 +2018,25 @@ Changes in 8.12.1
fixes `#12332 <https://github.com/coq/coq/issues/12332>`_,
by Théo Zimmermann and Jim Fehrle).
+Changes in 8.12.2
+~~~~~~~~~~~~~~~~~
+
+**Notations**
+
+- **Fixed:**
+ 8.12 regression causing notations mentioning a coercion to be ignored
+ (`#13436 <https://github.com/coq/coq/pull/13436>`_,
+ fixes `#13432 <https://github.com/coq/coq/issues/13432>`_,
+ by Hugo Herbelin).
+
+**Tactics**
+
+- **Fixed:**
+ 8.12 regression: incomplete inference of implicit arguments in :tacn:`exists`
+ (`#13468 <https://github.com/coq/coq/pull/13468>`_,
+ fixes `#13456 <https://github.com/coq/coq/issues/13456>`_,
+ by Hugo Herbelin).
+
Version 8.11
------------
@@ -3170,7 +3871,7 @@ Vernacular Commands
`Inductive list (A : Type) := nil : list | cons : A -> list -> list.`
- New `Set Hint Variables/Constants Opaque/Transparent` commands for setting
globally the opacity flag of variables and constants in hint databases,
- overwriting the opacity set of the hint database.
+ overriding the opacity setting of the hint database.
- Added generic syntax for "attributes", as in:
`#[local] Lemma foo : bar.`
- Added the `Numeral Notation` command for registering decimal numeral
@@ -4045,7 +4746,7 @@ constraints can now be left floating around and be seen by the user
thanks to a new option. The Keyed Unification mode has been improved by
Matthieu Sozeau.
-The typeclass resolution engine and associated proof-search tactic have
+The typeclass resolution engine and associated proof search tactic have
been reimplemented on top of the proof-engine monad, providing better
integration in tactics, and new options have been introduced to control
it, by Matthieu Sozeau with help from Théo Zimmermann.
@@ -5140,7 +5841,7 @@ Program
- Hints costs are now correctly taken into account (potential source of
incompatibilities).
- Documented the Hint Cut command that allows control of the
- proof-search during typeclass resolution (see reference manual).
+ proof search during typeclass resolution (see reference manual).
API
@@ -5776,7 +6477,7 @@ Libraries
comes first. By default, the power function now takes two BigN.
- Creation of Vector, an independent library for lists indexed by their length.
- Vectors' names overwrite lists' one so you should not "Import" the library.
+ Vectors' names override lists' one so you should not "Import" the library.
All old names changed: function names follow the ocaml ones and, for example,
Vcons becomes Vector.cons. You can get [..;..;..]-style notations by importing
Vector.VectorNotations.
@@ -6830,7 +7531,7 @@ Tactics
- Tactic "remember" now supports an "in" clause to remember only selected
occurrences of a term.
-- Tactic "pose proof" supports name overwriting in case of specialization of an
+- Tactic "pose proof" supports name overriding in case of specialization of an
hypothesis.
- Semi-decision tactic "jp" for first-order intuitionistic logic moved to user
diff --git a/doc/sphinx/conf.py b/doc/sphinx/conf.py
index af5d1e3a00..bce88cebde 100755
--- a/doc/sphinx/conf.py
+++ b/doc/sphinx/conf.py
@@ -188,10 +188,8 @@ nitpick_ignore = [ ('token', token) for token in [
'conversion',
'where',
'oriented_rewriter',
- 'hintbases',
'bindings_with_parameters',
- 'destruction_arg',
- 'clause_dft_concl'
+ 'destruction_arg'
]]
# -- Options for HTML output ----------------------------------------------
@@ -222,7 +220,7 @@ html_context = {
("dev", "https://coq.github.io/doc/master/refman/"),
("stable", "https://coq.inria.fr/distrib/current/refman/"),
("v8.13", "https://coq.github.io/doc/v8.13/refman/"),
- ("8.12", "https://coq.inria.fr/distrib/V8.12.1/refman/"),
+ ("8.12", "https://coq.inria.fr/distrib/V8.12.2/refman/"),
("8.11", "https://coq.inria.fr/distrib/V8.11.2/refman/"),
("8.10", "https://coq.inria.fr/distrib/V8.10.2/refman/"),
("8.9", "https://coq.inria.fr/distrib/V8.9.1/refman/"),
diff --git a/doc/sphinx/language/core/assumptions.rst b/doc/sphinx/language/core/assumptions.rst
index e029068630..e86a6f4a67 100644
--- a/doc/sphinx/language/core/assumptions.rst
+++ b/doc/sphinx/language/core/assumptions.rst
@@ -170,7 +170,7 @@ has type :n:`@type`.
Axiom R_S_inv : forall x y, R x y <-> S y x.
.. exn:: @ident already exists.
- :name: @ident already exists. (Axiom)
+ :name: ‘ident’ already exists. (Axiom)
:undocumented:
.. warn:: @ident is declared as a local axiom
diff --git a/doc/sphinx/language/core/coinductive.rst b/doc/sphinx/language/core/coinductive.rst
index 43bbc8b40d..cf46580bdb 100644
--- a/doc/sphinx/language/core/coinductive.rst
+++ b/doc/sphinx/language/core/coinductive.rst
@@ -27,7 +27,8 @@ More information on co-inductive definitions can be found in
This command supports the :attr:`universes(polymorphic)`,
:attr:`universes(template)`, :attr:`universes(cumulative)`,
- :attr:`private(matching)`, and :attr:`using` attributes.
+ :attr:`private(matching)`, :attr:`bypass_check(universes)`,
+ :attr:`bypass_check(positivity)`, and :attr:`using` attributes.
.. example::
diff --git a/doc/sphinx/language/core/definitions.rst b/doc/sphinx/language/core/definitions.rst
index 57771c9036..6da1f90ecb 100644
--- a/doc/sphinx/language/core/definitions.rst
+++ b/doc/sphinx/language/core/definitions.rst
@@ -90,8 +90,9 @@ Section :ref:`typing-rules`.
computation on :n:`@term`.
These commands also support the :attr:`universes(polymorphic)`,
- :attr:`program` (see :ref:`program_definition`),
- :attr:`canonical` and :attr:`using` attributes.
+ :attr:`program` (see :ref:`program_definition`), :attr:`canonical`,
+ :attr:`bypass_check(universes)`, :attr:`bypass_check(guard)`, and
+ :attr:`using` attributes.
If :n:`@term` is omitted, :n:`@type` is required and Coq enters proof editing mode.
This can be used to define a term incrementally, in particular by relying on the :tacn:`refine` tactic.
@@ -108,7 +109,7 @@ Section :ref:`typing-rules`.
.. seealso:: :cmd:`Opaque`, :cmd:`Transparent`, :tacn:`unfold`.
.. exn:: @ident already exists.
- :name: @ident already exists. (Definition)
+ :name: ‘ident’ already exists. (Definition)
:undocumented:
.. exn:: The term @term has type @type while it is expected to have type @type'.
@@ -162,18 +163,20 @@ Chapter :ref:`Tactics`. The basic assertion command is:
correct at some time of the interactive development of a proof, use the
command :cmd:`Guarded`.
- This command accepts the :attr:`using` attribute.
+ This command accepts the :attr:`bypass_check(universes)`,
+ :attr:`bypass_check(guard)`, and :attr:`using` attributes.
.. exn:: The term @term has type @type which should be Set, Prop or Type.
:undocumented:
.. exn:: @ident already exists.
- :name: @ident already exists. (Theorem)
+ :name: ‘ident’ already exists. (Theorem)
The name you provided is already defined. You have then to choose
another name.
- .. exn:: Nested proofs are not allowed unless you turn the Nested Proofs Allowed flag on.
+ .. exn:: Nested proofs are discouraged and not allowed by default. This error probably means that you forgot to close the last "Proof." with "Qed." or "Defined.". \
+ If you really intended to use nested proofs, you can do so by turning the "Nested Proofs Allowed" flag on.
You are asserting a new statement while already being in proof editing mode.
This feature, called nested proofs, is disabled by default.
diff --git a/doc/sphinx/language/core/inductive.rst b/doc/sphinx/language/core/inductive.rst
index 251b5e4955..4bee7cc1b1 100644
--- a/doc/sphinx/language/core/inductive.rst
+++ b/doc/sphinx/language/core/inductive.rst
@@ -8,14 +8,13 @@ Inductive types
.. cmd:: Inductive @inductive_definition {* with @inductive_definition }
- .. insertprodn inductive_definition cumul_ident_decl
+ .. insertprodn inductive_definition constructor
.. prodn::
- inductive_definition ::= {? > } @cumul_ident_decl {* @binder } {? %| {* @binder } } {? : @type } {? := {? @constructors_or_record } } {? @decl_notations }
+ inductive_definition ::= {? > } @ident {? @cumul_univ_decl } {* @binder } {? %| {* @binder } } {? : @type } {? := {? @constructors_or_record } } {? @decl_notations }
constructors_or_record ::= {? %| } {+| @constructor }
| {? @ident } %{ {*; @record_field } {? ; } %}
constructor ::= @ident {* @binder } {? @of_type }
- cumul_ident_decl ::= @ident {? @cumul_univ_decl }
This command defines one or more
inductive types and its constructors. Coq generates destructors
@@ -32,7 +31,8 @@ Inductive types
proposition).
This command supports the :attr:`universes(polymorphic)`,
- :attr:`universes(template)`, :attr:`universes(cumulative)`, and
+ :attr:`universes(template)`, :attr:`universes(cumulative)`,
+ :attr:`bypass_check(positivity)`, :attr:`bypass_check(universes)`, and
:attr:`private(matching)` attributes.
Mutually inductive types can be defined by including multiple :n:`@inductive_definition`\s.
@@ -50,10 +50,12 @@ Inductive types
.. exn:: Non strictly positive occurrence of @ident in @type.
- The types of the constructors have to satisfy a *positivity condition*
- (see Section :ref:`positivity`). This condition ensures the soundness of
- the inductive definition. The positivity checking can be disabled using
- the :flag:`Positivity Checking` flag (see :ref:`controlling-typing-flags`).
+ The types of the constructors have to satisfy a *positivity
+ condition* (see Section :ref:`positivity`). This condition
+ ensures the soundness of the inductive definition.
+ Positivity checking can be disabled using the :flag:`Positivity
+ Checking` flag or the :attr:`bypass_check(positivity)` attribute (see
+ :ref:`controlling-typing-flags`).
.. exn:: The conclusion of @type is not valid; it must be built from @ident.
@@ -391,7 +393,8 @@ constructions.
consequently :n:`forall {* @binder }, @type` and its value is equivalent
to :n:`fun {* @binder } => @term`.
- This command accepts the :attr:`program` attribute.
+ This command accepts the :attr:`program`,
+ :attr:`bypass_check(universes)`, and :attr:`bypass_check(guard)` attributes.
To be accepted, a :cmd:`Fixpoint` definition has to satisfy syntactical
constraints on a special argument called the decreasing argument. They
@@ -849,9 +852,7 @@ between universes for inductive types in the Type hierarchy.
.. coqtop:: none
- Unset Positivity Checking.
- Inductive I : Prop := not_I_I (not_I : I -> False) : I.
- Set Positivity Checking.
+ #[bypass_check(positivity)] Inductive I : Prop := not_I_I (not_I : I -> False) : I.
.. coqtop:: all
@@ -885,9 +886,7 @@ between universes for inductive types in the Type hierarchy.
.. coqtop:: none
- Unset Positivity Checking.
- Inductive Lam := lam (_ : Lam -> Lam).
- Set Positivity Checking.
+ #[bypass_check(positivity)] Inductive Lam := lam (_ : Lam -> Lam).
.. coqtop:: all
@@ -916,9 +915,7 @@ between universes for inductive types in the Type hierarchy.
.. coqtop:: none
- Unset Positivity Checking.
- Inductive A: Type := introA: ((A -> Prop) -> Prop) -> A.
- Set Positivity Checking.
+ #[bypass_check(positivity)] Inductive A: Type := introA: ((A -> Prop) -> Prop) -> A.
.. coqtop:: all
diff --git a/doc/sphinx/language/core/modules.rst b/doc/sphinx/language/core/modules.rst
index 54252689e1..6d96e15202 100644
--- a/doc/sphinx/language/core/modules.rst
+++ b/doc/sphinx/language/core/modules.rst
@@ -155,7 +155,8 @@ are now available through the dot notation.
#. Interactive modules and module types can be nested.
#. Interactive modules and module types can't be defined inside of :ref:`sections<section-mechanism>`.
Sections can be defined inside of interactive modules and module types.
- #. Hints and notations (:cmd:`Hint` and :cmd:`Notation` commands) can also appear inside interactive
+ #. Hints and notations (the :ref:`Hint <creating_hints>` and :cmd:`Notation`
+ commands) can also appear inside interactive
modules and module types. Note that with module definitions like:
:n:`Module @ident__1 : @module_type := @ident__2.`
diff --git a/doc/sphinx/language/core/sections.rst b/doc/sphinx/language/core/sections.rst
index df50dbafe3..75389bb259 100644
--- a/doc/sphinx/language/core/sections.rst
+++ b/doc/sphinx/language/core/sections.rst
@@ -69,7 +69,8 @@ Sections create local contexts which can be shared across multiple definitions.
:undocumented:
.. note::
- Most commands, like :cmd:`Hint`, :cmd:`Notation`, option management, … which
+ Most commands, such as the :ref:`Hint <creating_hints>` commands,
+ :cmd:`Notation` and option management commands that
appear inside a section are canceled when the section is closed.
.. cmd:: Let @ident_decl @def_body
diff --git a/doc/sphinx/language/extensions/arguments-command.rst b/doc/sphinx/language/extensions/arguments-command.rst
index 2460461ede..d178311b4c 100644
--- a/doc/sphinx/language/extensions/arguments-command.rst
+++ b/doc/sphinx/language/extensions/arguments-command.rst
@@ -79,7 +79,7 @@ Setting properties of a function's arguments
`!`
the function will be unfolded only if all the arguments marked with `!`
- evaulate to constructors. See :ref:`Args_effect_on_unfolding`.
+ evaluate to constructors. See :ref:`Args_effect_on_unfolding`.
:n:`@name {? % @scope }`
a *formal parameter* of the function :n:`@reference` (i.e.
@@ -89,11 +89,25 @@ Setting properties of a function's arguments
The construct :n:`@name {? % @scope }` declares :n:`@name` as non-implicit if `clear implicits` is specified or at least one other name is declared implicit in the same list of :n:`@name`\s.
:token:`scope` can be either a scope name or its delimiting key. See :ref:`binding_to_scope`.
+ .. exn:: To rename arguments the 'rename' flag must be specified.
+ :undocumented:
+
+ .. exn:: Flag 'rename' expected to rename @name into @name.
+ :undocumented:
+
`clear implicits`
makes all implicit arguments into explicit arguments
+
+ .. exn:: The 'clear implicits' flag must be omitted if implicit annotations are given.
+ :undocumented:
+
`default implicits`
automatically determine the implicit arguments of the object.
See :ref:`auto_decl_implicit_args`.
+
+ .. exn:: The 'default implicits' flag is incompatible with implicit annotations.
+ :undocumented:
+
`rename`
rename implicit arguments for the object. See the example :ref:`here <renaming_implicit_arguments>`.
`assert`
diff --git a/doc/sphinx/language/extensions/canonical.rst b/doc/sphinx/language/extensions/canonical.rst
index f7ce7f1c6c..aa754ab63d 100644
--- a/doc/sphinx/language/extensions/canonical.rst
+++ b/doc/sphinx/language/extensions/canonical.rst
@@ -490,10 +490,10 @@ We need some infrastructure for that.
Definition id {T} {t : T} (x : phantom t) := x.
Notation "[find v | t1 ~ t2 ] p" := (fun v (_ : unify t1 t2 None) => p)
- (at level 50, v ident, only parsing).
+ (at level 50, v name, only parsing).
Notation "[find v | t1 ~ t2 | s ] p" := (fun v (_ : unify t1 t2 (Some s)) => p)
- (at level 50, v ident, only parsing).
+ (at level 50, v name, only parsing).
Notation "'Error : t : s" := (unify _ t (Some s))
(at level 50, format "''Error' : t : s").
diff --git a/doc/sphinx/proof-engine/ltac.rst b/doc/sphinx/proof-engine/ltac.rst
index 6464f085b8..87a367fc93 100644
--- a/doc/sphinx/proof-engine/ltac.rst
+++ b/doc/sphinx/proof-engine/ltac.rst
@@ -480,15 +480,15 @@ separately. They succeed only if there is a success for each goal. For example
Do loop
~~~~~~~
-.. tacn:: do @int_or_var @ltac_expr3
+.. tacn:: do @nat_or_var @ltac_expr3
:name: do
- The do loop repeats a tactic :token:`int_or_var` times:
+ The do loop repeats a tactic :token:`nat_or_var` times:
- :n:`@ltac_expr` is evaluated to ``v`` which must be a tactic value. This tactic
- value ``v`` is applied :token:`int_or_var` times. Supposing :token:`int_or_var` > 1, after the
+ :n:`@ltac_expr` is evaluated to ``v``, which must be a tactic value. This tactic
+ value ``v`` is applied :token:`nat_or_var` times. If :token:`nat_or_var` > 1, after the
first application of ``v``, ``v`` is applied, at least once, to the generated
- subgoals and so on. It fails if the application of ``v`` fails before :token:`int_or_var`
+ subgoals and so on. It fails if the application of ``v`` fails before :token:`nat_or_var`
applications have been completed.
:tacn:`do` is an :token:`l3_tactic`.
@@ -973,11 +973,11 @@ Timeout
We can force a tactic to stop if it has not finished after a certain
amount of time:
-.. tacn:: timeout @int_or_var @ltac_expr3
+.. tacn:: timeout @nat_or_var @ltac_expr3
:name: timeout
:n:`@ltac_expr3` is evaluated to ``v`` which must be a tactic value. The tactic value
- ``v`` is applied normally, except that it is interrupted after :n:`@natural` seconds
+ ``v`` is applied normally, except that it is interrupted after :n:`@nat_or_var` seconds
if it is still running. In this case the outcome is a failure.
:tacn:`timeout` is an :token:`l3_tactic`.
@@ -1637,9 +1637,10 @@ Testing boolean expressions: guard
.. tacn:: guard @int_or_var @comparison @int_or_var
:name: guard
- .. insertprodn comparison comparison
+ .. insertprodn int_or_var comparison
.. prodn::
+ int_or_var ::= {| @integer | @ident }
comparison ::= =
| <
| <=
@@ -1761,7 +1762,7 @@ Defining |Ltac| symbols
"Ltac intros := idtac" seems like it redefines/hides an
existing tactic, but in fact it creates a tactic which can
only be called by its qualified name. This is true in
- general of tactic notations. The only way to overwrite most
+ general of tactic notations. The only way to override most
primitive tactics, and any user-defined tactic notation, is
with another tactic notation.
diff --git a/doc/sphinx/proof-engine/ltac2.rst b/doc/sphinx/proof-engine/ltac2.rst
index a46f4fb894..375129c02d 100644
--- a/doc/sphinx/proof-engine/ltac2.rst
+++ b/doc/sphinx/proof-engine/ltac2.rst
@@ -1475,7 +1475,7 @@ Other nonterminals that have syntactic classes are listed here.
* - :n:`clause`
- :token:`ltac2_clause`
- - :token:`clause_dft_concl`
+ - :token:`occurrences`
* - :n:`occurrences`
- :token:`q_occurrences`
diff --git a/doc/sphinx/proof-engine/tactics.rst b/doc/sphinx/proof-engine/tactics.rst
index 26a56005c1..d8c4fb61c2 100644
--- a/doc/sphinx/proof-engine/tactics.rst
+++ b/doc/sphinx/proof-engine/tactics.rst
@@ -264,17 +264,6 @@ These patterns can be used when the hypothesis is an equality:
:n:`@simple_intropattern_closed`.
:ref:`Example <intropattern_injection_ex>`
-.. flag:: Bracketing Last Introduction Pattern
-
- For :n:`intros @intropattern_list`, controls how to handle a
- conjunctive pattern that doesn't give enough simple patterns to match
- all the arguments in the constructor. If set (the default), Coq generates
- additional names to match the number of arguments.
- Unsetting the flag will put the additional hypotheses in the goal instead, behavior that is more
- similar to |SSR|'s intro patterns.
-
- .. deprecated:: 8.10
-
.. _intropattern_cons_note:
.. note::
@@ -466,52 +455,82 @@ Examples:
.. _occurrencessets:
-Occurrence sets and occurrence clauses
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Occurrence clauses
+~~~~~~~~~~~~~~~~~~
-An occurrence clause is a modifier to some tactics that obeys the
-following syntax:
+An :gdef:`occurrence` is a subterm of a goal or hypothesis that
+matches a pattern provided by a tactic. Occurrence clauses
+select a subset of the ocurrences in a goal and/or in
+one or more of its hypotheses.
- .. prodn::
- occurrence_clause ::= in @goal_occurrences
- goal_occurrences ::= {*, @ident {? @at_occurrences } } {? |- {? * {? @at_occurrences } } }
- | * |- {? * {? @at_occurrences } }
- | *
- at_occurrences ::= at @occurrences
- occurrences ::= {? - } {* @natural }
-
-The role of an occurrence clause is to select a set of occurrences of a term
-in a goal. In the first case, the :n:`@ident {? at {* num}}` parts indicate
-that occurrences have to be selected in the hypotheses named :token:`ident`.
-If no numbers are given for hypothesis :token:`ident`, then all the
-occurrences of :token:`term` in the hypothesis are selected. If numbers are
-given, they refer to occurrences of :token:`term` when the term is printed
-using the :flag:`Printing All` flag, counting from left to right. In particular,
-occurrences of :token:`term` in implicit arguments
-(see :ref:`ImplicitArguments`) or coercions (see :ref:`Coercions`) are
-counted.
-
-If a minus sign is given between ``at`` and the list of occurrences, it
-negates the condition so that the clause denotes all the occurrences
-except the ones explicitly mentioned after the minus sign.
-
-As an exception to the left-to-right order, the occurrences in
-the return subexpression of a match are considered *before* the
-occurrences in the matched term.
-
-In the second case, the ``*`` on the left of ``|-`` means that all occurrences
-of term are selected in every hypothesis.
-
-In the first and second case, if ``*`` is mentioned on the right of ``|-``, the
-occurrences of the conclusion of the goal have to be selected. If some numbers
-are given, then only the occurrences denoted by these numbers are selected. If
-no numbers are given, all occurrences of :token:`term` in the goal are selected.
-
-Finally, the last notation is an abbreviation for ``* |- *``. Note also
-that ``|-`` is optional in the first case when no ``*`` is given.
-
-Here are some tactics that understand occurrence clauses: :tacn:`set`,
-:tacn:`remember`, :tacn:`induction`, :tacn:`destruct`.
+ .. insertprodn occurrences concl_occs
+
+ .. prodn::
+ occurrences ::= at @occs_nums
+ | in @goal_occurrences
+ occs_nums ::= {? - } {+ @nat_or_var }
+ nat_or_var ::= {| @natural | @ident }
+ goal_occurrences ::= {+, @hyp_occs } {? %|- {? @concl_occs } }
+ | * %|- {? @concl_occs }
+ | %|- {? @concl_occs }
+ | {? @concl_occs }
+ hyp_occs ::= @hypident {? at @occs_nums }
+ hypident ::= @ident
+ | ( type of @ident )
+ | ( value of @ident )
+ concl_occs ::= * {? at @occs_nums }
+
+ :n:`@occurrences`
+ The first form of :token:`occurrences` selects occurrences in
+ the conclusion of the goal. The second form can select occurrences
+ in the goal conclusion and in one or more hypotheses.
+
+ :n:`{? - } {+ @nat_or_var }`
+ Selects the specified occurrences within a single goal or hypothesis.
+ Occurrences are numbered from left to right starting with 1 when the
+ goal is printed with the :flag:`Printing All` flag. (In particular, occurrences
+ in :ref:`implicit arguments <ImplicitArguments>` and
+ :ref:`coercions <Coercions>` are counted but not shown by default.)
+
+ Specifying `-` includes all occurrences *except* the ones listed.
+
+ :n:`{*, @hyp_occs } {? %|- {? @concl_occs } }`
+ Selects occurrences in the specified hypotheses and the
+ specified occurrences in the conclusion.
+
+ :n:`* %|- {? @concl_occs }`
+ Selects all occurrences in all hypotheses and the
+ specified occurrences in the conclusion.
+
+ :n:`%|- {? @concl_occs }`
+ Selects the specified occurrences in the conclusion.
+
+ :n:`@goal_occurrences ::= {? @concl_occs }`
+ Selects all occurrences in all hypotheses and in the specified occurrences
+ in the conclusion.
+
+ :n:`@hypident {? at @occs_nums }`
+ Omiting :token:`occs_nums` selects all occurrences within the hypothesis.
+
+ :n:`@hypident ::= @ident`
+ Selects the hypothesis named :token:`ident`.
+
+ :n:`( type of @ident )`
+ Selects the type part of the named hypothesis (e.g. `: nat`).
+
+ :n:`( value of @ident )`
+ Selects the value part of the named hypothesis (e.g. `:= 1`).
+
+ :n:`@concl_occs ::= * {? at @occs_nums }`
+ Selects occurrences in the conclusion. '*' by itself selects all occurrences.
+ :n:`@occs_nums` selects the specified occurrences.
+
+ Use `in *` to select all occurrences in all hypotheses and the conclusion,
+ which is equivalent to `in * |- *`. Use `* |-` to select all occurrences
+ in all hypotheses.
+
+Tactics that use occurrence clauses include :tacn:`set`,
+:tacn:`remember`, :tacn:`induction` and :tacn:`destruct`.
.. seealso::
@@ -878,38 +897,38 @@ Applying theorems
This happens if the conclusion of :token:`ident` does not match any of
the non-dependent premises of the type of :token:`term`.
- .. tacv:: apply {+, @term} in @ident
+ .. tacv:: apply {+, @term} in {+, @ident}
- This applies each :token:`term` in sequence in :token:`ident`.
+ This applies each :token:`term` in sequence in each hypothesis :token:`ident`.
- .. tacv:: apply {+, @term with @bindings} in @ident
+ .. tacv:: apply {+, @term with @bindings} in {+, @ident}
- This does the same but uses the bindings in each :n:`(@ident := @term)` to
- instantiate the parameters of the corresponding type of :token:`term`
- (see :ref:`bindings`).
+ This does the same but uses the bindings to instantiate
+ parameters of :token:`term` (see :ref:`bindings`).
- .. tacv:: eapply {+, @term {? with @bindings } } in @ident
+ .. tacv:: eapply {+, @term {? with @bindings } } in {+, @ident}
This works as :tacn:`apply … in` but turns unresolved bindings into
existential variables, if any, instead of failing.
- .. tacv:: apply {+, @term {? with @bindings } } in @ident as @simple_intropattern
+ .. tacv:: apply {+, @term {? with @bindings } } in {+, @ident {? as @simple_intropattern}}
:name: apply … in … as
- This works as :tacn:`apply … in` then applies the :token:`simple_intropattern`
- to the hypothesis :token:`ident`.
+ This works as :tacn:`apply … in` but applying an associated
+ :token:`simple_intropattern` to each hypothesis :token:`ident`
+ that comes with such clause.
- .. tacv:: simple apply @term in @ident
+ .. tacv:: simple apply @term in {+, @ident}
This behaves like :tacn:`apply … in` but it reasons modulo conversion
only on subterms that contain no variables to instantiate and does not
traverse tuples. See :ref:`the corresponding example <simple_apply_ex>`.
- .. tacv:: {? simple} apply {+, @term {? with @bindings}} in @ident {? as @simple_intropattern}
- {? simple} eapply {+, @term {? with @bindings}} in @ident {? as @simple_intropattern}
+ .. tacv:: {? simple} apply {+, @term {? with @bindings}} in {+, @ident {? as @simple_intropattern}}
+ {? simple} eapply {+, @term {? with @bindings}} in {+, @ident {? as @simple_intropattern}}
- This summarizes the different syntactic variants of :n:`apply @term in @ident`
- and :n:`eapply @term in @ident`.
+ This summarizes the different syntactic variants of :n:`apply @term in {+, @ident}`
+ and :n:`eapply @term in {+, @ident}`.
.. tacn:: constructor @natural
:name: constructor
diff --git a/doc/sphinx/proof-engine/vernacular-commands.rst b/doc/sphinx/proof-engine/vernacular-commands.rst
index 86d1d25745..e866e4c624 100644
--- a/doc/sphinx/proof-engine/vernacular-commands.rst
+++ b/doc/sphinx/proof-engine/vernacular-commands.rst
@@ -1136,7 +1136,7 @@ Controlling the locality of commands
Some commands support an :attr:`export` attribute. The effect of
the attribute is to make the effect of the command available when
the module containing it is imported. It is supported in
- particular by the :cmd:`Hint`, :cmd:`Set` and :cmd:`Unset`
+ particular by the :ref:`Hint <creating_hints>`, :cmd:`Set` and :cmd:`Unset`
commands.
.. _controlling-typing-flags:
@@ -1152,6 +1152,12 @@ Controlling Typing Flags
anymore but it still affects the reduction of the term. Unchecked fixpoints are
printed by :cmd:`Print Assumptions`.
+.. attr:: bypass_check(guard{? = {| yes | no } })
+ :name: bypass_check(guard)
+
+ Similar to :flag:`Guard Checking`, but on a per-declaration
+ basis. Disable guard checking locally with ``bypass_check(guard)``.
+
.. flag:: Positivity Checking
This flag can be used to enable/disable the positivity checking of inductive
@@ -1159,6 +1165,12 @@ Controlling Typing Flags
break the consistency of the system, use at your own risk. Unchecked
(co)inductive types are printed by :cmd:`Print Assumptions`.
+.. attr:: bypass_check(positivity{? = {| yes | no } })
+ :name: bypass_check(positivity)
+
+ Similar to :flag:`Positivity Checking`, but on a per-declaration basis.
+ Disable positivity checking locally with ``bypass_check(positivity)``.
+
.. flag:: Universe Checking
This flag can be used to enable/disable the checking of universes, providing a
@@ -1167,6 +1179,12 @@ Controlling Typing Flags
:cmd:`Print Assumptions`. It has the same effect as `-type-in-type` command line
argument (see :ref:`command-line-options`).
+.. attr:: bypass_check(universes{? = {| yes | no } })
+ :name: bypass_check(universes)
+
+ Similar to :flag:`Universe Checking`, but on a per-declaration basis.
+ Disable universe checking locally with ``bypass_check(universes)``.
+
.. cmd:: Print Typing Flags
Print the status of the three typing flags: guard checking, positivity checking
diff --git a/doc/sphinx/proofs/automatic-tactics/auto.rst b/doc/sphinx/proofs/automatic-tactics/auto.rst
index cc4ab76502..472df2bd91 100644
--- a/doc/sphinx/proofs/automatic-tactics/auto.rst
+++ b/doc/sphinx/proofs/automatic-tactics/auto.rst
@@ -4,104 +4,87 @@
Programmable proof search
=========================
-.. tacn:: auto
- :name: auto
+.. tacn:: auto {? @nat_or_var } {? @auto_using } {? @hintbases }
- This tactic implements a Prolog-like resolution procedure to solve the
+ .. insertprodn auto_using hintbases
+
+ .. prodn::
+ auto_using ::= using {+, @one_term }
+ hintbases ::= with *
+ | with {+ @ident }
+
+ Implements a Prolog-like resolution procedure to solve the
current goal. It first tries to solve the goal using the :tacn:`assumption`
tactic, then it reduces the goal to an atomic one using :tacn:`intros` and
introduces the newly generated hypotheses as hints. Then it looks at
- the list of tactics associated to the head symbol of the goal and
- tries to apply one of them (starting from the tactics with lower
- cost). This process is recursively applied to the generated subgoals.
+ the list of tactics associated with the head symbol of the goal and
+ tries to apply one of them. Lower cost tactics are tried before higher-cost
+ tactics. This process is recursively applied to the generated subgoals.
- By default, :tacn:`auto` only uses the hypotheses of the current goal and
- the hints of the database named ``core``.
+ :n:`@nat_or_var`
+ Specifies the maximum search depth. The default is 5.
- .. warning::
+ :n:`using {+, @one_term }`
- :tacn:`auto` uses a weaker version of :tacn:`apply` that is closer to
- :tacn:`simple apply` so it is expected that sometimes :tacn:`auto` will
- fail even if applying manually one of the hints would succeed.
+ Uses lemmas :n:`{+, @one_term }` in addition to hints. If :n:`@one_term` is an
+ inductive type, the collection of its constructors are added as hints.
- .. tacv:: auto @natural
+ Note that hints passed through the `using` clause are used in the same
+ way as if they were passed through a hint database. Consequently,
+ they use a weaker version of :tacn:`apply` and :n:`auto using @one_term`
+ may fail where :n:`apply @one_term` succeeds.
- Forces the search depth to be :token:`natural`. The maximal search depth
- is 5 by default.
+ .. todo
+ Given that this can be seen as counter-intuitive, it could be useful
+ to have an option to use full-blown :tacn:`apply` for lemmas passed
+ through the `using` clause. Contributions welcome!
- .. tacv:: auto with {+ @ident}
+ :n:`with *`
+ Use all existing hint databases. Using this variant is highly discouraged
+ in finished scripts since it is both slower and less robust than explicitly
+ selecting the required databases.
- Uses the hint databases :n:`{+ @ident}` in addition to the database ``core``.
+ :n:`with {+ @ident }`
+ Use the hint databases :n:`{+ @ident}` in addition to the database ``core``.
+ Use the fake database `nocore` to omit `core`.
- .. note::
+ If no `with` clause is given, :tacn:`auto` only uses the hypotheses of the
+ current goal and the hints of the database named ``core``.
- Use the fake database `nocore` if you want to *not* use the `core`
- database.
+ :tacn:`auto` generally either completely solves the goal or
+ leaves it unchanged. Use :tacn:`solve` `[ auto ]` if you want a failure
+ when they don't solve the goal. :tacn:`auto` will fail if :tacn:`fail`
+ or :tacn:`gfail` are invoked directly or indirectly, in which case setting
+ the :flag:`Ltac Debug` may help you debug the failure.
- .. tacv:: auto with *
+ .. warning::
- Uses all existing hint databases. Using this variant is highly discouraged
- in finished scripts since it is both slower and less robust than the variant
- where the required databases are explicitly listed.
+ :tacn:`auto` uses a weaker version of :tacn:`apply` that is closer to
+ :tacn:`simple apply` so it is expected that sometimes :tacn:`auto` will
+ fail even if applying manually one of the hints would succeed.
.. seealso::
- :ref:`The Hints Databases for auto and eauto <thehintsdatabasesforautoandeauto>` for the list of
+ :ref:`thehintsdatabasesforautoandeauto` for the list of
pre-defined databases and the way to create or extend a database.
- .. tacv:: auto using {+ @qualid__i} {? with {+ @ident } }
-
- Uses lemmas :n:`@qualid__i` in addition to hints. If :n:`@qualid` is an
- inductive type, it is the collection of its constructors which are added
- as hints.
-
- .. note::
-
- The hints passed through the `using` clause are used in the same
- way as if they were passed through a hint database. Consequently,
- they use a weaker version of :tacn:`apply` and :n:`auto using @qualid`
- may fail where :n:`apply @qualid` succeeds.
-
- Given that this can be seen as counter-intuitive, it could be useful
- to have an option to use full-blown :tacn:`apply` for lemmas passed
- through the `using` clause. Contributions welcome!
-
- .. tacv:: info_auto
+ .. tacn:: info_auto {? @nat_or_var } {? @auto_using } {? @hintbases }
Behaves like :tacn:`auto` but shows the tactics it uses to solve the goal. This
variant is very useful for getting a better understanding of automation, or
to know what lemmas/assumptions were used.
- .. tacv:: debug auto
- :name: debug auto
+ .. tacn:: debug auto {? @nat_or_var } {? @auto_using } {? @hintbases }
Behaves like :tacn:`auto` but shows the tactics it tries to solve the goal,
including failing paths.
- .. tacv:: {? info_}auto {? @natural} {? using {+ @qualid}} {? with {+ @ident}}
-
- This is the most general form, combining the various options.
-
-.. tacv:: trivial
- :name: trivial
-
- This tactic is a restriction of :tacn:`auto` that is not recursive
- and tries only hints that cost `0`. Typically it solves trivial
- equalities like :g:`X=X`.
-
- .. tacv:: trivial with {+ @ident}
- trivial with *
- trivial using {+ @qualid}
- debug trivial
- info_trivial
- {? info_}trivial {? using {+ @qualid}} {? with {+ @ident}}
- :name: _; _; _; debug trivial; info_trivial; _
- :undocumented:
+.. tacn:: trivial {? @auto_using } {? @hintbases }
+ debug trivial {? @auto_using } {? @hintbases }
+ info_trivial {? @auto_using } {? @hintbases }
-.. note::
- :tacn:`auto` and :tacn:`trivial` either solve completely the goal or
- else succeed without changing the goal. Use :g:`solve [ auto ]` and
- :g:`solve [ trivial ]` if you would prefer these tactics to fail when
- they do not manage to solve the goal.
+ Like :tacn:`auto`, but is not recursive
+ and only tries hints with zero cost. Typically used to solve goals
+ for which a lemma is already available in the specified :n:`hintbases`.
.. flag:: Info Auto
Debug Auto
@@ -111,10 +94,9 @@ Programmable proof search
These flags enable printing of informative or debug information for
the :tacn:`auto` and :tacn:`trivial` tactics.
-.. tacn:: eauto
- :name: eauto
+.. tacn:: eauto {? @nat_or_var } {? @auto_using } {? @hintbases }
- This tactic generalizes :tacn:`auto`. While :tacn:`auto` does not try
+ Generalizes :tacn:`auto`. While :tacn:`auto` does not try
resolution hints which would leave existential variables in the goal,
:tacn:`eauto` does try them (informally speaking, it internally uses a tactic
close to :tacn:`simple eapply` instead of a tactic close to :tacn:`simple apply`
@@ -133,12 +115,13 @@ Programmable proof search
Goal forall P:nat -> Prop, P 0 -> exists n, P n.
eauto.
- Note that ``ex_intro`` should be declared as a hint.
+ `ex_intro` is declared as a hint so the proof succeeds.
+ .. seealso:: :ref:`thehintsdatabasesforautoandeauto`
- .. tacv:: {? info_}eauto {? @natural} {? using {+ @qualid}} {? with {+ @ident}}
+ .. tacn:: info_eauto {? @nat_or_var } {? @auto_using } {? @hintbases }
- The various options for :tacn:`eauto` are the same as for :tacn:`auto`.
+ The various options for :tacn:`info_eauto` are the same as for :tacn:`info_auto`.
:tacn:`eauto` also obeys the following flags:
@@ -146,34 +129,55 @@ Programmable proof search
Debug Eauto
:undocumented:
- .. seealso:: :ref:`The Hints Databases for auto and eauto <thehintsdatabasesforautoandeauto>`
+ .. tacn:: debug eauto {? @nat_or_var } {? @auto_using } {? @hintbases }
+ Behaves like :tacn:`eauto` but shows the tactics it tries to solve the goal,
+ including failing paths.
+
+ .. tacn:: bfs eauto {? @nat_or_var } {? @auto_using } {? @hintbases }
+
+ Like :tacn:`eauto`, but uses a
+ `breadth-first search <https://en.wikipedia.org/wiki/Breadth-first_search>`_.
-.. tacn:: autounfold with {+ @ident}
- :name: autounfold
+.. tacn:: autounfold {? @hintbases } {? @occurrences }
- This tactic unfolds constants that were declared through a :cmd:`Hint Unfold`
+ Unfolds constants that were declared through a :cmd:`Hint Unfold`
in the given databases.
-.. tacv:: autounfold with {+ @ident} in @goal_occurrences
+ :n:`@occurrences`
+ Performs the unfolding in the specified occurrences. The :n:`at @occs_nums`
+ clause of :n:`@occurrences` is not supported.
+
+.. tacn:: autorewrite {? * } with {+ @ident } {? @occurrences } {? using @ltac_expr }
+
+ `*`
+ If present, rewrite all occurrences whose side conditions are solved.
- Performs the unfolding in the given clause (:token:`goal_occurrences`).
+ .. todo: This may not always work as described, see #4976 #7672 and
+ https://github.com/coq/coq/issues/1933#issuecomment-337497938 as
+ mentioned here: https://github.com/coq/coq/pull/13343#discussion_r527801604
-.. tacv:: autounfold with *
+ :n:`with {+ @ident }`
+ Specifies the rewriting rule bases to use.
- Uses the unfold hints declared in all the hint databases.
+ :n:`@occurrences`
+ Performs rewriting in the specified occurrences. Note: the `at` clause
+ is currently not supported.
-.. tacn:: autorewrite with {+ @ident}
- :name: autorewrite
+ .. exn:: The "at" syntax isn't available yet for the autorewrite tactic.
- This tactic carries out rewritings according to the rewriting rule
- bases :n:`{+ @ident}`.
+ Appears when there is an `at` clause on the conclusion.
- Each rewriting rule from the base :n:`@ident` is applied to the main subgoal until
+ :n:`using @ltac_expr`
+ :token:`ltac_expr` is applied to the main subgoal after each rewriting step.
+
+ Applies rewritings according to the rewriting rule bases :n:`{+ @ident }`.
+
+ For each rule base, applies each rewriting to the main subgoal until
it fails. Once all the rules have been processed, if the main subgoal has
- progressed (e.g., if it is distinct from the initial main goal) then the rules
- of this base are processed again. If the main subgoal has not progressed then
- the next base is processed. For the bases, the behavior is exactly similar to
+ changed then the rules
+ of this base are processed again. If the main subgoal has not changed then
+ the next base is processed. For the bases, the behavior is very similar to
the processing of the rewriting rules.
The rewriting rule bases are built with the :cmd:`Hint Rewrite`
@@ -183,31 +187,13 @@ Programmable proof search
This tactic may loop if you build non terminating rewriting systems.
-.. tacv:: autorewrite with {+ @ident} using @tactic
-
- Performs, in the same way, all the rewritings of the bases :n:`{+ @ident}`
- applying tactic to the main subgoal after each rewriting step.
-
-.. tacv:: autorewrite with {+ @ident} in @qualid
-
- Performs all the rewritings in hypothesis :n:`@qualid`.
-
-.. tacv:: autorewrite with {+ @ident} in @qualid using @tactic
-
- Performs all the rewritings in hypothesis :n:`@qualid` applying :n:`@tactic`
- to the main subgoal after each rewriting step.
-
-.. tacv:: autorewrite with {+ @ident} in @goal_occurrences
-
- Performs all the rewriting in the clause :n:`@goal_occurrences`.
-
.. seealso::
- :ref:`Hint-Rewrite <hintrewrite>` for feeding the database of lemmas used by
+ :cmd:`Hint Rewrite` for feeding the database of lemmas used by
:tacn:`autorewrite` and :tacn:`autorewrite` for examples showing the use of this tactic.
+ Also see :ref:`strategies4rewriting`.
.. tacn:: easy
- :name: easy
This tactic tries to solve the current goal by a number of standard closing steps.
In particular, it tries to close the current goal using the closing tactics
@@ -220,45 +206,43 @@ Programmable proof search
This tactic solves goals that belong to many common classes; in particular, many cases of
unsatisfiable hypotheses, and simple equality goals are usually solved by this tactic.
-.. tacv:: now @tactic
- :name: now
+.. tacn:: now @ltac_expr
Run :n:`@tactic` followed by :tacn:`easy`. This is a notation for :n:`@tactic; easy`.
-Controlling automation
---------------------------
-
.. _thehintsdatabasesforautoandeauto:
The hints databases for auto and eauto
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+--------------------------------------
The hints for :tacn:`auto` and :tacn:`eauto` are stored in databases. Each database
-maps head symbols to a list of hints.
-
-.. cmd:: Print Hint @ident
+maps head symbols to a list of hints. Use the :cmd:`Print Hint` command to view
+the database.
- Use this command
- to display the hints associated to the head symbol :n:`@ident`
- (see :ref:`Print Hint <printhint>`). Each hint has a cost that is a nonnegative
- integer, and an optional pattern. The hints with lower cost are tried first. A
- hint is tried by :tacn:`auto` when the conclusion of the current goal matches its
- pattern or when it has no pattern.
+Each hint has a cost that is a nonnegative
+integer and an optional pattern. Hints with lower costs are tried first.
+:tacn:`auto` tries a hint when the conclusion of the current goal matches its
+pattern or when the hint has no pattern.
Creating Hint databases
-```````````````````````
+-----------------------
-One can optionally declare a hint database using the command
-:cmd:`Create HintDb`. If a hint is added to an unknown database, it will be
-automatically created.
+Hint databases can be created with the :cmd:`Create HintDb` command or implicitly
+by adding a hint to an unknown database. We recommend you always use :cmd:`Create HintDb`
+and then imediately use :cmd:`Hint Constants` and :cmd:`Hint Variables` to make
+those settings explicit.
-.. cmd:: Create HintDb @ident {? discriminated}
+Note that the default transparency
+settings differ between these two methods of creation. Databases created with
+:cmd:`Create HintDb` have the default setting `Transparent` for both `Variables`
+and `Constants`, while implicitly created databases have the `Opaque` setting.
- This command creates a new database named :n:`@ident`. The database is
+.. cmd:: Create HintDb @ident {? discriminated }
+
+ Creates a new hint database named :n:`@ident`. The database is
implemented by a Discrimination Tree (DT) that serves as an index of
all the lemmas. The DT can use transparency information to decide if a
constant should be indexed or not
- (c.f. :ref:`The hints databases for auto and eauto <thehintsdatabasesforautoandeauto>`),
making the retrieval more efficient. The legacy implementation (the default one
for new databases) uses the DT only on goals without existentials (i.e., :tacn:`auto`
goals), for non-Immediate hints and does not make use of transparency
@@ -270,149 +254,144 @@ automatically created.
from the order in which they were inserted, making this implementation
observationally different from the legacy one.
-.. cmd:: Hint @hint_definition : {+ @ident}
+.. _creating_hints:
+
+Creating Hints
+--------------
- The general command to add a hint to some databases :n:`{+ @ident}`.
+ The various `Hint` commands share these elements:
- This command supports the :attr:`local`, :attr:`global` and :attr:`export`
- locality attributes. When no locality is explictly given, the
- command is :attr:`local` inside a section and :attr:`global` otherwise.
+ :n:`{? : {+ @ident } }` specifies the hint database(s) to add to.
+ *(Deprecated since version 8.10:* If no :token:`ident`\s
+ are given, the hint is added to the `core` database.)
+
+ Outside of sections, these commands support the :attr:`local`, :attr:`export`
+ and :attr:`global` attributes. :attr:`global` is the default. Inside sections,
+ only the :attr:`local` attribute is supported because hints are local to sections.
+ :attr:`local` hints are never visible from other modules, even if they
- require or import the current module. Inside a section, the :attr:`local`
- attribute is useless since hints do not survive anyway to the closure of
- sections.
+ :cmd:`Import` or :cmd:`Require` the current module.
- + :attr:`export` are visible from other modules when they import the current
- module. Requiring it is not enough.
+ + :attr:`export` hints are visible from other modules when they :cmd:`Import` the current
+ module, but not when they only :cmd:`Require` it. This attribute is supported by
+ all `Hint` commands except for :cmd:`Hint Rewrite`.
- + :attr:`global` hints are made available by merely requiring the current
- module.
+ + :attr:`global` hints are visible from other modules when they :cmd:`Import` or
+ :cmd:`Require` the current module.
.. deprecated:: 8.13
- The default value for hint locality is scheduled to change in a future
+ The default value for hint locality will change in a future
release. For the time being, adding hints outside of sections without
- specifying an explicit locality is therefore triggering a deprecation
- warning. It is recommended to use :attr:`export` whenever possible
-
- The various possible :production:`hint_definition`\s are given below.
-
- .. cmdv:: Hint @hint_definition
+ specifying an explicit locality will trigger a deprecation
+ warning. We recommend you use :attr:`export` whenever possible.
- No database name is given: the hint is registered in the ``core`` database.
+ The `Hint` commands are:
- .. deprecated:: 8.10
+ .. cmd:: Hint Resolve {+ {| @qualid | @one_term } } {? @hint_info } {? : {+ @ident } }
+ Hint Resolve {| -> | <- } {+ @qualid } {? @natural } {? : {+ @ident } }
+ :name: Hint Resolve; _
- .. cmdv:: Hint Resolve @qualid {? | {? @natural} {? @pattern}} : @ident
- :name: Hint Resolve
+ .. insertprodn hint_info one_pattern
- This command adds :n:`simple apply @qualid` to the hint list with the head
- symbol of the type of :n:`@qualid`. The cost of that hint is the number of
- subgoals generated by :n:`simple apply @qualid` or :n:`@natural` if specified. The
- associated :n:`@pattern` is inferred from the conclusion of the type of
- :n:`@qualid` or the given :n:`@pattern` if specified. In case the inferred type
- of :n:`@qualid` does not start with a product the tactic added in the hint list
- is :n:`exact @qualid`. In case this type can however be reduced to a type
- starting with a product, the tactic :n:`simple apply @qualid` is also stored in
- the hints list. If the inferred type of :n:`@qualid` contains a dependent
- quantification on a variable which occurs only in the premisses of the type
+ .. prodn::
+ hint_info ::= %| {? @natural } {? @one_pattern }
+ one_pattern ::= @one_term
+
+ The first form adds each :n:`@qualid` as a hint with the head symbol of the type of
+ :n:`@qualid` to the specified hint databases (:n:`@ident`\s). The cost of the hint is the number of
+ subgoals generated by :tacn:`simple apply` :n:`@qualid` or, if specified, :n:`@natural`. The
+ associated pattern is inferred from the conclusion of the type of
+ :n:`@qualid` or, if specified, the given :n:`@one_pattern`.
+
+ If the inferred type
+ of :n:`@qualid` does not start with a product, :tacn:`exact` :n:`@qualid` is added
+ to the hint list. If the type can be reduced to a type starting with a product,
+ :tacn:`simple apply` :n:`@qualid` is also added to the hints list.
+
+ If the inferred type of :n:`@qualid` contains a dependent
+ quantification on a variable which occurs only in the premises of the type
and not in its conclusion, no instance could be inferred for the variable by
- unification with the goal. In this case, the hint is added to the hint list
- of :tacn:`eauto` instead of the hint list of auto and a warning is printed. A
- typical example of a hint that is used only by :tacn:`eauto` is a transitivity
+ unification with the goal. In this case, the hint is only used by
+ :tacn:`eauto` / :tacn:`typeclasses eauto`, but not by :tacn:`auto`. A
+ typical hint that would only be used by :tacn:`eauto` is a transitivity
lemma.
- .. exn:: @qualid cannot be used as a hint
-
- The head symbol of the type of :n:`@qualid` is a bound variable
- such that this tactic cannot be associated to a constant.
-
- .. cmdv:: Hint Resolve {+ @qualid} : @ident
+ :n:`{| -> | <- }`
+ The second form adds the left-to-right (`->`) or right-ot-left implication (`<-`)
+ of an equivalence as a hint (informally
+ the hint will be used as, respectively, :tacn:`apply` :n:`-> @qualid` or
+ :tacn:`apply` :n:`<- @qualid`,
+ although as mentioned before, the tactic actually used is a restricted version of
+ :tacn:`apply`).
- Adds each :n:`Hint Resolve @qualid`.
+ :n:`@one_term`
+ Permits declaring a hint without declaring a new
+ constant first, but this is not recommended.
- .. cmdv:: Hint Resolve -> @qualid : @ident
+ .. warn:: Declaring arbitrary terms as hints is fragile; it is recommended to declare a toplevel constant instead
+ :undocumented:
- Adds the left-to-right implication of an equivalence as a hint (informally
- the hint will be used as :n:`apply <- @qualid`, although as mentioned
- before, the tactic actually used is a restricted version of
- :tacn:`apply`).
-
- .. cmdv:: Hint Resolve <- @qualid
+ .. exn:: @qualid cannot be used as a hint
- Adds the right-to-left implication of an equivalence as a hint.
+ The head symbol of the type of :n:`@qualid` is a bound variable
+ such that this tactic cannot be associated to a constant.
- .. cmdv:: Hint Immediate @qualid : @ident
- :name: Hint Immediate
+ .. cmd:: Hint Immediate {+ {| @qualid | @one_term } } {? : {+ @ident } }
- This command adds :n:`simple apply @qualid; trivial` to the hint list associated
- with the head symbol of the type of :n:`@ident` in the given database. This
- tactic will fail if all the subgoals generated by :n:`simple apply @qualid` are
+ Adds :tacn:`simple apply` :n:`@qualid;` :tacn:`trivial` to the hint list for each :n:`@qualid` associated
+ with the head symbol of the type of :n:`@ident`. This
+ tactic will fail if all the subgoals generated by :tacn:`simple apply` :n:`@qualid` are
not solved immediately by the :tacn:`trivial` tactic (which only tries tactics
- with cost 0).This command is useful for theorems such as the symmetry of
- equality or :g:`n+1=m+1 -> n=m` that we may like to introduce with a limited
- use in order to avoid useless proof-search. The cost of this tactic (which
+ with cost 0). This command is useful for theorems such as the symmetry of
+ equality or :g:`n+1=m+1 -> n=m` that we may want to introduce with limited
+ use in order to avoid useless proof search. The cost of this tactic (which
never generates subgoals) is always 1, so that it is not used by :tacn:`trivial`
itself.
- .. exn:: @qualid cannot be used as a hint
- :undocumented:
+ .. cmd:: Hint Constructors {+ @qualid } {? : {+ @ident } }
- .. cmdv:: Hint Immediate {+ @qualid} : @ident
-
- Adds each :n:`Hint Immediate @qualid`.
-
- .. cmdv:: Hint Constructors @qualid : @ident
- :name: Hint Constructors
-
- If :token:`qualid` is an inductive type, this command adds all its constructors as
+ For each :n:`@qualid` that is an inductive type, adds all its constructors as
hints of type ``Resolve``. Then, when the conclusion of current goal has the form
:n:`(@qualid ...)`, :tacn:`auto` will try to apply each constructor.
.. exn:: @qualid is not an inductive type
:undocumented:
- .. cmdv:: Hint Constructors {+ @qualid} : @ident
-
- Extends the previous command for several inductive types.
+ .. cmd:: Hint Unfold {+ @qualid } {? : {+ @ident } }
- .. cmdv:: Hint Unfold @qualid : @ident
- :name: Hint Unfold
-
- This adds the tactic :n:`unfold @qualid` to the hint list that will only be
- used when the head constant of the goal is :token:`qualid`.
+ For each :n:`@qualid`, adds the tactic :tacn:`unfold` :n:`@qualid` to the
+ hint list that will only be used when the head constant of the goal is :token:`qualid`.
Its cost is 4.
- .. cmdv:: Hint Unfold {+ @qualid}
-
- Extends the previous command for several defined constants.
-
- .. cmdv:: Hint Transparent {+ @qualid} : @ident
- Hint Opaque {+ @qualid} : @ident
+ .. cmd:: Hint {| Transparent | Opaque } {+ @qualid } {? : {+ @ident } }
:name: Hint Transparent; Hint Opaque
- This adds transparency hints to the database, making :n:`@qualid`
- transparent or opaque constants during resolution. This information is used
+ Adds transparency hints to the database, making each :n:`@qualid`
+ a transparent or opaque constant during resolution. This information is used
during unification of the goal with any lemma in the database and inside the
discrimination network to relax or constrain it in the case of discriminated
databases.
- .. cmdv:: Hint Variables {| Transparent | Opaque } : @ident
- Hint Constants {| Transparent | Opaque } : @ident
- :name: Hint Variables; Hint Constants
+ .. cmd:: Hint {| Constants | Variables } {| Transparent | Opaque } {? : {+ @ident } }
+ :name: Hint Constants; Hint Variables
- This sets the transparency flag used during unification of
- hints in the database for all constants or all variables,
- overwriting the existing settings of opacity. It is advised
- to use this just after a :cmd:`Create HintDb` command.
+ Sets the transparency flag for constants or variables for the specified hint
+ databases.
+ These flags affect the unification of hints in the database.
+ We advise using this just after a :cmd:`Create HintDb` command.
- .. cmdv:: Hint Extern @natural {? @pattern} => @tactic : @ident
- :name: Hint Extern
+ .. cmd:: Hint Extern @natural {? @one_pattern } => @ltac_expr {? : {+ @ident } }
- This hint type is to extend :tacn:`auto` with tactics other than :tacn:`apply` and
- :tacn:`unfold`. For that, we must specify a cost, an optional :n:`@pattern` and a
- :n:`@tactic` to execute.
+ Extends :tacn:`auto` with tactics other than :tacn:`apply` and
+ :tacn:`unfold`. :n:`@natural` is the cost, :n:`@one_term` is the pattern
+ to match and :n:`@ltac_expr` is the action to apply.
+
+ .. note::
+
+ Use a :cmd:`Hint Extern` with no pattern to do
+ pattern matching on hypotheses using ``match goal with``
+ inside the tactic.
.. example::
@@ -441,80 +420,131 @@ automatically created.
.. coqtop:: all
Require Import List.
- Hint Extern 5 ({?X1 = ?X2} + {?X1 <> ?X2}) => generalize X1, X2; decide equality : eqdec.
+ Hint Extern 5 ({?X1 = ?X2} + {?X1 <> ?X2}) =>
+ generalize X1, X2; decide equality : eqdec.
Goal forall a b:list (nat * nat), {a = b} + {a <> b}.
- Info 1 auto with eqdec.
+ info_auto.
- .. cmdv:: Hint Cut @regexp : @ident
- :name: Hint Cut
+ .. cmd:: Hint Cut [ @hints_regexp ] {? : {+ @ident } }
- .. warning::
-
- These hints currently only apply to typeclass proof search and the
- :tacn:`typeclasses eauto` tactic.
-
- This command can be used to cut the proof-search tree according to a regular
- expression matching paths to be cut. The grammar for regular expressions is
- the following. Beware, there is no operator precedence during parsing, one can
- check with :cmd:`Print HintDb` to verify the current cut expression:
+ .. DISABLED insertprodn hints_regexp hints_regexp
.. prodn::
- regexp ::= @ident (hint or instance identifier)
+ hints_regexp ::= {+ @qualid } (hint or instance identifier)
| _ (any hint)
- | @regexp | @regexp (disjunction)
- | @regexp @regexp (sequence)
- | @regexp * (Kleene star)
+ | @hints_regexp | @hints_regexp (disjunction)
+ | @hints_regexp @hints_regexp (sequence)
+ | @hints_regexp * (Kleene star)
| emp (empty)
| eps (epsilon)
- | ( @regexp )
+ | ( @hints_regexp )
+
+ Used to cut the proof search tree according to a regular
+ expression that matches the paths to be cut.
+
- The `emp` regexp does not match any search path while `eps`
- matches the empty path. During proof search, the path of
- successive successful hints on a search branch is recorded, as a
- list of identifiers for the hints (note that :cmd:`Hint Extern`\’s do not have
+ During proof search, the path of
+ successive successful hints on a search branch is recorded as a
+ list of identifiers for the hints (note that :cmd:`Hint Extern`\s do not have
an associated identifier).
- Before applying any hint :n:`@ident` the current path `p` extended with
- :n:`@ident` is matched against the current cut expression `c` associated to
- the hint database. If matching succeeds, the hint is *not* applied. The
- semantics of :n:`Hint Cut @regexp` is to set the cut expression
- to :n:`c | regexp`, the initial cut expression being `emp`.
-
- .. cmdv:: Hint Mode @qualid {* {| + | ! | - } } : @ident
- :name: Hint Mode
-
- This sets an optional mode of use of the identifier :n:`@qualid`. When
- proof-search faces a goal that ends in an application of :n:`@qualid` to
- arguments :n:`@term ... @term`, the mode tells if the hints associated to
- :n:`@qualid` can be applied or not. A mode specification is a list of n ``+``,
+ For each hint :n:`@qualid` in the hint database, the current path `p`
+ extended with :n:`@qualid`
+ is matched against the current cut expression `c` associated with the
+ hint database. If the match succeeds the hint is *not* applied.
+
+ :n:`Hint Cut @hints_regexp` sets the cut expression
+ to :n:`c | @hints_regexp`. The initial cut expression is `emp`.
+
+ The output of :cmd:`Print HintDb` shows the cut expression.
+
+ .. warning::
+
+ There is no operator precedence during parsing, one can
+ check with :cmd:`Print HintDb` to verify the current cut expression.
+
+ .. warning::
+
+ These hints currently only apply to typeclass proof search and the
+ :tacn:`typeclasses eauto` tactic.
+
+ .. cmd:: Hint Mode @qualid {+ {| + | ! | - } } {? : {+ @ident } }
+
+ Sets an optional mode of use for the identifier :n:`@qualid`. When
+ proof search has a goal that ends in an application of :n:`@qualid` to
+ arguments :n:`@arg ... @arg`, the mode tells if the hints associated with
+ :n:`@qualid` can be applied or not. A mode specification is a list of ``+``,
``!`` or ``-`` items that specify if an argument of the identifier is to be
treated as an input (``+``), if its head only is an input (``!``) or an output
(``-``) of the identifier. For a mode to match a list of arguments, input
terms and input heads *must not* contain existential variables or be
- existential variables respectively, while outputs can be any term. Multiple
- modes can be declared for a single identifier, in that case only one mode
- needs to match the arguments for the hints to be applied. The head of a term
+ existential variables respectively, while outputs can be any term.
+
+ The head of a term
is understood here as the applicative head, or the match or projection
scrutinee’s head, recursively, casts being ignored. :cmd:`Hint Mode` is
especially useful for typeclasses, when one does not want to support default
instances and avoid ambiguity in general. Setting a parameter of a class as an
- input forces proof-search to be driven by that index of the class, with ``!``
- giving more flexibility by allowing existentials to still appear deeper in the
- index but not at its head.
+ input forces proof search to be driven by that index of the class, with ``!``
+ allowing existentials to appear in the index but not at its head.
.. note::
- + One can use a :cmd:`Hint Extern` with no pattern to do
- pattern matching on hypotheses using ``match goal with``
- inside the tactic.
+ + Multiple modes can be declared for a single identifier. In that
+ case only one mode needs to match the arguments for the hints to be applied.
+ If you want to add hints such as :cmd:`Hint Transparent`,
:cmd:`Hint Cut`, or :cmd:`Hint Mode`, for typeclass
resolution, do not forget to put them in the
``typeclass_instances`` hint database.
+.. cmd:: Hint Rewrite {? {| -> | <- } } {+ @one_term } {? using @ltac_expr } {? : {* @ident } }
+
+ :n:`{? using @ltac_expr }`
+ If specified, :n:`@ltac_expr` is applied to the generated subgoals, except for the
+ main subgoal.
+
+ :n:`{| -> | <- }`
+ Arrows specify the orientation; left to right (:n:`->`) or right to left (:n:`<-`).
+ If no arrow is given, the default orientation is left to right (:n:`->`).
+
+ Adds the terms :n:`{+ @one_term }` (their types must be
+ equalities) to the rewriting bases :n:`{* @ident }`.
+ Note that the rewriting bases are distinct from the :tacn:`auto`
+ hint bases and that :tacn:`auto` does not take them into account.
+
+ .. cmd:: Print Rewrite HintDb @ident
+
+ This command displays all rewrite hints contained in :n:`@ident`.
+
+.. cmd:: Remove Hints {+ @qualid } {? : {+ @ident } }
+
+ Removes the hints associated with the :n:`{+ @qualid }` in databases
+ :n:`{+ @ident}`. Note: hints created with :cmd:`Hint Extern` currently
+ can't be removed. The best workaround for this is to make the hints
+ non global and carefully select which modules you import.
+
+.. cmd:: Print Hint {? {| * | @reference } }
+
+ :n:`*`
+ Display all declared hints.
+
+ :n:`@reference`
+ Display all hints associated with the head symbol :n:`@reference`.
+
+ Displays tactics from the hints list. The default is to show hints that
+ apply to the conclusion of the current goal. The other forms with :n:`*`
+ and :n:`@reference` can be used even if no proof is open.
+
+ Each hint has a cost that is a nonnegative
+ integer and an optional pattern. The hints with lower cost are tried first.
+
+.. cmd:: Print HintDb @ident
+
+ This command displays all hints from database :n:`@ident`.
+
Hint databases defined in the Coq standard library
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+--------------------------------------------------
Several hint databases are defined in the Coq standard library. The
actual content of a database is the collection of hints declared
@@ -555,76 +585,8 @@ At Coq startup, only the core database is nonempty and can be used.
You are advised not to put your own hints in the core database, but
use one or several databases specific to your development.
-.. _removehints:
-
-.. cmd:: Remove Hints {+ @term} : {+ @ident}
-
- This command removes the hints associated to terms :n:`{+ @term}` in databases
- :n:`{+ @ident}`.
-
-.. _printhint:
-
-.. cmd:: 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:**
-
-
-.. cmd:: Print Hint @ident
-
- This command displays only tactics associated with :n:`@ident` in the hints
- list. This is independent of the goal being edited, so this command will not
- fail if no goal is being edited.
-
-.. cmd:: Print Hint *
-
- This command displays all declared hints.
-
-.. cmd:: Print HintDb @ident
-
- This command displays all hints from database :n:`@ident`.
-
-.. _hintrewrite:
-
-.. cmd:: Hint Rewrite {+ @term} : {+ @ident}
-
- This vernacular command adds the terms :n:`{+ @term}` (their types must be
- equalities) in the rewriting bases :n:`{+ @ident}` with the default orientation
- (left to right). Notice that the rewriting bases are distinct from the :tacn:`auto`
- hint bases and that :tacn:`auto` does not take them into account.
-
- This command is synchronous with the section mechanism (see :ref:`section-mechanism`):
- when closing a section, all aliases created by ``Hint Rewrite`` in that
- section are lost. Conversely, when loading a module, all ``Hint Rewrite``
- declarations at the global level of that module are loaded.
-
-**Variants:**
-
-.. cmd:: Hint Rewrite -> {+ @term} : {+ @ident}
-
- This is strictly equivalent to the command above (we only make explicit the
- orientation which otherwise defaults to ->).
-
-.. cmd:: Hint Rewrite <- {+ @term} : {+ @ident}
-
- Adds the rewriting rules :n:`{+ @term}` with a right-to-left orientation in
- the bases :n:`{+ @ident}`.
-
-.. cmd:: Hint Rewrite {? {| -> | <- } } {+ @one_term } {? using @ltac_expr } {? : {* @ident } }
-
- When the rewriting rules :n:`{+ @term}` in :n:`{+ @ident}` will be used, the
- tactic ``tactic`` will be applied to the generated subgoals, the main subgoal
- excluded.
-
-.. cmd:: Print Rewrite HintDb @ident
-
- This command displays all rewrite hints contained in :n:`@ident`.
-
Hint locality
-~~~~~~~~~~~~~
+-------------
Hints provided by the ``Hint`` commands are erased when closing a section.
Conversely, all hints of a module ``A`` that are not defined inside a
@@ -649,7 +611,6 @@ option which accepts three flags allowing for a fine-grained handling of
non-imported hints.
.. opt:: Loose Hint Behavior {| "Lax" | "Warn" | "Strict" }
- :name: Loose Hint Behavior
This option accepts three values, which control the behavior of hints w.r.t.
:cmd:`Import`:
@@ -668,22 +629,12 @@ non-imported hints.
.. _tactics-implicit-automation:
Setting implicit automation tactics
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+-----------------------------------
-.. cmd:: Proof with @tactic
+.. cmd:: Proof with @ltac_expr {? using @section_var_expr }
- This command may be used to start a proof. It defines a default tactic
- to be used each time a tactic command ``tactic``:sub:`1` is ended by ``...``.
- In this case the tactic command typed by the user is equivalent to
- ``tactic``:sub:`1` ``;tactic``.
+ Starts a proof in which :token:`ltac_expr` is applied to the active goals
+ after each tactic that ends with `...` instead of the usual single period.
+ ":n:`@tactic...`" is equivalent to ":n:`@tactic; @ltac_expr.`".
.. seealso:: :cmd:`Proof` in :ref:`proof-editing-mode`.
-
-
- .. cmdv:: Proof with @tactic using {+ @ident}
-
- Combines in a single line ``Proof with`` and ``Proof using``, see :ref:`proof-editing-mode`
-
- .. cmdv:: Proof using {+ @ident} with @tactic
-
- Combines in a single line ``Proof with`` and ``Proof using``, see :ref:`proof-editing-mode`
diff --git a/doc/sphinx/proofs/writing-proofs/rewriting.rst b/doc/sphinx/proofs/writing-proofs/rewriting.rst
index 5283f60b11..3649202b45 100644
--- a/doc/sphinx/proofs/writing-proofs/rewriting.rst
+++ b/doc/sphinx/proofs/writing-proofs/rewriting.rst
@@ -146,6 +146,13 @@ simply :g:`t=u` dropping the implicit type of :g:`t` and :g:`u`.
only in the conclusion of the goal. The clause argument must not contain
any ``type of`` nor ``value of``.
+ .. tacv:: cutrewrite {? {| <- | -> } } (@term__1 = @term__2) {? in @ident }
+ :name: cutrewrite
+
+ .. deprecated:: 8.5
+
+ Use :tacn:`replace` instead.
+
.. tacn:: subst @ident
:name: subst
@@ -295,21 +302,21 @@ simply :g:`t=u` dropping the implicit type of :g:`t` and :g:`u`.
Performing computations
---------------------------
-.. insertprodn red_expr pattern_occ
+.. insertprodn red_expr pattern_occs
.. prodn::
red_expr ::= red
| hnf
- | simpl {? @delta_flag } {? @ref_or_pattern_occ }
+ | simpl {? @delta_flag } {? {| @reference_occs | @pattern_occs } }
| cbv {? @strategy_flag }
| cbn {? @strategy_flag }
| lazy {? @strategy_flag }
| compute {? @delta_flag }
- | vm_compute {? @ref_or_pattern_occ }
- | native_compute {? @ref_or_pattern_occ }
- | unfold {+, @unfold_occ }
+ | vm_compute {? {| @reference_occs | @pattern_occs } }
+ | native_compute {? {| @reference_occs | @pattern_occs } }
+ | unfold {+, @reference_occs }
| fold {+ @one_term }
- | pattern {+, @pattern_occ }
+ | pattern {+, @pattern_occs }
| @ident
delta_flag ::= {? - } [ {+ @reference } ]
strategy_flag ::= {+ @red_flag }
@@ -321,14 +328,8 @@ Performing computations
| cofix
| zeta
| delta {? @delta_flag }
- ref_or_pattern_occ ::= @reference {? at @occs_nums }
- | @one_term {? at @occs_nums }
- occs_nums ::= {+ {| @natural | @ident } }
- | - {+ {| @natural | @ident } }
- int_or_var ::= @integer
- | @ident
- unfold_occ ::= @reference {? at @occs_nums }
- pattern_occ ::= @one_term {? at @occs_nums }
+ reference_occs ::= @reference {? at @occs_nums }
+ pattern_occs ::= @one_term {? at @occs_nums }
This set of tactics implements different specialized usages of the
tactic :tacn:`change`.
@@ -346,17 +347,6 @@ clauses) and are introduced by the keyword `in`. If no goal clause is
provided, the default is to perform the conversion only in the
conclusion.
-The syntax and description of the various goal clauses is the
-following:
-
-+ :n:`in {+ @ident} |-` only in hypotheses :n:`{+ @ident}`
-+ :n:`in {+ @ident} |- *` in hypotheses :n:`{+ @ident}` and in the
- conclusion
-+ :n:`in * |-` in every hypothesis
-+ :n:`in *` (equivalent to in :n:`* |- *`) everywhere
-+ :n:`in (type of @ident) (value of @ident) ... |-` in type part of
- :n:`@ident`, in the value part of :n:`@ident`, etc.
-
For backward compatibility, the notation :n:`in {+ @ident}` performs
the conversion in hypotheses :n:`{+ @ident}`.
@@ -532,7 +522,7 @@ the conversion in hypotheses :n:`{+ @ident}`.
use the name of the constant the (co)fixpoint comes from instead of
the (co)fixpoint definition in recursive calls.
- The :tacn:`cbn` tactic is claimed to be a more principled, faster and more
+ The :tacn:`cbn` tactic was intended to be a more principled, faster and more
predictable replacement for :tacn:`simpl`.
The :tacn:`cbn` tactic accepts the same flags as :tacn:`cbv` and
diff --git a/doc/sphinx/user-extensions/syntax-extensions.rst b/doc/sphinx/user-extensions/syntax-extensions.rst
index 5cbd2e400e..f454f4313d 100644
--- a/doc/sphinx/user-extensions/syntax-extensions.rst
+++ b/doc/sphinx/user-extensions/syntax-extensions.rst
@@ -309,7 +309,7 @@ at the time of use of the notation.
a notation should only be used for printing.
If a notation to be used both for parsing and printing is
- overriden, both the parsing and printing are invalided, even if the
+ overridden, both the parsing and printing are invalided, even if the
overriding rule is only parsing.
If a given notation string occurs only in ``only printing`` rules,
@@ -588,6 +588,8 @@ As an exception, if the right-hand side is just of the form
:n:`@@qualid`, this conventionally stops the inheritance of implicit
arguments (but not of notation scopes).
+.. _notations-and-binders:
+
Notations and binders
~~~~~~~~~~~~~~~~~~~~~
@@ -603,7 +605,7 @@ Here is the basic example of a notation using a binder:
.. coqtop:: in
Notation "'sigma' x : A , B" := (sigT (fun x : A => B))
- (at level 200, x ident, A at level 200, right associativity).
+ (at level 200, x name, A at level 200, right associativity).
The binding variables in the right-hand side that occur as a parameter
of the notation (here :g:`x`) dynamically bind all the occurrences
@@ -616,8 +618,9 @@ application of the notation:
Check sigma z : nat, z = 0.
-Note the :n:`@syntax_modifier x ident` in the declaration of the
-notation. It tells to parse :g:`x` as a single identifier.
+Note the :n:`@syntax_modifier x name` in the declaration of the
+notation. It tells to parse :g:`x` as a single identifier (or as the
+unnamed variable :g:`_`).
Binders bound in the notation and parsed as patterns
++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -655,7 +658,7 @@ variable. Here is an example showing the difference:
Notation "'subset_bis' ' p , P" := (sig (fun p => P))
(at level 200, p strict pattern).
Notation "'subset_bis' p , P " := (sig (fun p => P))
- (at level 200, p ident).
+ (at level 200, p name).
.. coqtop:: all
@@ -675,18 +678,19 @@ the following:
.. coqdoc::
Notation "{ x : A | P }" := (sig (fun x : A => P))
- (at level 0, x at level 99 as ident).
+ (at level 0, x at level 99 as name).
This is so because the grammar also contains rules starting with :g:`{}` and
followed by a term, such as the rule for the notation :g:`{ A } + { B }` for the
constant :g:`sumbool` (see :ref:`specification`).
-Then, in the rule, ``x ident`` is replaced by ``x at level 99 as ident`` meaning
+Then, in the rule, ``x name`` is replaced by ``x at level 99 as name`` meaning
that ``x`` is parsed as a term at level 99 (as done in the notation for
-:g:`sumbool`), but that this term has actually to be an identifier.
+:g:`sumbool`), but that this term has actually to be a name, i.e. an
+identifier or :g:`_`.
The notation :g:`{ x | P }` is already defined in the standard
-library with the ``as ident`` :n:`@syntax_modifier`. We cannot redefine it but
+library with the ``as name`` :n:`@syntax_modifier`. We cannot redefine it but
one can define an alternative notation, say :g:`{ p such that P }`,
using instead ``as pattern``.
@@ -702,12 +706,12 @@ Then, the following works:
Check {(x,y) such that x+y=0}.
To enforce that the pattern should not be used for printing when it
-is just an identifier, one could have said
+is just a name, one could have said
``p at level 99 as strict pattern``.
-Note also that in the absence of a ``as ident``, ``as strict pattern`` or
+Note also that in the absence of a ``as name``, ``as strict pattern`` or
``as pattern`` :n:`@syntax_modifier`\s, the default is to consider sub-expressions occurring
-in binding position and parsed as terms to be ``as ident``.
+in binding position and parsed as terms to be ``as name``.
Binders bound in the notation and parsed as general binders
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -768,7 +772,7 @@ binding position. Here is an example:
Definition force n (P:nat -> Prop) := forall n', n' >= n -> P n'.
Notation "▢_ n P" := (force n (fun n => P))
- (at level 0, n ident, P at level 9, format "▢_ n P").
+ (at level 0, n name, P at level 9, format "▢_ n P").
.. coqtop:: all
@@ -853,7 +857,8 @@ example showing a notation for a chain of equalities. It relies on an
artificial expansion of the intended denotation so as to expose a
``φ(x, .. φ(y,t) ..)`` structure, with the drawback that if ever the
beta-redexes are contracted, the notations stops to be used for
-printing.
+printing. Support for notations defined in this way should be considered
+experimental.
.. coqtop:: in
@@ -946,16 +951,31 @@ position of :g:`x`:
(at level 10, f global, a1, an at level 9).
In addition to ``global``, one can restrict the syntax of a
-sub-expression by using the entry names ``ident`` or ``pattern``
+sub-expression by using the entry names ``ident``, ``name`` or ``pattern``
already seen in :ref:`NotationsWithBinders`, even when the
corresponding expression is not used as a binder in the right-hand
side. E.g.:
+ .. todo: these two Set Warnings and the note should be removed when
+ ident is reactivated with its literal meaning.
+
+.. coqtop:: none
+
+ Set Warnings "-deprecated-ident-entry".
+
.. coqtop:: in
Notation "'apply_id' f a1 .. an" := (.. (f a1) .. an)
(at level 10, f ident, a1, an at level 9).
+.. coqtop:: none
+
+ Set Warnings "+deprecated-ident-entry".
+
+.. note:: As of version 8.13, the entry ``ident`` is a deprecated
+ alias for ``name``. In the future, it is planned to strictly
+ parse an identifier (excluding :g:`_`).
+
.. _custom-entries:
Custom entries
@@ -1113,6 +1133,31 @@ gives a way to let any arbitrary expression which is not handled by the
custom entry ``expr`` be parsed or printed by the main grammar of term
up to the insertion of a pair of curly brackets.
+Another special situation is when parsing global references or
+identifiers. To indicate that a custom entry should parse identifiers,
+use the following form:
+
+.. coqtop:: none
+
+ Reset Initial.
+ Declare Custom Entry expr.
+
+.. coqtop:: in
+
+ Notation "x" := x (in custom expr at level 0, x ident).
+
+Similarly, to indicate that a custom entry should parse global references
+(i.e. qualified or non qualified identifiers), use the following form:
+
+.. coqtop:: none
+
+ Reset Initial.
+ Declare Custom Entry expr.
+
+.. coqtop:: in
+
+ Notation "x" := x (in custom expr at level 0, x global).
+
.. cmd:: Print Custom Grammar @ident
:name: Print Custom Grammar
@@ -1142,6 +1187,7 @@ Here are the syntax elements used by the various notation commands.
| only printing
| format @string {? @string }
explicit_subentry ::= ident
+ | name
| global
| bigint
| strict pattern {? at level @natural }
@@ -1151,6 +1197,7 @@ Here are the syntax elements used by the various notation commands.
| custom @ident {? at @level } {? @binder_interp }
| pattern {? at level @natural }
binder_interp ::= as ident
+ | as name
| as pattern
| as strict pattern
level ::= level @natural
@@ -1188,6 +1235,27 @@ Here are the syntax elements used by the various notation commands.
due to legacy notation in the Coq standard library.
It can be turned on with the ``-w disj-pattern-notation`` flag.
+.. note::
+
+ As of version 8.13, the entry ``ident`` is a deprecated alias for
+ ``name``. In the future, it is planned to strictly parse an
+ identifier (to the exclusion of :g:`_`). If the intent was to use
+ ``ident`` as an identifier (excluding :g:`_`), just silence the warning with
+ :n:`Set Warnings "-deprecated-ident-entry"` and it should automatically
+ get its intended meaning in version 8.15.
+
+ Similarly, ``as ident`` is a deprecated alias for ``as name``, which
+ will only accept an identifier in the future. If the
+ intent was to use ``as ident`` as an identifier
+ (excluding :g:`_`), just silence the warning with
+ :n:`Set Warnings "-deprecated-as-ident-kind"`.
+
+ However, this deprecation does not apply to custom entries, where it
+ already denotes an identifier, as expected.
+
+ .. todo: the note above should be removed at the end of deprecation
+ phase of ident
+ ..
.. _Scopes:
Notation scopes
@@ -1642,6 +1710,8 @@ Number notations
* :n:`Number.uint -> option @qualid__type`
* :n:`Z -> @qualid__type`
* :n:`Z -> option @qualid__type`
+ * :n:`Int63.int -> @qualid__type`
+ * :n:`Int63.int -> option @qualid__type`
* :n:`Number.number -> @qualid__type`
* :n:`Number.number -> option @qualid__type`
@@ -1654,6 +1724,8 @@ Number notations
* :n:`@qualid__type -> option Number.uint`
* :n:`@qualid__type -> Z`
* :n:`@qualid__type -> option Z`
+ * :n:`@qualid__type -> Int63.int`
+ * :n:`@qualid__type -> option Int63.int`
* :n:`@qualid__type -> Number.number`
* :n:`@qualid__type -> option Number.number`
@@ -1669,7 +1741,8 @@ Number notations
Note that only fully-reduced ground terms (terms containing only
function application, constructors, inductive type families,
- sorts, and primitive integers) will be considered for printing.
+ sorts, primitive integers, primitive floats, primitive arrays and type
+ constants for primitive types) will be considered for printing.
.. _number-string-via:
@@ -1758,6 +1831,13 @@ Number notations
only for integers or non-negative integers, and the given number
has a fractional or exponent part or is negative.
+ .. exn:: int63 are only non-negative numbers.
+
+ :n:`Int63.int` are unsigned integers.
+
+ .. exn:: overflow in int63 literal @bigint
+
+ The constant is too big to fit into an unsigned 63-bit integer :n:`Int63.int`.
.. exn:: @qualid__parse should go from Number.int to @type or (option @type). Instead of Number.int, the types Number.uint or Z or Int63.int or Number.number could be used (you may need to require BinNums or Number or Int63 first).
@@ -1826,7 +1906,8 @@ String notations
Note that only fully-reduced ground terms (terms containing only
function application, constructors, inductive type families,
- sorts, and primitive integers) will be considered for printing.
+ sorts, primitive integers, primitive floats, primitive arrays and type
+ constants for primitive types) will be considered for printing.
:n:`via @qualid__ind mapping [ {+, @qualid__constant => @qualid__constructor } ]`
works as for :ref:`number notations above <number-string-via>`.