]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambda_delta/Ground_2/list.ma
- support for candidates of reducibility continues ...
[helm.git] / matita / matita / contribs / lambda_delta / Ground_2 / 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_2/arith.ma".
16 include "Ground_2/notation.ma".
17
18 (* LISTS ********************************************************************)
19
20 inductive list (A:Type[0]) : Type[0] :=
21   | nil : list A
22   | cons: A -> list A -> list A.
23
24 interpretation "nil (list)" 'Nil = (nil ?).
25
26 interpretation "cons (list)" 'Cons hd tl = (cons ? hd tl).
27
28 let rec all A (R:predicate A) (l:list A) on l ≝
29   match l with
30   [ nil        ⇒ True
31   | cons hd tl ⇒ R hd ∧ all A R tl
32   ].