aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2019-11-16 15:09:17 +0100
committerPierre-Marie Pédrot2019-11-16 15:09:17 +0100
commit64265294b519d7cd9f982edf24991c7f210933a9 (patch)
treeaa058ca9c2ecc32162ec0f0d4cf721f19ae95cf8 /doc
parent6045fcf7398c4098566f7da5c4cba808c7416788 (diff)
parent95c47ad501bdfb996858c64eee1b4545ef3f5acb (diff)
Merge PR #10996: Refine Instance returns
Reviewed-by: Zimmi48 Reviewed-by: ejgallego Reviewed-by: ppedrot
Diffstat (limited to 'doc')
-rw-r--r--doc/changelog/02-specification-language/10996-refine-instance-returns.rst4
-rw-r--r--doc/sphinx/addendum/type-classes.rst19
2 files changed, 20 insertions, 3 deletions
diff --git a/doc/changelog/02-specification-language/10996-refine-instance-returns.rst b/doc/changelog/02-specification-language/10996-refine-instance-returns.rst
new file mode 100644
index 0000000000..cd1a692f54
--- /dev/null
+++ b/doc/changelog/02-specification-language/10996-refine-instance-returns.rst
@@ -0,0 +1,4 @@
+- Added ``#[refine]`` attribute for :cmd:`Instance`, a more
+ predictable version of the old ``Refine Instance Mode`` which
+ unconditionally opens a proof (`#10996
+ <https://github.com/coq/coq/pull/10996>`_, by Gaëtan Gilbert).
diff --git a/doc/sphinx/addendum/type-classes.rst b/doc/sphinx/addendum/type-classes.rst
index 1bbf988505..57a2254100 100644
--- a/doc/sphinx/addendum/type-classes.rst
+++ b/doc/sphinx/addendum/type-classes.rst
@@ -47,9 +47,22 @@ Leibniz equality on some type. An example implementation is:
| tt, tt => eq_refl tt
end }.
-Using :cmd:`Program Instance`, if one does not give all the members in
-the Instance declaration, Coq generates obligations for the remaining
-fields, e.g.:
+Using the attribute ``refine``, if the term is not sufficient to
+finish the definition (e.g. due to a missing field or non-inferable
+hole) it must be finished in proof mode. If it is sufficient a trivial
+proof mode with no open goals is started.
+
+.. coqtop:: in
+
+ #[refine] Instance unit_EqDec' : EqDec unit := { eqb x y := true }.
+ Proof. intros [] [];reflexivity. Defined.
+
+Note that if you finish the proof with :cmd:`Qed` the entire instance
+will be opaque, including the fields given in the initial term.
+
+Alternatively, in :flag:`Program Mode` if one does not give all the
+members in the Instance declaration, Coq generates obligations for the
+remaining fields, e.g.:
.. coqtop:: in