]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/matita/library/list/list.ma
ocaml 3.09 transition
[helm.git] / helm / matita / library / list / list.ma
index 1973dadab299683c4d775d2d409cdc764843faf4..d5664f4166c783914af3be60f1d60bc25a008a79 100644 (file)
@@ -36,6 +36,8 @@ interpretation "nil" 'nil = (cic:/matita/list/list.ind#xpointer(1/1/1) _).
 interpretation "cons" 'cons hd tl =
   (cic:/matita/list/list.ind#xpointer(1/1/2) _ hd tl).
 
+(* theorem test_notation: [O; S O; S (S O)] = O :: S O :: S (S O) :: []. *)
+
 theorem nil_cons:
   \forall A:Set.\forall l:list A.\forall a:A.
     a::l <> [].
@@ -54,6 +56,11 @@ let rec append A (l1: list A) l2 on l1 :=
   [ nil => l2
   | (cons hd tl) => hd :: append A tl l2 ].
 
+definition tail := \lambda A:Set. \lambda l: list A.
+  match l with
+  [ nil => []
+  | (cons hd tl) => tl].
+
 interpretation "append" 'append l1 l2 = (cic:/matita/list/append.con _ l1 l2).
 
 theorem append_nil: \forall A:Set.\forall l:list A.l @ [] = l.