]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/matita/contribs/ng_assembly/common/nat.ma
freescale porting, work in progress
[helm.git] / helm / software / matita / contribs / ng_assembly / common / nat.ma
index 874ab7d8c4d0ed53ffd1ccf006cdb80f3bc32862..9188bef9edb808b057ec00d08a563477d98124b9 100755 (executable)
@@ -15,8 +15,8 @@
 (* ********************************************************************** *)
 (*                          Progetto FreeScale                            *)
 (*                                                                        *)
-(*   Sviluppato da: Cosimo Oliboni, oliboni@cs.unibo.it                   *)
-(*     Cosimo Oliboni, oliboni@cs.unibo.it                                *)
+(*   Sviluppato da: Ing. Cosimo Oliboni, oliboni@cs.unibo.it              *)
+(*   Ultima modifica: 05/08/2009                                          *)
 (*                                                                        *)
 (* ********************************************************************** *)
 
@@ -26,15 +26,17 @@ include "num/bool.ma".
 (* NATURALI *)
 (* ******** *)
 
-inductive nat : Type ≝
+ninductive nat : Type ≝
   O : nat
 | S : nat → nat.
 
+(*
 interpretation "Natural numbers" 'N = nat.
 
 default "natural numbers" cic:/matita/common/nat/nat.ind.
 
 alias num (instance 0) = "natural number".
+*)
 
 nlet rec eq_nat (n1,n2:nat) on n1 ≝
  match n1 with
@@ -49,6 +51,20 @@ nlet rec le_nat n m ≝
    [ O ⇒ false | (S q) ⇒ le_nat p q ]
   ].
 
+interpretation "natural 'less or equal to'" 'leq x y = (le_nat x y).
+
+ndefinition lt_nat ≝ λn1,n2:nat.(le_nat n1 n2) ⊗ (⊖ (eq_nat n1 n2)).
+
+interpretation "natural 'less than'" 'lt x y = (lt_nat x y).
+
+ndefinition ge_nat ≝ λn1,n2:nat.(⊖ (le_nat n1 n2)) ⊕ (eq_nat n1 n2).
+
+interpretation "natural 'greater or equal to'" 'geq x y = (ge_nat x y).
+
+ndefinition gt_nat ≝ λn1,n2:nat.⊖ (le_nat n1 n2).
+
+interpretation "natural 'greater than'" 'gt x y = (gt_nat x y).
+
 nlet rec plus (n1,n2:nat) on n1 ≝ 
  match n1 with
   [ O ⇒ n2