]> matita.cs.unibo.it Git - helm.git/commitdiff
Aggiornamento alla negazione.
authorAndrea Asperti <andrea.asperti@unibo.it>
Wed, 17 Mar 2010 11:48:50 +0000 (11:48 +0000)
committerAndrea Asperti <andrea.asperti@unibo.it>
Wed, 17 Mar 2010 11:48:50 +0000 (11:48 +0000)
helm/software/matita/nlibrary/basics/list.ma
helm/software/matita/nlibrary/basics/list2.ma [new file with mode: 0644]

index 92eddc705b642fb8f984d55c2aea81dc62d68cb1..d30ed7dfc2a4833f503224f940b7d37c2a866392 100644 (file)
@@ -39,7 +39,7 @@ ndefinition not_nil: ∀A:Type.list A → Prop ≝
 
 ntheorem nil_cons:
   ∀A:Type.∀l:list A.∀a:A. a::l ≠ [].
-  #A; #l; #a; #Heq; nchange with (not_nil ? (a::l));
+  #A; #l; #a; napply nmk; #Heq; nchange with (not_nil ? (a::l));
   nrewrite > Heq; //;
 nqed.
 
diff --git a/helm/software/matita/nlibrary/basics/list2.ma b/helm/software/matita/nlibrary/basics/list2.ma
new file mode 100644 (file)
index 0000000..1dd62c1
--- /dev/null
@@ -0,0 +1,30 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||M||                                                             *)
+(*      ||A||       A project by Andrea Asperti                           *)
+(*      ||T||                                                             *)
+(*      ||I||       Developers:                                           *)
+(*      ||T||         The HELM team.                                      *)
+(*      ||A||         http://helm.cs.unibo.it                             *)
+(*      \   /                                                             *)
+(*       \ /        This file is distributed under the terms of the       *)
+(*        v         GNU General Public License Version 2                  *)
+(*                                                                        *)
+(**************************************************************************)
+
+include "basics/list.ma".
+include "arithmetics/nat.ma".
+
+nlet rec length (A:Type) (l:list A) on l ≝ 
+  match l with 
+    [ nil ⇒ 0
+    | cons a tl ⇒ S (length A tl)].
+
+notation "|M|" non associative with precedence 60 for @{'norm $M}.
+interpretation "norm" 'norm l = (length ? l).
+
+nlet rec nth n (A:Type) (l:list A) (d:A)  ≝  
+  match n with
+    [O ⇒ hd A l d
+    |S m ⇒ nth m A (tail A l) d].
+