]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambda-delta/Basic-2/grammar/term_weight.ma
- weakening leq, we proved cpr_bind_dx
[helm.git] / matita / matita / contribs / lambda-delta / Basic-2 / grammar / term_weight.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 include "Basic-2/grammar/term.ma".
16
17 (* WEIGHT *******************************************************************)
18
19 (* the weight of a term *)
20 let rec tw T ≝ match T with
21 [ TSort _     ⇒ 1
22 | TLRef _     ⇒ 1
23 | TPair _ V T ⇒ tw V + tw T + 1
24 ].
25
26 interpretation "weight (term)" 'Weight T = (tw T).
27
28 axiom tw_wf_ind: ∀P:term→Prop.
29                  (∀T2. (∀T1. # T1 < # T2 → P T1) → P T2) →
30                  ∀T. P T.