2 ||M|| This file is part of HELM, an Hypertextual, Electronic
3 ||A|| Library of Mathematics, developed at the Computer Science
4 ||T|| Department of the University of Bologna, Italy.
7 ||A|| This file is distributed under the terms of the
8 \ / GNU General Public License Version 2
10 V_______________________________________________________________ *)
12 include "lambda-delta/syntax/lenv.ma".
14 (* WEIGHTS ******************************************************************)
16 (* the weight of a term *)
17 let rec tw T ≝ match T with
20 | TPair _ V T ⇒ tw V + tw T + 1
23 interpretation "weight (term)" 'Weight T = (tw T).
25 (* the weight of a local environment *)
26 let rec lw L ≝ match L with
28 | LPair L _ V ⇒ lw L + #V
31 interpretation "weight (local environment)" 'Weight L = (lw L).
33 (* the weight of a closure *)
34 definition cw: lenv → term → ? ≝ λL,T. #L + #T.
36 interpretation "weight (closure)" 'Weight L T = (cw L T).
38 axiom tw_wf_ind: ∀P:term→Prop.
39 (∀T2. (∀T1. # T1 < # T2 → P T1) → P T2) →
42 axiom cw_wf_ind: ∀P:lenv→term→Prop.
43 (∀L2,T2. (∀L1,T1. #[L1,T1] < #[L2,T2] → P L1 T1) → P L2 T2) →