aboutsummaryrefslogtreecommitdiff
path: root/doc/sphinx/proof-engine
diff options
context:
space:
mode:
authorGaëtan Gilbert2019-08-20 12:50:18 +0200
committerGaëtan Gilbert2019-08-20 12:50:18 +0200
commit9e1f8009141345f3232947c1d356b5def4ca7263 (patch)
tree6f0f7b0e4f34822035ce8ab819f8c5b93eca806d /doc/sphinx/proof-engine
parent92f38826f767db01dbc51f2372b23e7b4e3b1aaa (diff)
parentd6d8229dd8d71cf8cac1d116426bf772a9b8821b (diff)
Merge PR #10291: Controlling typing flags with commands (no attribute)
Reviewed-by: SkySkimmer Reviewed-by: Zimmi48
Diffstat (limited to 'doc/sphinx/proof-engine')
-rw-r--r--doc/sphinx/proof-engine/vernacular-commands.rst73
1 files changed, 73 insertions, 0 deletions
diff --git a/doc/sphinx/proof-engine/vernacular-commands.rst b/doc/sphinx/proof-engine/vernacular-commands.rst
index 774732825a..c391cc949d 100644
--- a/doc/sphinx/proof-engine/vernacular-commands.rst
+++ b/doc/sphinx/proof-engine/vernacular-commands.rst
@@ -1204,6 +1204,79 @@ Controlling the locality of commands
occurs in a section. The :cmd:`Set` and :cmd:`Unset` commands belong to this
category.
+.. _controlling-typing-flags:
+
+Controlling Typing Flags
+----------------------------
+
+.. flag:: Guard Checking
+
+ This option can be used to enable/disable the guard checking of
+ fixpoints. Warning: this can break the consistency of the system, use at your
+ own risk. Decreasing argument can still be specified: the decrease is not checked
+ anymore but it still affects the reduction of the term. Unchecked fixpoints are
+ printed by :cmd:`Print Assumptions`.
+
+.. flag:: Positivity Checking
+
+ This option can be used to enable/disable the positivity checking of inductive
+ types and the productivity checking of coinductive types. Warning: this can
+ break the consistency of the system, use at your own risk. Unchecked
+ (co)inductive types are printed by :cmd:`Print Assumptions`.
+
+.. flag:: Universe Checking
+
+ This option can be used to enable/disable the checking of universes, providing a
+ form of "type in type". Warning: this breaks the consistency of the system, use
+ at your own risk. Constants relying on "type in type" are printed by
+ :cmd:`Print Assumptions`. It has the same effect as `-type-in-type` command line
+ argument (see :ref:`command-line-options`).
+
+.. cmd:: Print Typing Flags
+
+ Print the status of the three typing flags: guard checking, positivity checking
+ and universe checking.
+
+.. example::
+
+ .. coqtop:: all reset
+
+ Unset Guard Checking.
+
+ Print Typing Flags.
+
+ Fixpoint f (n : nat) : False
+ := f n.
+
+ Fixpoint ackermann (m n : nat) {struct m} : nat :=
+ match m with
+ | 0 => S n
+ | S m =>
+ match n with
+ | 0 => ackermann m 1
+ | S n => ackermann m (ackermann (S m) n)
+ end
+ end.
+
+ Print Assumptions ackermann.
+
+ Note that the proper way to define the Ackermann function is to use
+ an inner fixpoint:
+
+ .. coqtop:: all reset
+
+ Fixpoint ack m :=
+ fix ackm n :=
+ match m with
+ | 0 => S n
+ | S m' =>
+ match n with
+ | 0 => ack m' 1
+ | S n' => ack m' (ackm n')
+ end
+ end.
+
+
.. _internal-registration-commands:
Internal registration commands