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