]> matita.cs.unibo.it Git - helm.git/blobdiff - matita/matita/contribs/lambdadelta/ground_2/lib/list.ma
syntactic components detached from basic_2 become static_2
[helm.git] / matita / matita / contribs / lambdadelta / ground_2 / lib / list.ma
index 9355f9c56185175fa263fba844548e432a7672f9..fb643311a4a5082d5f0483ae77315f9af01623f2 100644 (file)
 (*                                                                        *)
 (**************************************************************************)
 
-include "ground_2/notation/constructors/nil_0.ma".
-include "ground_2/notation/constructors/cons_2.ma".
-include "ground_2/notation/constructors/cons_3.ma".
-include "ground_2/notation/functions/append_2.ma".
-include "ground_2/lib/arith.ma".
+include "ground_2/notation/functions/circledE_1.ma".
+include "ground_2/notation/functions/oplusright_3.ma".
+include "ground_2/lib/relations.ma".
 
 (* LISTS ********************************************************************)
 
@@ -24,36 +22,12 @@ inductive list (A:Type[0]) : Type[0] :=
   | nil : list A
   | cons: A → list A → list A.
 
-interpretation "nil (list)" 'Nil = (nil ?).
+interpretation "nil (list)" 'CircledE A = (nil A).
 
-interpretation "cons (list)" 'Cons hd tl = (cons ? hd tl).
+interpretation "cons (list)" 'OPlusRight A hd tl = (cons A hd tl).
 
-let rec all A (R:predicate A) (l:list A) on l ≝
+rec definition all A (R:predicate A) (l:list A) on l ≝
   match l with
   [ nil        ⇒ ⊤
-  | cons hd tl ⇒ R hd ∧ all A R tl
+  | cons hd tl ⇒ ∧∧ R hd & all A R tl
   ].
-
-inductive list2 (A1,A2:Type[0]) : Type[0] :=
-  | nil2 : list2 A1 A2
-  | cons2: A1 → A2 → list2 A1 A2 → list2 A1 A2.
-
-interpretation "nil (list of pairs)" 'Nil = (nil2 ? ?).
-
-interpretation "cons (list of pairs)" 'Cons hd1 hd2 tl = (cons2 ? ? hd1 hd2 tl).
-
-let rec append2 (A1,A2:Type[0]) (l1,l2:list2 A1 A2) on l1 ≝ match l1 with
-[ nil2           ⇒ l2
-| cons2 a1 a2 tl ⇒ {a1, a2} @ append2 A1 A2 tl l2
-].
-
-interpretation "append (list of pairs)"
-   'Append l1 l2 = (append2 ? ? l1 l2).
-
-let rec length2 (A1,A2:Type[0]) (l:list2 A1 A2) on l ≝ match l with
-[ nil2        ⇒ 0
-| cons2 _ _ l ⇒ length2 A1 A2 l + 1
-].
-
-interpretation "length (list of pairs)"
-   'card l = (length2 ? ? l).