]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/mathql_interpreter/intersect.ml
faster database format implemented
[helm.git] / helm / ocaml / mathql_interpreter / intersect.ml
index f869838f3fba9facb00ac2d3ba21d151d1c2db5c..e346101cf9152a19599ba0241b853801ebf67d8b 100644 (file)
@@ -68,7 +68,8 @@ let intersect_tails h1 t1 h2 t2 =
         try
          (*match xres_join_context h1 tl1 h2 tl2 with
             [] -> aux tll1 tll2
-          | t  ->*) (l1::(xres_join_context h1 tl1 h2 tl2))::(aux tll1 tll2)
+          | t  -> (l1::(xres_join_context h1 tl1 h2 tl2))::(aux tll1 tll2)*)
+         (l1::(tl1 @ tl2))::(aux tll1 tll2)
        with
         Join_must_be_empty -> aux tll1 tll2
        else
@@ -85,6 +86,9 @@ let intersect_tails h1 t1 h2 t2 =
  * implementazione del comando INTERSECT
  *)
 let intersect_ex l1 l2 =
+ let _ = print_string ("INTERSECT ")
+ and t = Unix.time () in
+  let result = 
  match (l1, l2) with
     ((head1::tail1), (head2::tail2)) ->
      (match (head1, head2) with
@@ -129,5 +133,8 @@ let intersect_ex l1 l2 =
           ) (* match *)
      )
  | _ -> []
+  in
+   let _ = print_endline (string_of_float (Unix.time () -. t)); flush stdout in
+    result
 ;;