]> matita.cs.unibo.it Git - helm.git/blob - helm/software/matita/contribs/ng_assembly/common/string.ma
87ba11317bd2846564d6b1df3e91a937f42a2684
[helm.git] / helm / software / matita / contribs / ng_assembly / common / string.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 (* ********************************************************************** *)
16 (*                          Progetto FreeScale                            *)
17 (*                                                                        *)
18 (*   Sviluppato da: Ing. Cosimo Oliboni, oliboni@cs.unibo.it              *)
19 (*   Sviluppo: 2008-2010                                                  *)
20 (*                                                                        *)
21 (* ********************************************************************** *)
22
23 include "common/ascii.ma".
24 include "common/list_utility.ma".
25
26 (* ************************ *)
27 (* MANIPOLAZIONE DI STRINGA *)
28 (* ************************ *)
29
30 (* tipo pubblico *)
31 ndefinition aux_str_type ≝ list ascii.
32
33 (* strcmp *)
34 ndefinition eq_str ≝
35  bfold_right_list2 ascii (λx,y.eq_ascii x y).
36
37 (* ************ *)
38 (* STRINGA + ID *)
39 (* ************ *)
40
41 (* tipo pubblico *)
42 nrecord strId : Type ≝
43  {
44  str_elem: aux_str_type;
45  id_elem: nat
46  }.
47
48 (* confronto *)
49 ndefinition eq_strId ≝
50 λsid,sid':strId.
51  (eq_str (str_elem sid) (str_elem sid'))⊗
52  (eq_nat (id_elem sid) (id_elem sid')).