]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/mathql_interpreter/mQueryInterpreter.ml
patched and improved
[helm.git] / helm / ocaml / mathql_interpreter / mQueryInterpreter.ml
index 7c7ef8a5631482df5da6ff2d6db8d3271f160f87..511e01c701e5b0eef27802a6aec22628807b80b3 100644 (file)
@@ -55,15 +55,14 @@ let execute h x =
      if C.set h C.Warn then 
      begin
         C.log h "MQIExecute: waring: reference to undefined variables: ";
-       F.text_of_query (C.log h) q "\n"
+       F.text_of_query (C.log h) "\n" q
      end
    in
-   let subj v = List.map (fun s -> (s, [])) v in
    let proj v = List.map fst v in
    let rec eval_query c = function
       | M.Const r -> r
       | M.Dot i p -> begin
-         try subj (List.assoc p (List.assoc i c.groups)) 
+         try U.mql_subj (List.assoc p (List.assoc i c.groups)) 
         with Not_found -> warn (M.Dot i p); [] end
       | M.Ex l y -> 
          let rec ex_aux h = function
@@ -133,7 +132,10 @@ let execute h x =
                  then select_aux t else h :: select_aux t
         in
         select_aux (eval_query c x)
-      | M.Fun p pl xl -> L.exec (eval_query c) h p pl xl
+      | M.Fun p pl xl -> 
+         let e = {L.eval = eval_query c; L.conn = h} in
+         L.eval e (F.text_out_spec (C.log h) "\n") 
+            p pl xl
    and eval_grp c = function
       | M.Attr gs ->
          let attr_aux g (p, y) = U.mql_union g [p, proj (eval_query c y)] in