]> matita.cs.unibo.it Git - helm.git/blob - helm/ocaml/mathql/mathQL.ml
Attribute patched: now takes an extra argument of type bool.
[helm.git] / helm / ocaml / mathql / mathQL.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 (******************************************************************************)
27 (*                                                                            *)
28 (*                               PROJECT HELM                                 *)
29 (*                                                                            *)
30 (*                     Ferruccio Guidi <fguidi@cs.unibo.it>                   *)
31 (*                     Irene Schena  <schena@cs.unibo.it>                     *)
32 (*                                 10/09/2002                                 *)
33 (*                                                                            *)
34 (*                                                                            *)
35 (******************************************************************************)
36
37
38 (* input data structures ****************************************************)
39
40 type svar = string (* the name of a variable for a resource set *)
41
42 type rvar = string (* the name of a variable for a resource *)
43
44 type vvar = string (* the name of a variable for an attribute value *)
45
46 type refine_op = ExactOp
47                | SubOp
48                | SuperOp
49
50 type path = string list
51
52 type vvar_list = vvar list
53
54 type set_exp = SVar of svar
55              | RVar of rvar
56              | Ref of val_exp
57              | Pattern of val_exp
58              | Relation of refine_op * path * set_exp * vvar_list
59              | Select of rvar * set_exp * boole_exp
60              | Union of set_exp * set_exp
61              | Intersect of set_exp * set_exp
62              | Diff of set_exp * set_exp
63              | LetSVar of svar * set_exp * set_exp
64              | LetVVar of vvar * val_exp * set_exp
65              
66 and boole_exp = False
67               | True
68               | Not of boole_exp
69               | Ex of rvar list * boole_exp   
70               | And of boole_exp * boole_exp
71               | Or of boole_exp * boole_exp
72               | Sub of val_exp * val_exp
73               | Meet of val_exp * val_exp
74               | Eq of val_exp * val_exp
75                
76 and val_exp = Const of string list 
77             | RefOf of set_exp 
78             | Record of rvar * vvar
79             | VVar of vvar
80             | Fun of string * val_exp
81             | Attribute of refine_op * path * bool * val_exp
82
83 type query = set_exp
84
85
86 (* output data structures ***************************************************)
87
88 type value           = string list            (* the value of an attribute *)
89
90 type attribute       = string * value         (* an attribute *)
91
92 type attribute_group = attribute list         (* a group of attributes *)
93
94 type attribute_set   = attribute_group list   (* the attributes of an URI *)
95
96 type resource        = string * attribute_set (* an attributed URI *)
97
98 type resource_set    = resource list          (* the query result *)
99
100 type result = resource_set