Nettoyer les commentaire.
authorHuibo SHI <shihuibo19@gmail.com>
Wed, 9 Apr 2014 12:37:01 +0000 (14:37 +0200)
committerHuibo SHI <shihuibo19@gmail.com>
Wed, 9 Apr 2014 12:37:01 +0000 (14:37 +0200)
src/query_tree.ml
src/query_tree.mli
src/table.ml
tests/single_test.sh

index 69f17b3..9dcd0d5 100644 (file)
@@ -1,7 +1,6 @@
 open Table
 
 let compteur = ref 0
-let table_query_tree = Hashtbl.create 97 
 let table_qtree = QTreeHash.create 97
 
 let all_nodes tree = let root = Naive_tree.root tree in
@@ -110,28 +109,6 @@ let debug tree q l =
     Format.pp_print_flush Format.std_formatter ();
   end
 
-
-
-
-let rec compare_query_tree q1 q2 =
-     q1.id==q2.id|| match q1.desc,q2.desc with
-     | Binop(op1,qt1,qt2),Binop(op2,qt3,qt4)->op1==op2&& ((compare_query_tree qt1 qt3 && compare_query_tree qt2 qt4) 
-                                                         ||  (compare_query_tree qt1 qt4 && compare_query_tree qt2 qt3))
-     | Axis(a1,qt1),Axis(a2,qt2) -> compare_axis a1 a2 && compare_query_tree qt1 qt2
-     | Tag(t1,k1),Tag(t2,k2) ->t1==t2&& k1==k2
-     | Dom,Dom | Start,Start ->true
-     | _,_ ->false
-
-and compare_axis a1 a2 =
-  match a1,a2 with
-      Self ,Self | Attribute, Attribute | Child , Child | Parent , Parent
-    | FollowingSibling , FollowingSibling         
-    | PrecedingSibling , PrecedingSibling
-    | Preceding , Preceding | Following , Following -> true
-    | Descendant b1, Descendant b2 -> b1==b2 
-    | Ancestor b1, Ancestor b2 -> b1==b2
-    | _,_ -> false
-
 let mini_id = ref 0
 let mini_table = QTreeHash.create 17 
 
index e578beb..6a8678f 100644 (file)
@@ -1,4 +1,5 @@
 val compteur : int ref
+(**the counter of nodes*)
 
 val all_nodes : Naive_tree.t -> Naive_tree.node list
 (** [all_nodes t] returns all the nodes in the tree [t].
@@ -16,25 +17,14 @@ val compile_single_path : Xpath.Ast.single_path -> Table.query_tree
 val compile_xpath : Xpath.Ast.path -> Table.query_tree 
 (** [compile_xpath path] returns un query_tree built with [xpath]
 *)
-(*
-val union_list : Naive_tree.t ->Naive_tree.node list -> Naive_tree.node list -> Naive_tree.node list
-(** union two lists without duplicating
-*)
-
-val inter_list :  Naive_tree.t ->Naive_tree.node list -> Naive_tree.node list -> Naive_tree.node list
-(** make a list without duplicating by using the intersection of two lists 
-*)
 
-val diff_list :  Naive_tree.t ->Naive_tree.node list -> Naive_tree.node list -> Naive_tree.node list 
-(** difference two lists without duplicating
+val minimize_qtree : Table.query_tree -> Table.query_tree
+(** [minimize_qtree q] returns the minimum query_tree of [q]
+    [q] query_tree
 *)
 
-val eval_query_tree : Naive_tree.t -> Naive_tree.node list ->Table.query_tree -> Naive_tree.node list
-(** [eval_query_tree tree start q] returns the set of nodes that evaluate by the query_tree [q].
+val eval_qtree : Naive_tree.t -> Naive_tree.node list ->Table.query_tree -> Naive_tree.node list
+(** [eval_qtree tree start q] returns the set of nodes that evaluate by the query_tree [q].
     [start] the set of nodes departing.
     [q] query_tree
 *)
-*)
-val minimize_qtree : Table.query_tree -> Table.query_tree
-
-val eval_qtree : Naive_tree.t -> Naive_tree.node list ->Table.query_tree -> Naive_tree.node list
index 21ea213..15d39bc 100644 (file)
@@ -140,11 +140,6 @@ let get_descendant tree ln =
     let n1 = Naive_tree.first_child tree n in
     aux n1 [] ) ln in
   get_list_ordred tree ll
- (* let l = List.fold_left (fun acc n -> if List.mem n acc then acc 
-    else let n1 = Naive_tree.first_child tree n in
-        aux n1 acc) [] ln 
-  in
-  List.rev l *)
 
 let get_child tree ln =
   let rec aux n acc =
index e46116f..3c6d2b3 100755 (executable)
@@ -9,7 +9,7 @@ QUERIES="$INPUT".queries
 cat "$QUERIES" | while read N Q;
 do
  echo Query "$N : $Q"
- src/tatoo.native  -d "$INPUT" "$Q" > /tmp/huibo.xml
+ src/tatoo.native  -d "$INPUT" "$Q" > /tmp/huibo"$N".xml
 
 
 done