Debian Codegraph @

test-suite/bugs/bug_3700.v

raw
1
2 Set Implicit Arguments.
3 Module NonPrim.
4 Unset Primitive Projections.
5 Record prod A B := pair { fst : A ; snd : B }.
6 End NonPrim.
7 Module Prim.
8 Set Primitive Projections.
9 Record prod A B := pair { fst : A ; snd : B }.
10 End Prim.
11 Goal (forall x : NonPrim.prod Set Set, let (a, b) := x in a = a)
12 /\ (forall x : Prim.prod Set Set, let (a, b) := x in a = a).
13 Show. (* (forall x : NonPrim.prod Set Set, let (a, _) := x in a = a) /\
14 (forall x : Prim.prod Set Set,
15 let a := Prim.fst x in let b := Prim.snd x in a = a) *)
16 Set Printing All.
17 Show. (* and
18 (forall x : NonPrim.prod Set Set,
19 match x return Prop with
20 | NonPrim.pair a _ => @eq Set a a
21 end)
22 (forall x : Prim.prod Set Set,
23 let a := @Prim.fst Set Set x in
24 let b := @Prim.snd Set Set x in @eq Set a a) *)
25 Unset Printing All.
26 Abort.
27 Goal (forall x : NonPrim.prod Set Set, match x with NonPrim.pair a b => a = a end)
28 /\ (forall x : Prim.prod Set Set, match x with Prim.pair a b => a = a end).
29 Show. (* (forall x : NonPrim.prod Set Set,
30 match x with
31 | {| NonPrim.fst := a |} => a = a
32 end) /\ (forall x : Prim.prod Set Set, Prim.fst x = Prim.fst x) *)
33 (** Wrong: [match] should generate unfolded things *)
34 Set Printing All.
35 Show. (* and
36 (forall x : NonPrim.prod Set Set,
37 match x return Prop with
38 | NonPrim.pair a _ => @eq Set a a
39 end)
40 (forall x : Prim.prod Set Set,
41 @eq Set (@Prim.fst Set Set x) (@Prim.fst Set Set x)) *)
42 Unset Printing All.
43 Abort.
44 Goal (forall x : NonPrim.prod Set Set, let (a, b) := x in a = a /\ b = b)
45 /\ (forall x : Prim.prod Set Set, let (a, b) := x in a = a /\ b = b).
46 Show. (* (forall x : NonPrim.prod Set Set, let (a, b) := x in a = a /\ b = b) /\
47 (forall x : Prim.prod Set Set,
48 let a := Prim.fst x in let b := Prim.snd x in a = a /\ b = b) *)
49 (** Understandably different, maybe, but should still be unfolded *)
50 Set Printing All.
51 Show. (* and
52 (forall x : NonPrim.prod Set Set,
53 match x return Prop with
54 | NonPrim.pair a b => and (@eq Set a a) (@eq Set b b)
55 end)
56 (forall x : Prim.prod Set Set,
57 let a := @Prim.fst Set Set x in
58 let b := @Prim.snd Set Set x in and (@eq Set a a) (@eq Set b b)) *)
59 Unset Printing All.
60 Abort.
61 Goal (forall x : NonPrim.prod Set Set, match x with NonPrim.pair a b => a = a /\ b = b end)
62 /\ (forall x : Prim.prod Set Set, match x with Prim.pair a b => a = a /\ b = b end).
63 Show. (* (forall x : NonPrim.prod Set Set,
64 match x with
65 | {| NonPrim.fst := a; NonPrim.snd := b |} => a = a /\ b = b
66 end) /\
67 (forall x : Prim.prod Set Set,
68 Prim.fst x = Prim.fst x /\ Prim.snd x = Prim.snd x) *)
69 Set Printing All.
70 Show.
71
72 set(foo:=forall x : Prim.prod Set Set, match x return Set with
73 | Prim.pair fst _ => fst
74 end).
75 (* and
76 (forall x : NonPrim.prod Set Set,
77 match x return Prop with
78 | NonPrim.pair a b => and (@eq Set a a) (@eq Set b b)
79 end)
80 (forall x : Prim.prod Set Set,
81 and (@eq Set (@Prim.fst Set Set x) (@Prim.fst Set Set x))
82 (@eq Set (@Prim.snd Set Set x) (@Prim.snd Set Set x))) *)
83 Unset Printing All.
84 Abort.