Skip to content

Commit

Permalink
Merge PR #12782: Trying to rephrase complex sentences to make them ea…
Browse files Browse the repository at this point in the history
…sier to read.

Reviewed-by: jfehrle
Ack-by: Mbodin
Ack-by: corwin-of-amber
  • Loading branch information
coqbot committed Aug 6, 2020
2 parents 51eccce + ddce800 commit a5a4cbb
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 17 deletions.
32 changes: 18 additions & 14 deletions doc/sphinx/language/extensions/evars.rst
Expand Up @@ -13,13 +13,13 @@ Existential variables
| ?[ ?@ident ]
| ?@ident {? @%{ {+; @ident := @term } %} }
|Coq| terms can include existential variables which represents unknown
subterms to eventually be replaced by actual subterms.
|Coq| terms can include existential variables that represent unknown
subterms that are eventually replaced with actual subterms.

Existential variables are generated in place of unsolvable implicit
Existential variables are generated in place of unsolved implicit
arguments or “_” placeholders when using commands such as ``Check`` (see
Section :ref:`requests-to-the-environment`) or when using tactics such as
:tacn:`refine`, as well as in place of unsolvable instances when using
:tacn:`refine`, as well as in place of unsolved instances when using
tactics such that :tacn:`eapply`. An existential
variable is defined in a context, which is the context of variables of
the placeholder which generated the existential variable, and a type,
Expand All @@ -43,22 +43,18 @@ existential variable is represented by “?” followed by an identifier.
Check identity _ (fun x => _).

In the general case, when an existential variable :n:`?@ident` appears
outside of its context of definition, its instance, written under the
form :n:`{ {*; @ident := @term} }` is appending to its name, indicating
outside its context of definition, its instance, written in the
form :n:`{ {*; @ident := @term} }`, is appended to its name, indicating
how the variables of its defining context are instantiated.
The variables of the context of the existential variables which are
instantiated by themselves are not written, unless the :flag:`Printing Existential Instances` flag
is on (see Section :ref:`explicit-display-existentials`), and this is why an
existential variable used in the same context as its context of definition is written with no instance.
Only the variables that are defined in another context are displayed:
this is why an existential variable used in the same context as its
context of definition is written with no instance.
This behaviour may be changed: see :ref:`explicit-display-existentials`.

.. coqtop:: all

Check (fun x y => _) 0 1.

Set Printing Existential Instances.

Check (fun x y => _) 0 1.

Existential variables can be named by the user upon creation using
the syntax :n:`?[@ident]`. This is useful when the existential
variable needs to be explicitly handled later in the script (e.g.
Expand Down Expand Up @@ -88,6 +84,14 @@ Explicit displaying of existential instances for pretty-printing
context of an existential variable is instantiated at each of the
occurrences of the existential variable.

.. coqtop:: all

Check (fun x y => _) 0 1.

Set Printing Existential Instances.

Check (fun x y => _) 0 1.

.. _tactics-in-terms:

Solving existential variables using tactics
Expand Down
4 changes: 2 additions & 2 deletions doc/sphinx/language/extensions/implicit-arguments.rst
Expand Up @@ -70,7 +70,7 @@ is said *contextual* if it can be inferred only from the knowledge of
the type of the context of the current expression. For instance, the
only argument of::

nil : forall A:Set, list A`
nil : forall A:Set, list A

is contextual. Similarly, both arguments of a term of type::

Expand Down Expand Up @@ -539,7 +539,7 @@ with free variables into a closed statement where these variables are
quantified explicitly. Use the :cmd:`Generalizable` command to designate
which variables should be generalized.

It is activated for a binder by prefixing a \`, and for terms by
It is activated within a binder by prefixing it with \`, and for terms by
surrounding it with \`{ }, or \`[ ] or \`( ).

Terms surrounded by \`{ } introduce their free variables as maximally
Expand Down
2 changes: 1 addition & 1 deletion doc/sphinx/language/extensions/match.rst
Expand Up @@ -94,7 +94,7 @@ The expression :n:`let ( {*, @ident__i } ) := @term__0 in @term__1`
performs case analysis on :n:`@term__0` whose type must be an
inductive type with exactly one constructor. The number of variables
:n:`@ident__i` must correspond to the number of arguments of this
contrustor. Then, in :n:`@term__1`, these variables are bound to the
constructor. Then, in :n:`@term__1`, these variables are bound to the
arguments of the constructor in :n:`@term__0`. For instance, the
definition

Expand Down

0 comments on commit a5a4cbb

Please sign in to comment.