aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorLysxia2019-03-16 20:49:02 -0400
committerLysxia2019-03-17 09:36:07 -0400
commit911a3bf975ddb933acc0f7e17c465005a5ee8465 (patch)
tree1df2e72d8ca8b2796c02694e723f15f571f97348 /doc
parent211a241f81f80cfc17afc9f1f203a4a5805b8b4a (diff)
[Manual] Gather section-specific commands in Section documentation (fix #9704)
Diffstat (limited to 'doc')
-rw-r--r--doc/sphinx/addendum/type-classes.rst28
-rw-r--r--doc/sphinx/language/gallina-extensions.rst41
-rw-r--r--doc/sphinx/language/gallina-specification-language.rst40
3 files changed, 56 insertions, 53 deletions
diff --git a/doc/sphinx/addendum/type-classes.rst b/doc/sphinx/addendum/type-classes.rst
index a463a73bef..8e6f85fca3 100644
--- a/doc/sphinx/addendum/type-classes.rst
+++ b/doc/sphinx/addendum/type-classes.rst
@@ -146,10 +146,12 @@ database.
Sections and contexts
---------------------
-To ease the parametrization of developments by typeclasses, we provide a new
-way to introduce variables into section contexts, compatible with the implicit
-argument mechanism. The new command works similarly to the :cmd:`Variables`
-vernacular, except it accepts any binding context as argument. For example:
+To ease the parametrization of developments by typeclasses, one can use
+the command :cmd:`Context` to introduce variables into section contexts,
+it works similarly to the :cmd:`Variable` vernacular, except it accepts any
+binding context as argument, so variables can implicit, and
+:ref:`implicit-generalization` can be used (see also :ref:`section-mechanism`).
+For example:
.. coqtop:: all
@@ -358,24 +360,6 @@ few other commands related to typeclasses.
equivalent to ``Hint Resolve ident : typeclass_instances``, except it
registers instances for :cmd:`Print Instances`.
-.. cmd:: Context @binders
-
- Declare variables in the context of the current section, like :cmd:`Variable`,
- but also allowing implicit variables and :ref:`implicit-generalization`.
-
- .. coqdoc::
-
- Section ContextExample.
-
- Context {A : Type} (a b : A).
- Context `{EqDec A}.
-
- (* ... *)
-
- End ContextExample.
-
- See also :ref:`contexts`.
-
.. tacn:: typeclasses eauto
:name: typeclasses eauto
diff --git a/doc/sphinx/language/gallina-extensions.rst b/doc/sphinx/language/gallina-extensions.rst
index 59506a6ff2..f2d305f4bc 100644
--- a/doc/sphinx/language/gallina-extensions.rst
+++ b/doc/sphinx/language/gallina-extensions.rst
@@ -768,7 +768,7 @@ Section :ref:`gallina-definitions`).
.. cmd:: End @ident
This command closes the section named :token:`ident`. After closing of the
- section, the local declarations (variables and local definitions) get
+ section, the local declarations (variables and local definitions, see :cmd:`Variable`) get
*discharged*, meaning that they stop being visible and that all global
objects defined in the section are generalized with respect to the
variables and local definitions they each depended on in the section.
@@ -805,6 +805,45 @@ Section :ref:`gallina-definitions`).
Most commands, like :cmd:`Hint`, :cmd:`Notation`, option management, … which
appear inside a section are canceled when the section is closed.
+.. cmd:: Variable @ident : @type
+
+ This command links :token:`type` to the name :token:`ident` in the context of
+ the current section (see Section :ref:`section-mechanism` for a description of
+ the section mechanism). When the current section is closed, name :token:`ident`
+ will be unknown and every object using this variable will be explicitly
+ parametrized (the variable is *discharged*).
+ The :cmd:`Variable` command out of any section is equivalent to :cmd:`Local Parameter`.
+
+ .. exn:: @ident already exists.
+ :name: @ident already exists. (Variable)
+ :undocumented:
+
+ .. cmdv:: Variable {+ @ident } : @term
+
+ Links :token:`type` to each :token:`ident`.
+
+ .. cmdv:: Variable {+ ( {+ @ident } : @term ) }
+
+ Adds blocks of variables with different specifications.
+
+ .. cmdv:: Variables {+ ( {+ @ident } : @term) }
+ Hypothesis {+ ( {+ @ident } : @term) }
+ Hypotheses {+ ( {+ @ident } : @term) }
+ :name: Variables; Hypothesis; Hypotheses
+
+ These variants are synonyms of :n:`Variable {+ ( {+ @ident } : @term) }`.
+
+.. cmd:: Context @binders
+
+ Declare variables in the context of the current section, like :cmd:`Variable`,
+ but also allowing implicit variables and :ref:`implicit-generalization`.
+
+ .. coqdoc::
+
+ Context {A : Type} (a b : A).
+ Context `{EqDec A}.
+
+ See also :ref:`contexts` in the chapter :ref:`typeclasses`.
Module system
-------------
diff --git a/doc/sphinx/language/gallina-specification-language.rst b/doc/sphinx/language/gallina-specification-language.rst
index 158a3f5ffc..1c6fb4b193 100644
--- a/doc/sphinx/language/gallina-specification-language.rst
+++ b/doc/sphinx/language/gallina-specification-language.rst
@@ -630,36 +630,16 @@ has type :token:`type`.
These variants are synonyms of :n:`{? Local } Parameter {+ ( {+ @ident } : @type ) }`.
-.. cmd:: Variable @ident : @type
-
- This command links :token:`type` to the name :token:`ident` in the context of
- the current section (see Section :ref:`section-mechanism` for a description of
- the section mechanism). When the current section is closed, name :token:`ident`
- will be unknown and every object using this variable will be explicitly
- parametrized (the variable is *discharged*). Using the :cmd:`Variable` command out
- of any section is equivalent to using :cmd:`Local Parameter`.
-
- See also :cmd:`Context`, a variant of :cmd:`Variable` where variables can be
- made implicit and allowing :ref:`implicit-generalization`.
-
- .. exn:: @ident already exists.
- :name: @ident already exists. (Variable)
- :undocumented:
-
- .. cmdv:: Variable {+ @ident } : @term
-
- Links :token:`type` to each :token:`ident`.
-
- .. cmdv:: Variable {+ ( {+ @ident } : @term ) }
-
- Adds blocks of variables with different specifications.
-
- .. cmdv:: Variables {+ ( {+ @ident } : @term) }
- Hypothesis {+ ( {+ @ident } : @term) }
- Hypotheses {+ ( {+ @ident } : @term) }
- :name: Variables; Hypothesis; Hypotheses
-
- These variants are synonyms of :n:`Variable {+ ( {+ @ident } : @term) }`.
+ .. cmdv:: Variable {+ ( {+ @ident } : @type ) }
+ Variables {+ ( {+ @ident } : @type ) }
+ Hypothesis {+ ( {+ @ident } : @type ) }
+ Hypotheses {+ ( {+ @ident } : @type ) }
+ :name: Variable-Parameter; Variables-Parameter; Hypothesis-Parameter; Hypotheses-Parameter
+
+ Out of any section, these variants are synonyms of
+ :n:`Local Parameter {+ ( {+ @ident } : @type ) }`.
+ For their meaning inside a section, see the documentation on
+ :ref:`section-mechanism`.
.. note::
It is advised to use the commands :cmd:`Axiom`, :cmd:`Conjecture` and