]> matita.cs.unibo.it Git - helm.git/blob - helm/ocaml/mathql/mathQL.ml
functor added
[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 (*  AUTOR: Ferruccio Guidi <fguidi@cs.unibo.it>
27  *)
28
29 (* output data structures ***************************************************)
30
31 module I : Avs.Type = ListAvs
32
33 type value = Avs.value (* a linearized attribute value *)
34
35 type path = Avs.path   (* the name of an attribute *)
36
37 type group = I.group (* an group of attribures *)
38
39 type result = I.avs  (* the query result *)
40
41 (* input data structures ****************************************************)
42
43 type svar = string (* the name of a variable for a resource set *)
44
45 type avar = string (* the name of a variable for a resource *)
46
47 type inverse = bool 
48
49 type refine = RefineExact
50             | RefineSub
51             | RefineSuper
52
53 type main = path
54
55 type pattern = bool
56
57 type exp = path * (path option) 
58
59 type exp_list = exp list
60
61 type allbut = bool
62
63 type xml = bool
64
65 type source = bool
66
67 type gen = GenFJoin (* full union - with attr handling *)
68          | GenFMeet (* full intersection - with attr handling *)
69
70 type query = Const of (string * (path * query) list list) list
71            | SVar of svar
72            | AVar of avar
73            | Dot of avar * path
74            | Ex of avar list * query
75            | Select of avar * query * query
76            | Let of svar option * query * query
77            | Fun of path * path list * query list
78            | Gen of path * query list
79            | Add of bool * groups * query
80            | For of gen * avar * query * query
81            | While of gen * query * query
82            | Property of inverse * refine * path * 
83                          main * istrue * isfalse list * exp_list *
84                          pattern * query
85
86 and groups = Attr of (path * query) list list
87            | From of avar
88
89 and con = pattern * path * query
90
91 and istrue = con list
92
93 and isfalse = con list