X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Focaml%2Fmathql%2FmQueryUtil.ml;h=450e40210560b8d40c063f213212a223f3c0fdfd;hb=fb4f3bb1bafb5d5541a777758b4074ee8e2de4ae;hp=dc6b6997f36c82260f5597cb3a58887ff0a65436;hpb=e948a077c64bf1e1fb29cce626e04f2c93a5ba3c;p=helm.git diff --git a/helm/ocaml/mathql/mQueryUtil.ml b/helm/ocaml/mathql/mQueryUtil.ml index dc6b6997f..450e40210 100644 --- a/helm/ocaml/mathql/mQueryUtil.ml +++ b/helm/ocaml/mathql/mQueryUtil.ml @@ -54,15 +54,15 @@ let text_of_query x = | M.SuperOp -> "super " in let txt_vvar_list l = - txt_list txt_vvar "," l + l in let rec txt_val = function | M.Const [s] -> txt_qstr s - | M.Const l -> "{" ^ txt_list txt_qstr "," l ^ "}" + | M.Const l -> "{" ^ txt_list txt_qstr ", " l ^ "}" | M.VVar vv -> txt_vvar vv | M.Record (rv, vv) -> txt_rvar rv ^ "." ^ txt_vvar vv | M.Fun (s, x) -> "fun " ^ txt_qstr s ^ " " ^ txt_val x - | M.Attribute (r, s, x) -> "attribute " ^ txt_ref r ^ txt_qstr s ^ " " ^ txt_val x + | M.Attribute (r, p, x) -> "attribute " ^ txt_ref r ^ txt_list txt_qstr "/" p ^ " " ^ txt_val x | M.RefOf x -> "refof " ^ txt_set x and txt_boole = function | M.False -> "false" @@ -77,8 +77,8 @@ let text_of_query x = and txt_set = function | M.SVar sv -> txt_svar sv | M.RVar rv -> txt_rvar rv - | M.Relation (r, s, x, []) -> "relation " ^ txt_ref r ^ txt_qstr s ^ " " ^ txt_set x - | M.Relation (r, s, x, l) -> "relation " ^ txt_ref r ^ txt_qstr s ^ " " ^ txt_set x ^ " attr " ^ txt_vvar_list l + | M.Relation (r, p, x, []) -> "relation " ^ txt_ref r ^ txt_list txt_qstr "/" p ^ " " ^ txt_set x + | M.Relation (r, p, x, l) -> "relation " ^ txt_ref r ^ txt_list txt_qstr "/" p ^ " " ^ txt_set x ^ " attr " ^ txt_list txt_vvar ", " l | M.Union (x, y) -> "(" ^ txt_set x ^ " union " ^ txt_set y ^ ")" | M.Intersect (x, y) -> "(" ^ txt_set x ^ " intersect " ^ txt_set y ^ ")" | M.Diff (x, y) -> "(" ^ txt_set x ^ " diff " ^ txt_set y ^ ")" @@ -87,20 +87,20 @@ let text_of_query x = | M.Select (rv, x, y) -> "select " ^ txt_rvar rv ^ " in " ^ txt_set x ^ " where " ^ txt_boole y | M.Pattern x -> "pattern " ^ txt_val x | M.Ref x -> "ref " ^ txt_val x - in + in txt_set x let text_of_result x sep = let txt_attr = function | (s, []) -> txt_qstr s - | (s, l) -> txt_qstr s ^ "=" ^ txt_list txt_qstr "," l + | (s, l) -> txt_qstr s ^ "=" ^ txt_list txt_qstr ", " l in - let txt_group l = "{" ^ txt_list txt_attr ";" l ^ "}" in + let txt_group l = "{" ^ txt_list txt_attr "; " l ^ "}" in let txt_res = function | (s, []) -> txt_qstr s - | (s, l) -> txt_qstr s ^ " attr " ^ txt_list txt_group "," l + | (s, l) -> txt_qstr s ^ " attr " ^ txt_list txt_group ", " l in - let txt_set l = txt_list txt_res (";" ^ sep) l in + let txt_set l = txt_list txt_res ("; " ^ sep) l ^ sep in txt_set x let query_of_text lexbuf =