]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/ground_2/lib/list2.ma
notational update in lambdadelta completed
[helm.git] / matita / matita / contribs / lambdadelta / ground_2 / lib / list2.ma
1 (**************************************************************************)
2 (*       ___                                                              *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||         The HELM team.                                      *)
8 (*      ||A||         http://helm.cs.unibo.it                             *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU General Public License Version 2                  *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15 include "ground_2/notation/constructors/nil_0.ma".
16 include "ground_2/notation/constructors/oplusright_5.ma".
17 include "ground_2/lib/arith.ma".
18
19 (* LISTS OF PAIRS ***********************************************************)
20
21 inductive list2 (A1,A2:Type[0]) : Type[0] :=
22   | nil2 : list2 A1 A2
23   | cons2: A1 → A2 → list2 A1 A2 → list2 A1 A2.
24
25 interpretation "nil (list of pairs)" 'Nil = (nil2 ? ?).
26
27 interpretation "cons (list of pairs)"
28   'OPlusRight A1 A2 hd1 hd2 tl = (cons2 A1 A2 hd1 hd2 tl).
29
30 rec definition length2 A1 A2 (l:list2 A1 A2) on l ≝ match l with
31 [ nil2        ⇒ 0
32 | cons2 _ _ l ⇒ ↑(length2 A1 A2 l)
33 ].
34
35 interpretation "length (list of pairs)"
36    'card l = (length2 ? ? l).