Debian Codegraph @

test-suite/failure/positivity.v

raw
1 (************************************************************************)
2 (* * The Rocq Prover / The Rocq Development Team *)
3 (* v * Copyright INRIA, CNRS and contributors *)
4 (* <O___,, * (see version control and CREDITS file for authors & dates) *)
5 (* \VV/ **************************************************************)
6 (* // * This file is distributed under the terms of the *)
7 (* * GNU Lesser General Public License Version 2.1 *)
8 (* * (see LICENSE file for the text of the license) *)
9 (************************************************************************)
10
11 (* Negative occurrence *)
12 Fail Inductive t : Type :=
13 c : (t -> nat) -> t.
14
15 (* Non-strictely positive occurrence *)
16 Fail Inductive t : Type :=
17 c : ((t -> nat) -> nat) -> t.
18
19 (* Self-nested type (no proof of
20 soundness yet *)
21 Fail Inductive t (A:Type) : Type :=
22 c : t (t A) -> t A.
23
24 (* Nested inductive types *)
25
26 Inductive pos (A:Type) :=
27 p : pos A -> pos A.
28
29 Inductive nnpos (A:Type) :=
30 nnp : ((A -> nat) -> nat) -> nnpos A.
31
32 Inductive neg (A:Type) :=
33 n : (A->neg A) -> neg A.
34
35 Inductive arg : Type -> Prop :=
36 a : forall A, arg A -> arg A.
37
38 (* Strictly covariant parameter: accepted. *)
39 Fail Fail Inductive t :=
40 c : pos t -> t.
41
42 (* Non-strictly covariant parameter: not
43 strictly positive. *)
44 Fail Inductive t :=
45 c : nnpos t -> t.
46
47 (* Contravariant parameter: not positive. *)
48 Fail Inductive t :=
49 c : neg t -> t.
50
51 (* Strict index: not positive. *)
52 Fail Inductive t :=
53 c : arg t -> t.