\lambda (f: ((nat \to nat))).(\lambda (w: nat).(\lambda (n: nat).(match n
with [O \Rightarrow w | (S m) \Rightarrow (f m)]))).
\lambda (f: ((nat \to nat))).(\lambda (w: nat).(\lambda (n: nat).(match n
with [O \Rightarrow w | (S m) \Rightarrow (f m)]))).
[(TSort _) \Rightarrow O | (TLRef n) \Rightarrow (f n) | (THead k u t0)
\Rightarrow (match k with [(Bind b) \Rightarrow (match b with [Abbr
\Rightarrow (S (plus (weight_map f u) (weight_map (wadd f (S (weight_map f
u))) t0))) | Abst \Rightarrow (S (plus (weight_map f u) (weight_map (wadd f
O) t0))) | Void \Rightarrow (S (plus (weight_map f u) (weight_map (wadd f O)
t0)))]) | (Flat _) \Rightarrow (S (plus (weight_map f u) (weight_map f
[(TSort _) \Rightarrow O | (TLRef n) \Rightarrow (f n) | (THead k u t0)
\Rightarrow (match k with [(Bind b) \Rightarrow (match b with [Abbr
\Rightarrow (S (plus (weight_map f u) (weight_map (wadd f (S (weight_map f
u))) t0))) | Abst \Rightarrow (S (plus (weight_map f u) (weight_map (wadd f
O) t0))) | Void \Rightarrow (S (plus (weight_map f u) (weight_map (wadd f O)
t0)))]) | (Flat _) \Rightarrow (S (plus (weight_map f u) (weight_map f