]> matita.cs.unibo.it Git - helm.git/blob - helm/ocaml/mathql/avs.ml
an optimization was inserted
[helm.git] / helm / ocaml / mathql / avs.ml
1 (* Copyright (C) 2000, HELM Team.
2  * 
3  * This file is part of HELM, an Hypertextual, Electronic
4  * Library of Mathematics, developed at the Computer Science
5  * Department, University of Bologna, Italy.
6  * 
7  * HELM is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  * 
12  * HELM is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with HELM; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
20  * MA  02111-1307, USA.
21  * 
22  * For details, see the HELM World-Wide-Web page,
23  * http://www.cs.unibo.it/helm/.
24  *)
25
26 (*  AUTOR: Ferruccio Guidi <fguidi@cs.unibo.it>
27  *)
28
29 type value = string list (* a linearized attribute value *)
30
31 type path  = string list (* the name of an attribute *)
32
33 module type Type = sig 
34
35    type group               (* an group of attribures *)
36
37    type avs                 (* a set of attributed values *)
38
39    type peek_t = Empty
40                | Single of (string * group list)
41                | Many of (string * group list)
42
43
44    val grp_empty  : group
45
46    val grp_make   : path -> string -> group 
47
48    val grp_union  : group -> group -> group
49
50    val grp_read   : group -> path -> avs
51
52    val grps_make  : group list -> group -> group list 
53
54    val empty      : avs
55
56    val make       : string -> group -> avs
57
58    val iter       : ('a -> string -> bool -> 'a) -> 'a -> avs -> 'a
59
60    val x_iter     : ('a -> string -> group list -> bool -> 'a) -> 
61                     'a -> avs -> 'a
62
63    val x_grp_iter : ('a -> path -> value -> bool -> 'a) -> 'a -> group -> 'a
64
65    val single     : avs -> string option
66
67    val sub        : avs -> avs -> bool
68
69    val meet       : avs -> avs -> bool
70
71    val eq         : avs -> avs -> bool
72
73    val union      : avs -> avs -> avs (* without attr. distribution *)
74
75    val intersect  : avs -> avs -> avs (* without attr. distribution *)
76
77    val diff       : avs -> avs -> avs
78
79    val d_union    : avs -> avs -> avs (* with attr. distribution *)
80
81    val peek       : avs -> peek_t
82
83    val optimize   : avs -> avs
84
85 end