X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Focaml%2Fmathql%2FmathQL.ml;h=7e82fe5474a1919e49bfa08e25fa00c45dda5b69;hb=4167cea65ca58897d1a3dbb81ff95de5074700cc;hp=04eb3b32d30e7900e854dd2cec055d81f5bcc346;hpb=856dc227c9781439a31d03f5b68d32a41db63ab9;p=helm.git diff --git a/helm/ocaml/mathql/mathQL.ml b/helm/ocaml/mathql/mathQL.ml index 04eb3b32d..7e82fe547 100644 --- a/helm/ocaml/mathql/mathQL.ml +++ b/helm/ocaml/mathql/mathQL.ml @@ -23,21 +23,12 @@ * http://www.cs.unibo.it/helm/. *) -(******************************************************************************) -(* *) -(* PROJECT HELM *) -(* *) -(* Ferruccio Guidi *) -(* Irene Schena *) -(* 10/09/2002 *) -(* *) -(* *) -(******************************************************************************) - +(* AUTOR: Ferruccio Guidi + *) (* output data structures ***************************************************) -type path = string * (string list) (* the name of an attribute *) +type path = string list (* the name of an attribute *) type value = string list (* the value of an attribute *) @@ -58,7 +49,7 @@ type result = resource_set type svar = string (* the name of a variable for a resource set *) -type rvar = string (* the name of a variable for a resource *) +type avar = string (* the name of a variable for a resource *) type vvar = string (* the name of a variable for an attribute value *) @@ -68,33 +59,73 @@ type refine = RefineExact | RefineSub | RefineSuper -type set_exp = SVar of svar - | RVar of rvar - | Ref of val_exp - | Pattern of val_exp - | Relation of inverse * refine * path * set_exp * string list - | Select of rvar * set_exp * boole_exp - | Union of set_exp * set_exp - | Intersect of set_exp * set_exp - | Diff of set_exp * set_exp - | LetSVar of svar * set_exp * set_exp - | LetVVar of vvar * val_exp * set_exp - -and boole_exp = False - | True - | Not of boole_exp - | Ex of rvar list * boole_exp - | And of boole_exp * boole_exp - | Or of boole_exp * boole_exp - | Sub of val_exp * val_exp - | Meet of val_exp * val_exp - | Eq of val_exp * val_exp - -and val_exp = Const of string list - | RefOf of set_exp - | Record of rvar * path - | VVar of vvar - | Attribute of inverse * refine * path * val_exp - | Fun of string * val_exp - -type query = set_exp +type main = path + +type pattern = bool + +type exp = path * (path option) + +type exp_list = exp list + +type allbut = bool + +type xml = bool + +type source = bool + +type bin = BinFJoin (* full union - with attr handling *) + | BinFMeet (* full intersection - with attr handling *) + | BinFDiff (* full difference - with attr handling *) + +type gen = GenFJoin (* full union - with attr handling *) + | GenFMeet (* full intersection - with attr handling *) + +type test = Xor + | Or + | And + | Sub + | Meet + | Eq + | Le + | Lt + +type query = Empty + | SVar of svar + | AVar of avar + | Subj of msval + | Property of inverse * refine * path * + main * istrue * isfalse list * exp_list * + pattern * msval + | Select of avar * query * msval + | Bin of bin * query * query + | LetSVar of svar * query * query + | LetVVar of vvar * msval * query + | For of gen * avar * query * query + | Add of bool * groups * query + | If of msval * query * query + | Log of xml * source * query + | StatQuery of query + | Keep of allbut * path list * query + +and msval = False + | True + | Not of msval + | Ex of avar list * msval + | Test of test * msval * msval + | Const of string + | Set of msval list + | Proj of path option * query + | Dot of avar * path + | VVar of vvar + | StatVal of msval + | Count of msval + | Align of string * msval + +and groups = Attr of (path * msval) list list + | From of avar + +and con = pattern * path * msval + +and istrue = con list + +and isfalse = con list