1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 include "arithmetics/nat.ma".
17 (* notations ****************************************************************)
19 include "basic_2/notation/constructors/snbind2_4.ma".
20 include "basic_2/notation/constructors/dxbind2_3.ma".
21 include "basic_2/notation/functions/weight_1.ma".
22 include "basic_2/notation/functions/weight_3.ma".
24 (* definitions **************************************************************)
26 inductive list2 (A1,A2:Type[0]) : Type[0] :=
28 | cons2: A1 → A2 → list2 A1 A2 → list2 A1 A2.
31 inductive item0: Type[0] ≝
37 inductive bind2: Type[0] ≝
42 inductive flat2: Type[0] ≝
47 inductive item2: Type[0] ≝
48 | Bind2: bool → bind2 → item2
49 | Flat2: flat2 → item2
52 inductive term: Type[0] ≝
54 | TPair: item2 → term → term → term
57 let rec tw T ≝ match T with
59 | TPair _ V T ⇒ tw V + tw T + 1
62 inductive lenv: Type[0] ≝
64 | LPair: lenv → bind2 → term → lenv
67 let rec lw L ≝ match L with
69 | LPair L _ V ⇒ lw L + tw V
72 definition genv ≝ list2 bind2 term.
74 definition fw: genv → lenv → term → ? ≝ λG,L,T. (lw L) + (tw T).
76 (* interpretations **********************************************************)
78 interpretation "term binding construction (binary)"
79 'SnBind2 a I T1 T2 = (TPair (Bind2 a I) T1 T2).
81 interpretation "weight (term)" 'Weight T = (tw T).
83 interpretation "weight (local environment)" 'Weight L = (lw L).
85 interpretation "weight (closure)" 'Weight G L T = (fw G L T).
89 interpretation "environment binding construction (binary)"
90 'DxBind2 L I T = (LPair L I T).
94 interpretation "environment binding construction (binary)"
95 'DxBind2 L I T = (cons2 bind2 term I T L).
97 (* statements ***************************************************************)
99 lemma fw_shift: ∀a,I,G,K,V,T. ♯{G, K.ⓑ{I}V, T} < ♯{G, K, ⓑ{a,I}V.T}.