aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThéo Zimmermann2019-10-30 17:06:26 +0100
committerThéo Zimmermann2019-10-30 17:19:43 +0100
commit201f31d3cdb1cd30646a622ec4b46d7cbcb24e20 (patch)
tree970780495e121975d767e2fad4166d698883de82
parentd7bacbba67e9242faa24bc6ff34dede1dbe30ed3 (diff)
[refman] Add a second example of contradiction when positivity checking is disabled.
-rw-r--r--doc/sphinx/language/cic.rst27
1 files changed, 26 insertions, 1 deletions
diff --git a/doc/sphinx/language/cic.rst b/doc/sphinx/language/cic.rst
index b8c1c523b7..ef896b6f03 100644
--- a/doc/sphinx/language/cic.rst
+++ b/doc/sphinx/language/cic.rst
@@ -1046,7 +1046,7 @@ between universes for inductive types in the Type hierarchy.
exT_intro : forall X:Type, P X -> exType P.
-.. example:: Negative occurrence
+.. example:: Negative occurrence (first example)
The following inductive definition is rejected because it does not
satisfy the positivity condition:
@@ -1079,6 +1079,31 @@ between universes for inductive types in the Type hierarchy.
intro; now apply I_not_I.
Qed.
+.. example:: Negative occurrence (second example)
+
+ Here is another example of an inductive definition which is
+ rejected because it does not satify the positivity condition:
+
+ .. coqtop:: all
+
+ Fail Inductive Lam := lam (_ : Lam -> Lam).
+
+ Again, if we were to accept it, we could derive a contradiction
+ (this time through a non-terminating recursive function):
+
+ .. coqtop:: none
+
+ Unset Positivity Checking.
+ Inductive Lam := lam (_ : Lam -> Lam).
+ Set Positivity Checking.
+
+ .. coqtop:: all
+
+ Fixpoint infinite_loop l : False :=
+ match l with lam x => infinite_loop (x l) end.
+
+ Check infinite_loop (lam (@id Lam)) : False.
+
.. _Template-polymorphism:
Template polymorphism