]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/ground/etc/relocation/trace.etc
ground_2 released and permanently renamed as ground
[helm.git] / matita / matita / contribs / lambdadelta / ground / etc / relocation / trace.etc
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 "ground_2/notation/functions/norm_1.ma".
16 include "ground_2/lib/bool.ma".
17 include "ground_2/lib/list.ma".
18
19 (* RELOCATION TRACE *********************************************************)
20
21 definition trace: Type[0] ≝ list bool.
22
23 let rec colength (cs:trace) on cs ≝ match cs with
24 [ nil       ⇒ 0
25 | cons b tl ⇒ match b with [ true ⇒  ⫯(colength tl) | false ⇒ colength tl ] 
26 ].
27
28 interpretation "colength (trace)"
29    'Norm cs = (colength cs).
30
31 (* basic properties *********************************************************)
32
33 lemma colength_empty: ∥◊∥ = 0.
34 // qed.
35
36 lemma colength_true: ∀cs. ∥Ⓣ@cs∥ = ⫯∥cs∥.
37 // qed.
38
39 lemma colength_false: ∀cs. ∥Ⓕ@cs∥ = ∥cs∥.
40 // qed.
41
42 lemma colength_cons: ∀cs1,cs2. ∥cs1∥ = ∥cs2∥ →
43                      ∀b. ∥b@cs1∥ = ∥b@cs2∥.
44 #cs1 #cs2 #H * /2 width=1 by/
45 qed.
46
47 lemma colength_le: ∀cs. ∥cs∥ ≤ |cs|.
48 #cs elim cs -cs //
49 * /2 width=1 by le_S_S, le_S/
50 qed.