diff options
| author | Vincent Laporte | 2019-05-10 08:48:54 +0000 |
|---|---|---|
| committer | Vincent Laporte | 2019-05-10 16:06:11 +0000 |
| commit | 4895bf8bb5d0acfaee499991973fc6537657427d (patch) | |
| tree | 4bb22f9d2c04445655bbd0c4df6daccabfeb4ffd | |
| parent | 34e84eafe6615055071fbdc4aaee70c4c161a0fb (diff) | |
[refman] Mention the `#[canonical(false)]` attribute
| -rw-r--r-- | doc/sphinx/language/gallina-extensions.rst | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/doc/sphinx/language/gallina-extensions.rst b/doc/sphinx/language/gallina-extensions.rst index 5308330820..ba766c8c3d 100644 --- a/doc/sphinx/language/gallina-extensions.rst +++ b/doc/sphinx/language/gallina-extensions.rst @@ -2048,6 +2048,21 @@ in :ref:`canonicalstructures`; here only a simple example is given. If a same field occurs in several canonical structures, then only the structure declared first as canonical is considered. + .. note:: + To prevent a field from being involved in the inference of canonical instances, + its declaration can be annotated with the :g:`#[canonical(false)]` attribute. + + .. example:: + + For instance, when declaring the :g:`Setoid` structure above, the + :g:`Prf_equiv` field declaration could be written as follows. + + .. coqdoc:: + + #[canonical(false)] Prf_equiv : equivalence Carrier Equal + + See :ref:`canonicalstructures` for a more realistic example. + .. cmdv:: Canonical {? Structure } @ident {? : @type } := @term This is equivalent to a regular definition of :token:`ident` followed by the @@ -2067,6 +2082,10 @@ in :ref:`canonicalstructures`; here only a simple example is given. Print Canonical Projections. + .. note:: + + The last line would not show up if the corresponding projection (namely + :g:`Prf_equiv`) were annotated as not canonical, as described above. Implicit types of variables ~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
