]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/grammar/term_weight.ma
- notation change for weight functions (following lambda)
[helm.git] / matita / matita / contribs / lambdadelta / 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 (* Basic_1: was: tweight_lt *)
29 lemma tw_pos: ∀T. 1 ≤ ♯{T}.
30 #T elim T -T //
31 qed.
32
33 (* Basic_1: removed theorems 11:
34             wadd_le wadd_lt wadd_O weight_le weight_eq weight_add_O
35             weight_add_S tlt_trans tlt_head_sx tlt_head_dx tlt_wf_ind
36 *)
37 (* Basic_1: removed local theorems 1: q_ind *)