Debian Codegraph @

test-suite/bugs/bug_1951.v

raw
1
2 (* First a simplification of the bug *)
3
4 Set Printing Universes.
5
6 Inductive enc (A:Type (*1*)) (* : Type.1 *) := C : A -> enc A.
7
8 Definition id (X:Type(*4*)) (x:X) := x.
9
10 Lemma test : let S := Type(*5 : 6*) in enc S -> S.
11 simpl; intros.
12 refine (enc _).
13 apply id.
14 apply Prop.
15 Defined.
16
17 (* Then the original bug *)
18
19 Require Import TestSuite.list.
20
21 Inductive a : Set := (* some dummy inductive *)
22 b : (list a) -> a. (* i don't know if this *)
23 (* happens for smaller *)
24 (* ones *)
25
26 Inductive sg : Type := Sg. (* single *)
27
28 Definition ipl2 (P : a -> Type) := (* in Prop, that means P is true forall *)
29 fold_right (fun x => fun A => prod (P x) A) sg. (* the elements of a given list *)
30
31 Definition ind
32 : forall S : a -> Type,
33 (forall ls : list a, ipl2 S ls -> S (b ls)) -> forall s : a, S s :=
34 fun (S : a -> Type)
35 (X : forall ls : list a, ipl2 S ls -> S (b ls)) =>
36 fix ind2 (s : a) :=
37 match s as a return (S a) with
38 | b l =>
39 X l
40 (list_rect (fun l0 : list a => ipl2 S l0) Sg
41 (fun (a0 : a) (l0 : list a) (IHl : ipl2 S l0) =>
42 pair (ind2 a0) IHl) l)
43 end. (* some induction principle *)
44
45 Arguments ind [S].
46
47 Lemma k : a -> Type. (* some ininteresting lemma *)
48 intro;pattern H;apply ind;intros.
49 assert (K : Type).
50 induction ls.
51 exact sg.
52 exact sg.
53 exact (prod K sg).
54 Defined.
55
56 Lemma k' : a -> Type. (* same lemma but with our bug *)
57 intro;pattern H;apply ind;intros.
58 refine (prod _ _).
59 induction ls.
60 exact sg.
61 exact sg.
62 exact sg. (* Proof complete *)
63 Defined. (* bug *)