]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambda-delta/Basic-2/grammar/term_weight.ma
- we shared the atomic term constructions
[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 [ TAtom _     ⇒ 1
21 | TPair _ V T ⇒ tw V + tw T + 1
22 ].
23
24 interpretation "weight (term)" 'Weight T = (tw T).
25
26 (* Basic properties *********************************************************)
27
28 axiom tw_wf_ind: ∀R:term→Prop.
29                  (∀T2. (∀T1. #[T1] < #[T2] → R T1) → R T2) →
30                  ∀T. R T.