]> matita.cs.unibo.it Git - helm.git/blob - matita/contribs/LAMBDA-TYPES/LambdaDelta-1/tlt/defs.ma
tagged 0.5.0-rc1
[helm.git] / matita / contribs / LAMBDA-TYPES / LambdaDelta-1 / tlt / defs.ma
1 (**************************************************************************)
2 (*       ___                                                              *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||         The HELM team.                                      *)
8 (*      ||A||         http://helm.cs.unibo.it                             *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU General Public License Version 2                  *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15 (* This file was automatically generated: do not edit *********************)
16
17 include "LambdaDelta-1/T/defs.ma".
18
19 definition wadd:
20  ((nat \to nat)) \to (nat \to (nat \to nat))
21 \def
22  \lambda (f: ((nat \to nat))).(\lambda (w: nat).(\lambda (n: nat).(match n 
23 with [O \Rightarrow w | (S m) \Rightarrow (f m)]))).
24
25 definition weight_map:
26  ((nat \to nat)) \to (T \to nat)
27 \def
28  let rec weight_map (f: ((nat \to nat))) (t: T) on t: nat \def (match t with 
29 [(TSort _) \Rightarrow O | (TLRef n) \Rightarrow (f n) | (THead k u t0) 
30 \Rightarrow (match k with [(Bind b) \Rightarrow (match b with [Abbr 
31 \Rightarrow (S (plus (weight_map f u) (weight_map (wadd f (S (weight_map f 
32 u))) t0))) | Abst \Rightarrow (S (plus (weight_map f u) (weight_map (wadd f 
33 O) t0))) | Void \Rightarrow (S (plus (weight_map f u) (weight_map (wadd f O) 
34 t0)))]) | (Flat _) \Rightarrow (S (plus (weight_map f u) (weight_map f 
35 t0)))])]) in weight_map.
36
37 definition weight:
38  T \to nat
39 \def
40  weight_map (\lambda (_: nat).O).
41
42 definition tlt:
43  T \to (T \to Prop)
44 \def
45  \lambda (t1: T).(\lambda (t2: T).(lt (weight t1) (weight t2))).
46