]> 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 "freescale/nat.ma".
26 include "utility/utility.ma".
27
28 (* ************************ *)
29 (* MANIPOLAZIONE DI STRINGA *)
30 (* ************************ *)
31
32 (* tipo pubblico *)
33 ndefinition aux_str_type ≝ list ascii.
34
35 (* strcmp *)
36 ndefinition eq_str ≝
37  bfold_right_list2 ascii (λx,y.eq_ascii x y).
38
39 (* ************ *)
40 (* STRINGA + ID *)
41 (* ************ *)
42
43 (* tipo pubblico *)
44 nrecord strId : Type ≝
45  {
46  str_elem: aux_str_type;
47  id_elem: nat
48  }.
49
50 (* confronto *)
51 ndefinition eq_strId ≝
52 λsid,sid':strId.
53  (eq_str (str_elem sid) (str_elem sid'))⊗
54  (eq_nat (id_elem sid) (id_elem sid')).