aboutsummaryrefslogtreecommitdiff
path: root/doc/sphinx/proof-engine
diff options
context:
space:
mode:
Diffstat (limited to 'doc/sphinx/proof-engine')
-rw-r--r--doc/sphinx/proof-engine/detailed-tactic-examples.rst10
-rw-r--r--doc/sphinx/proof-engine/ltac.rst2
-rw-r--r--doc/sphinx/proof-engine/proof-handling.rst2
-rw-r--r--doc/sphinx/proof-engine/ssreflect-proof-language.rst7
-rw-r--r--doc/sphinx/proof-engine/tactics.rst70
-rw-r--r--doc/sphinx/proof-engine/vernacular-commands.rst45
6 files changed, 86 insertions, 50 deletions
diff --git a/doc/sphinx/proof-engine/detailed-tactic-examples.rst b/doc/sphinx/proof-engine/detailed-tactic-examples.rst
index 63d6a229ed..b629d15b11 100644
--- a/doc/sphinx/proof-engine/detailed-tactic-examples.rst
+++ b/doc/sphinx/proof-engine/detailed-tactic-examples.rst
@@ -33,7 +33,7 @@ example, revisiting the first example of the inversion documentation:
| LeO : forall n:nat, Le 0 n
| LeS : forall n m:nat, Le n m -> Le (S n) (S m).
- Variable P : nat -> nat -> Prop.
+ Parameter P : nat -> nat -> Prop.
Goal forall n m:nat, Le (S n) m -> P n m.
@@ -69,7 +69,7 @@ as well in this case, e.g.:
.. coqtop:: in
- Variable Q : forall (n m : nat), Le n m -> Prop.
+ Parameter Q : forall (n m : nat), Le n m -> Prop.
Goal forall n m (p : Le (S n) m), Q (S n) m p.
.. coqtop:: all
@@ -124,7 +124,7 @@ the following example on vectors:
.. coqtop:: in
- Variable A : Set.
+ Parameter A : Set.
.. coqtop:: in
@@ -329,7 +329,7 @@ the optional tactic of the ``Hint Rewrite`` command.
.. coqtop:: in
- Variable Ack : nat -> nat -> nat.
+ Parameter Ack : nat -> nat -> nat.
.. coqtop:: in
@@ -357,7 +357,7 @@ the optional tactic of the ``Hint Rewrite`` command.
.. coqtop:: in
- Variable g : nat -> nat -> nat.
+ Parameter g : nat -> nat -> nat.
.. coqtop:: in
diff --git a/doc/sphinx/proof-engine/ltac.rst b/doc/sphinx/proof-engine/ltac.rst
index 3e87e8acd8..52e3029b8f 100644
--- a/doc/sphinx/proof-engine/ltac.rst
+++ b/doc/sphinx/proof-engine/ltac.rst
@@ -200,7 +200,7 @@ following form:
:name: [> ... | ... | ... ] (dispatch)
The expressions :n:`@expr__i` are evaluated to :n:`v__i`, for
- i = 0, ..., n and all have to be tactics. The :n:`v__i` is applied to the
+ i = 1, ..., n and all have to be tactics. The :n:`v__i` is applied to the
i-th goal, for i = 1, ..., n. It fails if the number of focused goals is not
exactly n.
diff --git a/doc/sphinx/proof-engine/proof-handling.rst b/doc/sphinx/proof-engine/proof-handling.rst
index d0bd9e396d..07215a0c7e 100644
--- a/doc/sphinx/proof-engine/proof-handling.rst
+++ b/doc/sphinx/proof-engine/proof-handling.rst
@@ -30,7 +30,7 @@ When a proof is completed, the message ``Proof completed`` is displayed.
One can then register this proof as a defined constant in the
environment. Because there exists a correspondence between proofs and
terms of λ-calculus, known as the *Curry-Howard isomorphism*
-:cite:`How80,Bar81,Gir89,Hue88`, |Coq| stores proofs as terms of |Cic|. Those
+:cite:`How80,Bar81,Gir89,H89`, |Coq| stores proofs as terms of |Cic|. Those
terms are called *proof terms*.
diff --git a/doc/sphinx/proof-engine/ssreflect-proof-language.rst b/doc/sphinx/proof-engine/ssreflect-proof-language.rst
index 237b534d67..b240cef40c 100644
--- a/doc/sphinx/proof-engine/ssreflect-proof-language.rst
+++ b/doc/sphinx/proof-engine/ssreflect-proof-language.rst
@@ -2094,9 +2094,9 @@ into a closing one (similar to :tacn:`now`). Its general syntax is:
:name: by
:undocumented:
-The Ltac expression :n:`by [@tactic | [@tactic | …]` is equivalent to
-:n:`[by @tactic | by @tactic | ...]` and this form should be preferred
-to the former.
+The Ltac expression :n:`by [@tactic | @tactic | …]` is equivalent to
+:n:`do [done | by @tactic | by @tactic | …]`, which corresponds to the
+standard Ltac expression :n:`first [done | @tactic; done | @tactic; done | …]`.
In the script provided as example in section :ref:`indentation_ssr`, the
paragraph corresponding to each sub-case ends with a tactic line prefixed
@@ -2902,6 +2902,7 @@ pattern will be used to process its instance.
Axiom P : nat -> Prop.
Axioms eqn leqn : nat -> nat -> bool.
+ Declare Scope this_scope.
Notation "a != b" := (eqn a b) (at level 70) : this_scope.
Notation "a <= b" := (leqn a b) (at level 70) : this_scope.
Open Scope this_scope.
diff --git a/doc/sphinx/proof-engine/tactics.rst b/doc/sphinx/proof-engine/tactics.rst
index b5e9a902c6..7b395900e9 100644
--- a/doc/sphinx/proof-engine/tactics.rst
+++ b/doc/sphinx/proof-engine/tactics.rst
@@ -378,7 +378,7 @@ Examples:
.. coqtop:: reset none
- Variables (A : Prop) (B: nat -> Prop) (C: Prop).
+ Parameters (A : Prop) (B: nat -> Prop) (C: Prop).
.. coqtop:: out
@@ -730,15 +730,15 @@ Applying theorems
.. coqtop:: reset in
- Variable R : nat -> nat -> Prop.
+ Parameter R : nat -> nat -> Prop.
- Hypothesis Rtrans : forall x y z:nat, R x y -> R y z -> R x z.
+ Axiom Rtrans : forall x y z:nat, R x y -> R y z -> R x z.
- Variables n m p : nat.
+ Parameters n m p : nat.
- Hypothesis Rnm : R n m.
+ Axiom Rnm : R n m.
- Hypothesis Rmp : R m p.
+ Axiom Rmp : R m p.
Consider the goal ``(R n p)`` provable using the transitivity of ``R``:
@@ -3683,11 +3683,7 @@ The general command to add a hint to some databases :n:`{+ @ident}` is
Local is useless since hints do not survive anyway to the closure of
sections.
- .. cmdv:: Local Hint @hint_definition
-
- Idem for the core database.
-
- .. cmdv:: Hint Resolve @term {? | {? @num} {? @pattern}}
+ .. cmdv:: Hint Resolve @term {? | {? @num} {? @pattern}} : @ident
:name: Hint Resolve
This command adds :n:`simple apply @term` to the hint list with the head
@@ -3706,16 +3702,16 @@ The general command to add a hint to some databases :n:`{+ @ident}` is
typical example of a hint that is used only by :tacn:`eauto` is a transitivity
lemma.
- .. exn:: @term cannot be used as a hint
+ .. exn:: @term cannot be used as a hint
- The head symbol of the type of :n:`@term` is a bound variable such that
- this tactic cannot be associated to a constant.
+ The head symbol of the type of :n:`@term` is a bound variable
+ such that this tactic cannot be associated to a constant.
- .. cmdv:: Hint Resolve {+ @term}
+ .. cmdv:: Hint Resolve {+ @term} : @ident
Adds each :n:`Hint Resolve @term`.
- .. cmdv:: Hint Resolve -> @term
+ .. cmdv:: Hint Resolve -> @term : @ident
Adds the left-to-right implication of an equivalence as a hint (informally
the hint will be used as :n:`apply <- @term`, although as mentionned
@@ -3726,7 +3722,7 @@ The general command to add a hint to some databases :n:`{+ @ident}` is
Adds the right-to-left implication of an equivalence as a hint.
- .. cmdv:: Hint Immediate @term
+ .. cmdv:: Hint Immediate @term : @ident
:name: Hint Immediate
This command adds :n:`simple apply @term; trivial` to the hint list associated
@@ -3742,37 +3738,37 @@ The general command to add a hint to some databases :n:`{+ @ident}` is
.. exn:: @term cannot be used as a hint
:undocumented:
- .. cmdv:: Immediate {+ @term}
+ .. cmdv:: Immediate {+ @term} : @ident
Adds each :n:`Hint Immediate @term`.
- .. cmdv:: Hint Constructors @ident
+ .. cmdv:: Hint Constructors @qualid : @ident
:name: Hint Constructors
- If :n:`@ident` is an inductive type, this command adds all its constructors as
+ If :token:`qualid` is an inductive type, this command adds all its constructors as
hints of type ``Resolve``. Then, when the conclusion of current goal has the form
- :n:`(@ident ...)`, :tacn:`auto` will try to apply each constructor.
+ :n:`(@qualid ...)`, :tacn:`auto` will try to apply each constructor.
- .. exn:: @ident is not an inductive type
- :undocumented:
+ .. exn:: @qualid is not an inductive type
+ :undocumented:
- .. cmdv:: Hint Constructors {+ @ident}
+ .. cmdv:: Hint Constructors {+ @qualid} : @ident
- Adds each :n:`Hint Constructors @ident`.
+ Extends the previous command for several inductive types.
- .. cmdv:: Hint Unfold @qualid
+ .. 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 :n:`@ident`.
+ used when the head constant of the goal is :token:`qualid`.
Its cost is 4.
- .. cmdv:: Hint Unfold {+ @ident}
+ .. cmdv:: Hint Unfold {+ @qualid}
- Adds each :n:`Hint Unfold @ident`.
+ Extends the previous command for several defined constants.
- .. cmdv:: Hint Transparent {+ @qualid}
- Hint Opaque {+ @qualid}
+ .. cmdv:: Hint Transparent {+ @qualid} : @ident
+ Hint Opaque {+ @qualid} : @ident
:name: Hint Transparent; Hint Opaque
This adds transparency hints to the database, making :n:`@qualid`
@@ -3781,8 +3777,8 @@ The general command to add a hint to some databases :n:`{+ @ident}` is
discrimination network to relax or constrain it in the case of discriminated
databases.
- .. cmdv:: Hint Variables %( Transparent %| Opaque %)
- Hint Constants %( Transparent %| Opaque %)
+ .. cmdv:: Hint Variables %( Transparent %| Opaque %) : @ident
+ Hint Constants %( Transparent %| Opaque %) : @ident
:name: Hint Variables; Hint Constants
This sets the transparency flag used during unification of
@@ -3790,7 +3786,7 @@ The general command to add a hint to some databases :n:`{+ @ident}` is
overwritting the existing settings of opacity. It is advised
to use this just after a :cmd:`Create HintDb` command.
- .. cmdv:: Hint Extern @num {? @pattern} => @tactic
+ .. cmdv:: Hint Extern @num {? @pattern} => @tactic : @ident
:name: Hint Extern
This hint type is to extend :tacn:`auto` with tactics other than :tacn:`apply` and
@@ -3801,7 +3797,7 @@ The general command to add a hint to some databases :n:`{+ @ident}` is
.. coqtop:: in
- Hint Extern 4 (~(_ = _)) => discriminate.
+ Hint Extern 4 (~(_ = _)) => discriminate : core.
Now, when the head of the goal is a disequality, ``auto`` will try
discriminate if it does not manage to solve the goal with hints with a
@@ -3820,7 +3816,7 @@ The general command to add a hint to some databases :n:`{+ @ident}` is
Goal forall a b:list (nat * nat), {a = b} + {a <> b}.
Info 1 auto with eqdec.
- .. cmdv:: Hint Cut @regexp
+ .. cmdv:: Hint Cut @regexp : @ident
:name: Hint Cut
.. warning::
@@ -3854,7 +3850,7 @@ The general command to add a hint to some databases :n:`{+ @ident}` is
semantics of ``Hint Cut e`` is to set the cut expression to ``c | e``, the
initial cut expression being `emp`.
- .. cmdv:: Hint Mode @qualid {* (+ | ! | -)}
+ .. cmdv:: Hint Mode @qualid {* (+ | ! | -)} : @ident
:name: Hint Mode
This sets an optional mode of use of the identifier :n:`@qualid`. When
diff --git a/doc/sphinx/proof-engine/vernacular-commands.rst b/doc/sphinx/proof-engine/vernacular-commands.rst
index a98a46ba21..3e8dd25ee0 100644
--- a/doc/sphinx/proof-engine/vernacular-commands.rst
+++ b/doc/sphinx/proof-engine/vernacular-commands.rst
@@ -1213,10 +1213,19 @@ Controlling the locality of commands
occurs in a section. The :cmd:`Set` and :cmd:`Unset` commands belong to this
category.
+.. _internal-registration-commands:
+
+Internal registration commands
+--------------------------------
+
+Due to their internal nature, the commands that are presented in this section
+are not for general use. They are meant to appear only in standard libraries and
+in support libraries of plug-ins.
+
.. _exposing-constants-to-ocaml-libraries:
Exposing constants to OCaml libraries
-----------------------------------------------------------------
+````````````````````````````````````````````````````````````````
.. cmd:: Register @qualid__1 as @qualid__2
@@ -1225,5 +1234,35 @@ Exposing constants to OCaml libraries
calling :n:`Coqlib.lib_ref "@qualid__2"`; i.e., there is no need to known
where is the constant defined (file, module, library, etc.).
- Due to its internal nature, this command is not for general use. It is meant
- to appear only in standard libraries and in support libraries of plug-ins.
+ As a special case, when the first segment of :n:`@qualid__2` is :g:`kernel`,
+ the constant is exposed to the kernel. For instance, the `Int63` module
+ features the following declaration:
+
+ .. coqdoc::
+
+ Register bool as kernel.ind_bool.
+
+ This makes the kernel aware of what is the type of boolean values. This
+ information is used for instance to define the return type of the
+ :g:`#int63_eq` primitive.
+
+ .. seealso:: :ref:`primitive-integers`
+
+Inlining hints for the fast reduction machines
+````````````````````````````````````````````````````````````````
+
+.. cmd:: Register Inline @qualid
+
+ This command gives as a hint to the reduction machines (VM and native) that
+ the body of the constant :n:`@qualid` should be inlined in the generated code.
+
+Registering primitive operations
+````````````````````````````````
+
+.. cmd:: Primitive @ident__1 := #@ident__2.
+
+ Declares :n:`@ident__1` as the primitive operator :n:`#@ident__2`. When
+ running this command, the type of the primitive should be already known by
+ the kernel (this is achieved through this command for primitive types and
+ through the :cmd:`Register` command with the :g:`kernel` name-space for other
+ types).