Debian Codegraph @

test-suite/success/typing_flags.v

raw
1 From Corelib Require Import Program.Tactics.
2
3 (* Part using attributes *)
4
5 #[bypass_check(guard)] Fixpoint att_f' (n : nat) : nat := att_f' n.
6 #[bypass_check(guard)] Program Fixpoint p_att_f' (n : nat) : nat := p_att_f' n.
7
8 #[bypass_check(universes)] Definition att_T := let t := Type in (t : t).
9 #[bypass_check(universes)] Program Definition p_att_T := let t := Type in (t : t).
10
11 #[bypass_check(positivity)]
12 Inductive att_Cor :=
13 | att_Over : att_Cor
14 | att_Next : ((att_Cor -> list nat) -> list nat) -> att_Cor.
15
16 Fail #[bypass_check(guard=no)] Fixpoint f_att_f' (n : nat) : nat := f_att_f' n.
17 Fail #[bypass_check(universes=no)] Definition f_att_T := let t := Type in (t : t).
18
19 Fail #[bypass_check(positivity=no)]
20 Inductive f_att_Cor :=
21 | f_att_Over : f_att_Cor
22 | f_att_Next : ((f_att_Cor -> list nat) -> list nat) -> f_att_Cor.
23
24 Print Assumptions att_f'.
25 Print Assumptions att_T.
26 Print Assumptions att_Cor.
27
28 (* Interactive + atts *)
29 #[bypass_check(universes=yes)] Definition i_att_T' : Type. Proof. exact (let t := Type in (t : t)). Defined.
30 #[bypass_check(universes=yes)] Definition d_att_T' : Type. Proof. exact (let t := Type in (t : t)). Qed.
31 #[bypass_check(universes=yes)] Program Definition pi_att_T' : Type. Proof. exact (let t := Type in (t : t)). Qed.
32
33 (* Note: be aware of tactics invoking [Global.env()] if this test fails. *)
34 #[bypass_check(guard=yes)] Fixpoint i_att_f' (n : nat) : nat.
35 Proof. exact (i_att_f' n). Defined.
36
37 #[bypass_check(guard=yes)] Fixpoint d_att_f' (n : nat) : nat.
38 Proof. exact (d_att_f' n). Qed.
39
40 (* check regular mode is still safe *)
41 Fail Fixpoint f_att_f' (n : nat) : nat := f_att_f' n.
42 Fail Definition f_att_T := let t := Type in (t : t).
43
44 Fail Inductive f_att_Cor :=
45 | f_att_Over : f_att_Cor
46 | f_att_Next : ((f_att_Cor -> list nat) -> list nat) -> f_att_Cor.
47
48 (* Part using Set/Unset *)
49 Print Typing Flags.
50 Unset Guard Checking.
51 Fixpoint f' (n : nat) : nat := f' n.
52
53 Fixpoint f (n : nat) : nat.
54 Proof.
55 exact (f n).
56 Defined.
57
58 Fixpoint bla (A:Type) (n:nat) := match n with 0 =>0 | S n => n end.
59
60 Print Typing Flags.
61
62 Set Guard Checking.
63
64 Print Assumptions f.
65
66 Unset Universe Checking.
67
68 Definition T := Type.
69 Fixpoint g (n : nat) : T := T.
70
71 Print Typing Flags.
72 Set Universe Checking.
73
74 Fail Definition g2 (n : nat) : T := T.
75
76 Fail Definition e := fix e (n : nat) : nat := e n.
77
78 Unset Positivity Checking.
79
80 Inductive Cor :=
81 | Over : Cor
82 | Next : ((Cor -> list nat) -> list nat) -> Cor.
83
84 Set Positivity Checking.
85 Print Assumptions Cor.
86
87 Inductive Box :=
88 | box : forall n, f n = n -> g 2 -> Box.
89
90 Print Assumptions Box.
91
92 (** CoFixpoint *)
93
94 CoInductive Stream : Type := Cons : nat -> Stream -> Stream.
95 #[bypass_check(guard)] CoFixpoint f2 : Stream := f2.