aboutsummaryrefslogtreecommitdiff
path: root/theories/Init
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2018-12-20 14:57:17 +0100
committerPierre-Marie Pédrot2018-12-20 14:57:17 +0100
commit8d41928c9f0bb54ed41e3ab0d7a6f76d556bb588 (patch)
tree80cacb02f1e8785c30ce2fd7fe662a5efa1c2cba /theories/Init
parent525d174b6e6f966e95b3c1f649c8b83ef52abd75 (diff)
parent0a25e351d6a2d25e5d82b165843a09a2804fadc6 (diff)
Merge PR #8488: Warning when using automatic template polymorphism
Diffstat (limited to 'theories/Init')
-rw-r--r--theories/Init/Datatypes.v5
-rw-r--r--theories/Init/Specif.v5
2 files changed, 10 insertions, 0 deletions
diff --git a/theories/Init/Datatypes.v b/theories/Init/Datatypes.v
index 7f0387dd12..3603604a71 100644
--- a/theories/Init/Datatypes.v
+++ b/theories/Init/Datatypes.v
@@ -167,6 +167,7 @@ Register S as num.nat.S.
(** [option A] is the extension of [A] with an extra element [None] *)
+#[universes(template)]
Inductive option (A:Type) : Type :=
| Some : A -> option A
| None : option A.
@@ -186,6 +187,7 @@ Definition option_map (A B:Type) (f:A->B) (o : option A) : option B :=
(** [sum A B], written [A + B], is the disjoint sum of [A] and [B] *)
+#[universes(template)]
Inductive sum (A B:Type) : Type :=
| inl : A -> sum A B
| inr : B -> sum A B.
@@ -198,6 +200,7 @@ Arguments inr {A B} _ , A [B] _.
(** [prod A B], written [A * B], is the product of [A] and [B];
the pair [pair A B a b] of [a] and [b] is abbreviated [(a,b)] *)
+#[universes(template)]
Inductive prod (A B:Type) : Type :=
pair : A -> B -> A * B
@@ -256,6 +259,7 @@ Defined.
(** Polymorphic lists and some operations *)
+#[universes(template)]
Inductive list (A : Type) : Type :=
| nil : list A
| cons : A -> list A -> list A.
@@ -384,6 +388,7 @@ Proof. intros. apply CompareSpec2Type; assumption. Defined.
member is the singleton datatype [identity A a a] whose
sole inhabitant is denoted [identity_refl A a] *)
+#[universes(template)]
Inductive identity (A:Type) (a:A) : A -> Type :=
identity_refl : identity a a.
Hint Resolve identity_refl: core.
diff --git a/theories/Init/Specif.v b/theories/Init/Specif.v
index e4796a8059..cfba2bae69 100644
--- a/theories/Init/Specif.v
+++ b/theories/Init/Specif.v
@@ -24,6 +24,7 @@ Require Import Logic.
Similarly [(sig2 A P Q)], or [{x:A | P x & Q x}], denotes the subset
of elements of the type [A] which satisfy both [P] and [Q]. *)
+#[universes(template)]
Inductive sig (A:Type) (P:A -> Prop) : Type :=
exist : forall x:A, P x -> sig P.
@@ -31,12 +32,14 @@ Register sig as core.sig.type.
Register exist as core.sig.intro.
Register sig_rect as core.sig.rect.
+#[universes(template)]
Inductive sig2 (A:Type) (P Q:A -> Prop) : Type :=
exist2 : forall x:A, P x -> Q x -> sig2 P Q.
(** [(sigT A P)], or more suggestively [{x:A & (P x)}] is a Sigma-type.
Similarly for [(sigT2 A P Q)], also written [{x:A & (P x) & (Q x)}]. *)
+#[universes(template)]
Inductive sigT (A:Type) (P:A -> Type) : Type :=
existT : forall x:A, P x -> sigT P.
@@ -44,6 +47,7 @@ Register sigT as core.sigT.type.
Register existT as core.sigT.intro.
Register sigT_rect as core.sigT.rect.
+#[universes(template)]
Inductive sigT2 (A:Type) (P Q:A -> Type) : Type :=
existT2 : forall x:A, P x -> Q x -> sigT2 P Q.
@@ -700,6 +704,7 @@ Register sumbool as core.sumbool.type.
(** [sumor] is an option type equipped with the justification of why
it may not be a regular value *)
+#[universes(template)]
Inductive sumor (A:Type) (B:Prop) : Type :=
| inleft : A -> A + {B}
| inright : B -> A + {B}