]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/ground/lib/list.ma
propagating the arithmetics library, partial commit
[helm.git] / matita / matita / contribs / lambdadelta / ground / lib / list.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/notation/functions/circledE_1.ma".
16 include "ground/notation/functions/oplusright_3.ma".
17 include "ground/lib/relations.ma".
18
19 (* LISTS ********************************************************************)
20
21 inductive list (A:Type[0]) : Type[0] :=
22 | list_nil : list A
23 | list_cons: A → list A → list A
24 .
25
26 interpretation
27   "nil (lists)"
28   'CircledE A = (list_nil A).
29
30 interpretation
31   "cons (lists)"
32   'OPlusRight A hd tl = (list_cons A hd tl).
33
34 rec definition list_all A (R:predicate A) (l:list A) on l ≝
35 match l with
36 [ list_nil        ⇒ ⊤
37 | list_cons hd tl ⇒ ∧∧ R hd & list_all A R tl
38 ].