Debian Codegraph @

test-suite/success/Case19.v

raw
1 (* This used to fail in Coq version 8.1 beta due to a non variable
2 universe (issued by template polymorphism) being sent by
3 pretyping to the kernel (bug #1182) *)
4
5 Parameter T : Type.
6 Parameter x : nat*nat.
7
8 Check let (_, _) := x in sigT (fun _ : T => nat).
9
10 (* This used to raise an anomaly in V8.4, up to pl2 *)
11
12 Goal {x: nat & x=x}.
13 Fail exists (fun x =>
14 match
15 projT2 (projT2 x) as e in (_ = y)
16 return _ = existT _ (projT1 x) (existT _ y e)
17 with
18 | eq_refl => eq_refl
19 end).
20 Abort.
21
22 (* Some tests with ltac matching on building "if" and "let" *)
23
24 Goal forall b c d, (if negb b then c else d) = 0.
25 intros.
26 match goal with
27 |- (if ?b then ?c else ?d) = 0 => transitivity (if b then d else c)
28 end.
29 Abort.
30
31 Definition swap {A} {B} '((x,y):A*B) := (y,x).
32
33 Goal forall p, (let '(x,y) := swap p in x + y) = 0.
34 intros.
35 match goal with
36 |- (let '(x,y) := ?p in x + y) = 0 => transitivity (let (x,y) := p in x+y)
37 end.
38 Abort.