aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/sphinx/language/cic.rst22
-rw-r--r--doc/sphinx/proof-engine/ltac.rst7
2 files changed, 23 insertions, 6 deletions
diff --git a/doc/sphinx/language/cic.rst b/doc/sphinx/language/cic.rst
index 3d3a1b11b1..35f45e2e0e 100644
--- a/doc/sphinx/language/cic.rst
+++ b/doc/sphinx/language/cic.rst
@@ -1025,8 +1025,26 @@ the Type hierarchy.
Template polymorphism
+++++++++++++++++++++
-Inductive types declared in :math:`\Type` are polymorphic over their arguments
-in :math:`\Type`. If :math:`A` is an arity of some sort and :math:`s` is a sort, we write :math:`A_{/s}`
+Inductive types can be made polymorphic over their arguments
+in :math:`\Type`.
+
+.. opt:: Auto Template Polymorphism
+
+ This option, enabled by default, makes every inductive type declared
+ at level :math:`Type` (without annotations or hiding it behind a
+ definition) template polymorphic.
+
+ This can be prevented using the ``notemplate`` attribute.
+
+ An inductive type can be forced to be template polymorphic using the
+ ``template`` attribute.
+
+ Template polymorphism and universe polymorphism (see Chapter
+ :ref:`polymorphicuniverses`) are incompatible, so if the later is
+ enabled it will prevail over automatic template polymorphism and
+ cause an error when using the ``template`` attribute.
+
+If :math:`A` is an arity of some sort and :math:`s` is a sort, we write :math:`A_{/s}`
for the arity obtained from :math:`A` by replacing its sort with :math:`s`.
Especially, if :math:`A` is well-typed in some global environment and local
context, then :math:`A_{/s}` is typable by typability of all products in the
diff --git a/doc/sphinx/proof-engine/ltac.rst b/doc/sphinx/proof-engine/ltac.rst
index 7608ea7245..70d46e034a 100644
--- a/doc/sphinx/proof-engine/ltac.rst
+++ b/doc/sphinx/proof-engine/ltac.rst
@@ -107,7 +107,7 @@ mode but it can also be used in toplevel definitions as shown below.
: | solve [ `expr` | ... | `expr` ]
: | idtac [ `message_token` ... `message_token`]
: | fail [`natural`] [`message_token` ... `message_token`]
- : | fresh | fresh `string` | fresh `qualid`
+ : | fresh [ `component` … `component` ]
: | context `ident` [`term`]
: | eval `redexpr` in `term`
: | type of `term`
@@ -125,6 +125,7 @@ mode but it can also be used in toplevel definitions as shown below.
: | ()
: | `integer`
: | ( `expr` )
+ component : `string` | `qualid`
message_token : `string` | `ident` | `integer`
tacarg : `qualid`
: | ()
@@ -946,12 +947,10 @@ expression returns an identifier:
.. tacn:: fresh {* component}
It evaluates to an identifier unbound in the goal. This fresh identifier
- is obtained by concatenating the value of the :n:`@component`s (each of them
+ is obtained by concatenating the value of the :n:`@component`\ s (each of them
is, either a :n:`@qualid` which has to refer to a (unqualified) name, or
directly a name denoted by a :n:`@string`).
- .. I don't understand this component thing. Couldn't we give the grammar?
-
If the resulting name is already used, it is padded with a number so that it
becomes fresh. If no component is given, the name is a fresh derivative of
the name ``H``.