Debian Codegraph @

test-suite/bugs/bug_2733.v

raw
1 Unset Asymmetric Patterns.
2
3 Definition goodid : forall {A} (x: A), A := fun A x => x.
4 Definition wrongid : forall A (x: A), A := fun {A} x => x.
5
6 Inductive ty := N | B.
7
8 Inductive alt_list : ty -> ty -> Type :=
9 | nil {k} : alt_list k k
10 | Ncons {k} : nat -> alt_list B k -> alt_list N k
11 | Bcons {k} : bool -> alt_list N k -> alt_list B k.
12
13 Definition trullynul k {k'} (l : alt_list k k') :=
14 match k,l with
15 |N,l' => Ncons 0 (Bcons true l')
16 |B,l' => Bcons true (Ncons 0 l')
17 end.
18
19 (* At some time, the success of trullynul was dependent on the name of
20 the variables! *)
21
22 Definition trullynul2 k {a} (l : alt_list k a) :=
23 match k,l with
24 |N,l' => Ncons 0 (Bcons true l')
25 |B,l' => Bcons true (Ncons 0 l')
26 end.
27
28 Definition trullynul3 k {z} (l : alt_list k z) :=
29 match k,l with
30 |N,l' => Ncons 0 (Bcons true l')
31 |B,l' => Bcons true (Ncons 0 l')
32 end.
33
34 Fixpoint app (P : forall {k k'}, alt_list k k' -> alt_list k k') {t1 t2} (l : alt_list t1 t2) {struct l}: forall {t3}, alt_list t2 t3 ->
35 alt_list t1 t3 :=
36 match l with
37 | nil => fun _ l2 => P l2
38 | Ncons n l1 => fun _ l2 => Ncons n (app (@P) l1 l2)
39 | Bcons b l1 => fun _ l2 => Bcons b (app (@P) l1 l2)
40 end.
41
42 Check (fun {t t'} (l: alt_list t t') =>
43 app trullynul (goodid l) (wrongid _ nil)).