Debian Codegraph @

test-suite/success/Case4.v

raw
1 Inductive listn : nat -> Set :=
2 | niln : listn 0
3 | consn : forall n : nat, nat -> listn n -> listn (S n).
4
5 Inductive empty : forall n : nat, listn n -> Prop :=
6 intro_empty : empty 0 niln.
7
8 Parameter
9 inv_empty : forall (n a : nat) (l : listn n), ~ empty (S n) (consn n a l).
10
11 Type
12 (fun (n : nat) (l : listn n) =>
13 match l in (listn n) return (empty n l \/ ~ empty n l) with
14 | niln => or_introl (~ empty 0 niln) intro_empty
15 | consn n O y as b => or_intror (empty (S n) b) (inv_empty n 0 y)
16 | consn n a y as b => or_intror (empty (S n) b) (inv_empty n a y)
17 end).
18
19
20 Type
21 (fun (n : nat) (l : listn n) =>
22 match l in (listn n) return (empty n l \/ ~ empty n l) with
23 | niln => or_introl (~ empty 0 niln) intro_empty
24 | consn n O y => or_intror (empty (S n) (consn n 0 y)) (inv_empty n 0 y)
25 | consn n a y => or_intror (empty (S n) (consn n a y)) (inv_empty n a y)
26 end).
27
28 Type
29 (fun (n : nat) (l : listn n) =>
30 match l in (listn n) return (empty n l \/ ~ empty n l) with
31 | niln => or_introl (~ empty 0 niln) intro_empty
32 | consn O a y as b => or_intror (empty 1 b) (inv_empty 0 a y)
33 | consn n a y as b => or_intror (empty (S n) b) (inv_empty n a y)
34 end).