]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambda-delta/Basic-2/grammar/term_weight.ma
3e70635072fdfe55d4c7a40e588355ad74cdab59
[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 OF A TERM *********************************************************)
18
19 let rec tw T ≝ match T with
20 [ TSort _     ⇒ 1
21 | TLRef _     ⇒ 1
22 | TPair _ V T ⇒ tw V + tw T + 1
23 ].
24
25 interpretation "weight (term)" 'Weight T = (tw T).
26
27 (* Basic properties *********************************************************)
28
29 axiom tw_wf_ind: ∀R:term→Prop.
30                  (∀T2. (∀T1. #[T1] < #[T2] → R T1) → R T2) →
31                  ∀T. R T.