]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/matita/contribs/LAMBDA-TYPES/tlt_defs.ma
ocaml 3.09 transition
[helm.git] / helm / matita / contribs / LAMBDA-TYPES / tlt_defs.ma
index f2bf3660d561341ff17e08f4d4b977e223cc635a..390c067cc15823721e09fdf7f81653f2f1e2a9c1 100644 (file)
@@ -23,29 +23,31 @@ definition wadd: (nat \to nat) \to nat \to (nat \to nat) \def
       | (S m) \Rightarrow (map m)
    ].
 
-let rec weight_map (A:Set) (N:Set) (map:nat \to nat) (t:T) : nat \def 
+let rec weight_map (A:Set) (N:Set) (map:nat \to nat) (t:T A N) on t : nat \def 
    match t with [
-        (TSort A N y k)     \Rightarrow O
-      | (TLRef A N y i)     \Rightarrow (map i)
-      | (TWag A N y z w u) \Rightarrow
+        (TSort y k)     \Rightarrow O
+      | (TLRef y i)     \Rightarrow (map i)
+      | (TWag y z w u) \Rightarrow
          match z with [
               (Bind b) \Rightarrow
                  match b with [
                       Abbr \Rightarrow
-                        (S (plus (weight_map A N map w) (weight_map A N (wadd map (S (weight_map A N map w))) u)))
+                        (S ((weight_map A N map w) + (weight_map A N (wadd map (S (weight_map A N map w))) u)))
                     | Abst \Rightarrow 
-                        (S (plus (weight_map A N map w) (weight_map A N (wadd map O) u)))
+                        (S ((weight_map A N map w) + (weight_map A N (wadd map O) u)))
                     | Void \Rightarrow 
-                        (S (plus (weight_map A N map w) (weight_map A N (wadd map O) u)))
+                        (S ((weight_map A N map w) + (weight_map A N (wadd map O) u)))
                  ]
             | (Flat a) \Rightarrow
-                 (S (plus (weight_map A N map w) (weight_map A N map u)))
-         ]].(*
-      | (TGRef A N y n)     \Rightarrow O
-  ].*)
-(*
-      Definition weight : T \to nat := (weight_map [_](0)).
+                 (S ((weight_map A N map w) + (weight_map A N map u)))
+         ]
+      | (TGRef y n)     \Rightarrow O
+  ].
 
-      Definition tlt : T \to T \to Prop := [t1,t2](lt (weight t1) (weight t2)).
+definition weight: \forall A,N. T A N \to nat \def 
+   \lambda A,N. 
+   (weight_map A N (\lambda _.O)).
 
-*)
+definition tlt: \forall A,N. T A N \to T A N \to Prop \def 
+   \lambda A,N,t1,t2. 
+   weight A N t1 < weight A N t2.