X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Focaml%2Fmathql%2FmathQL.ml;h=b76bd4ed55631b81bb4e417e4a6ad3ea575a7743;hb=381006cf8b418cfdeaf145ab7df9e8f2b19ae2e6;hp=71682f2a0792a34788b60140401ccda2728faa3f;hpb=e5c9ea9efcc95afee3be91e8beb754c0cb4301dc;p=helm.git diff --git a/helm/ocaml/mathql/mathQL.ml b/helm/ocaml/mathql/mathQL.ml index 71682f2a0..b76bd4ed5 100644 --- a/helm/ocaml/mathql/mathQL.ml +++ b/helm/ocaml/mathql/mathQL.ml @@ -23,78 +23,71 @@ * http://www.cs.unibo.it/helm/. *) -(******************************************************************************) -(* *) -(* PROJECT HELM *) -(* *) -(* Ferruccio Guidi *) -(* Irene Schena *) -(* 10/09/2002 *) -(* *) -(* *) -(******************************************************************************) +(* AUTOR: Ferruccio Guidi + *) + +(* output data structures ***************************************************) + +module I : Avs.Type = ListAvs + +type value = Avs.value (* a linearized attribute value *) + +type path = Avs.path (* the name of an attribute *) + +type group = I.group (* an group of attribures *) +type result = I.avs (* the query result *) (* input data structures ****************************************************) type svar = string (* the name of a variable for a resource set *) -type rvar = string (* the name of a variable for a resource *) - -type vvar = string (* the name of a variable for an attribute value *) - -type refine_op = ExactOp - | SubOp - | SuperOp - -type path = string list - -type vvar_list = vvar list - -type set_exp = SVar of svar - | RVar of rvar - | Ref of val_exp - | Pattern of val_exp - | Relation of bool * refine_op * path * set_exp * vvar_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 * vvar - | VVar of vvar - | Attribute of bool * refine_op * path * val_exp - | Fun of string * val_exp - -type query = set_exp +type avar = string (* the name of a variable for a resource *) +type inverse = bool -(* output data structures ***************************************************) +type refine = RefineExact + | RefineSub + | RefineSuper + +type main = path + +type pattern = bool + +type exp = path * (path option) + +type exp_list = exp list + +type allbut = bool + +type xml = bool -type value = string list (* the value of an attribute *) +type source = bool -type attribute = string * value (* an attribute *) +type gen = GenFJoin (* full union - with attr handling *) + | GenFMeet (* full intersection - with attr handling *) -type attribute_group = attribute list (* a group of attributes *) +type query = Const of (string * (path * query) list list) list + | SVar of svar + | AVar of avar + | Dot of avar * path + | Ex of avar list * query + | Select of avar * query * query + | Let of svar option * query * query + | Fun of path * path list * query list + | Gen of path * query list + | Add of bool * groups * query + | For of gen * avar * query * query + | While of gen * query * query + | Property of inverse * refine * path * + main * istrue * isfalse list * exp_list * + pattern * query -type attribute_set = attribute_group list (* the attributes of an URI *) +and groups = Attr of (path * query) list list + | From of avar -type resource = string * attribute_set (* an attributed URI *) +and con = pattern * path * query -type resource_set = resource list (* the query result *) +and istrue = con list -type result = resource_set +and isfalse = con list