Debian Codegraph @

test-suite/ssr/ipat_seed.v

raw
1 Require Import ssreflect.
2
3 Section foo.
4
5 Variable A : Type.
6
7 Record bar (X : Type) := mk_bar {
8 a : X * A;
9 b : A;
10 c := (a,7);
11 _ : X;
12 _ : X
13 }.
14
15 Inductive baz (X : Type) (Y : Type) : nat -> Type :=
16 | K1 x (e : 0=1) (f := 3) of x=x:>X : baz X Y O
17 | K2 n of n=n & baz X nat 0 : baz X Y (n+1).
18
19 Axiom Q : nat -> Prop.
20 Axiom Qx : forall x, Q x.
21 Axiom my_ind :
22 forall P : nat -> Prop, P O -> (forall n m (w : P n /\ P m), P (n+m)) ->
23 forall w, P w.
24
25 Lemma test x : bar nat -> baz nat nat x -> forall n : nat, Q n.
26 Proof.
27
28 (* record *)
29 move => [^~ _ccc ].
30 Check (refl_equal _ : c_ccc = (a_ccc, 7)).
31
32 (* inductive *)
33 move=> [^ xxx_ ].
34 Check (refl_equal _ : xxx_f = 3).
35 by [].
36 Check (refl_equal _ : xxx_n = xxx_n).
37
38 (* eliminator *)
39 elim/my_ind => [^ wow_ ].
40 exact: Qx 0.
41 Check (wow_w : Q wow_n /\ Q wow_m).
42 exact: Qx (wow_n + wow_m).
43
44 Qed.
45
46 Arguments mk_bar A x y z w : rename.
47 Arguments K1 A B a b c : rename.
48
49
50 Lemma test2 x : bar nat -> baz nat nat x -> forall n : nat, Q n.
51 Proof.
52 move=> [^~ _ccc ].
53 Check (refl_equal _ : c_ccc = (x_ccc, 7)).
54 move=> [^ xxx_ ].
55 Check (refl_equal _ : xxx_f = 3).
56 by [].
57 Check (refl_equal _ : xxx_n = xxx_n).
58 Abort.
59
60 End foo.