]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/mathql_interpreter/mqint.ml
bumped version to 0.0.3
[helm.git] / helm / ocaml / mathql_interpreter / mqint.ml
index 54dc0e05c40d44c6fbedcf184f8109a5d8e547d4..c67d11d15f655c6a38b6efea5dd9c12341b70b36 100644 (file)
@@ -42,6 +42,7 @@ open Context;;
 open Diff;;
 open Relation;;
 open Func;;
+open Attribute;;
 
 
 exception BooleExpTrue
@@ -54,7 +55,7 @@ let check () =
    let status = Dbconn.pgc () 
    in ()
 
-let stat = ref false
+let stat = ref true
 
 let set_stat b = stat := b
 
@@ -64,7 +65,7 @@ let postgres_db = "postgres"
 
 let galax_db = "galax"
 
-let dbname = ref postgres_db
+let dbname = ref galax_db
 
 let set_database s = 
     if s = postgres_db || s = galax_db then dbname := s
@@ -87,7 +88,7 @@ let rec exec_set_exp c = function
         let ll1 = string_of_int (List.length rs1) in
         let ll2 = string_of_int (List.length rs2) in
         let diff = string_of_float (after -. before) in
-       if ! stat then
+       if !stat then
         (print_endline("INTERSECT(" ^ ll1 ^ "," ^ ll2 ^ ") = " ^ string_of_int (List.length res) ^
          ": " ^ diff ^ "s");
          flush stdout);
@@ -97,7 +98,7 @@ let rec exec_set_exp c = function
        let res = union_ex (exec_set_exp c sexp1) (exec_set_exp c sexp2) in
        let after = Sys.time() in
        let diff = string_of_float (after -. before) in
-        if ! stat then
+        if !stat then
        (print_endline ("UNION: " ^ diff ^ "s");
          flush stdout);
         res                    
@@ -119,7 +120,7 @@ let rec exec_set_exp c = function
          print_endline (string_of_float (Sys.time() -. before) ^ "s");
          flush stdout); 
        res
-   | MathQL.Relation (rop, path, sexp, attl) -> 
+   | MathQL.Relation (inv, rop, path, sexp, attl) -> 
         let before = Sys.time() in
        if ! dbname = postgres_db then
         (let res = relation_ex rop path (exec_set_exp c sexp) attl in
@@ -130,7 +131,7 @@ let rec exec_set_exp c = function
          res)
        else
         (let res = relation_galax_ex rop path (exec_set_exp c sexp) attl in
-         if ! stat then
+         if !stat then
          (print_string ("RELATION-GALAX " ^ (List.hd path) ^ " = " ^ string_of_int(List.length res) ^ ": ");
           print_endline (string_of_float (Sys.time() -. before) ^ "s");
           flush stdout);
@@ -206,7 +207,7 @@ and exec_val_exp c = function
    | MathQL.VVar s -> List.assoc s c.vvars                               
    | MathQL.RefOf sexp -> List.map (fun (s,_) -> s) (exec_set_exp c sexp)
    | MathQL.Fun (s, vexp) -> fun_ex s (exec_val_exp c vexp)
-   | MathQL.Attribute (rop, path, vexp) -> [] 
+   | MathQL.Attribute (inv, rop, path, vexp) -> attribute_ex rop path inv (exec_val_exp c vexp) 
 
 (* valuta una MathQL.set_exp nel contesto vuoto e ritorna un MathQL.resource_set *)
 and execute x =