From: Huibo SHI Date: Mon, 7 Apr 2014 12:20:10 +0000 (+0200) Subject: Supprimer la definition move, la fonction eval_move et la fonction eval_relation... X-Git-Url: http://git.nguyen.vg/gitweb/?p=tatoo.git;a=commitdiff_plain;h=65b8c40ffe6dc048d88577931c65bc71cdaa7a44 Supprimer la definition move, la fonction eval_move et la fonction eval_relation,car nous ne les utilison plus. --- diff --git a/src/table.ml b/src/table.ml index 7a49b75..0c9e119 100644 --- a/src/table.ml +++ b/src/table.ml @@ -1,10 +1,4 @@ -type move = Self - | Firstchild - | Nextsibling - | Revfirstchild - | Prevsibling - type query_tree_desc = Binop of op * query_tree * query_tree | Axis of Xpath.Ast.axis * query_tree | Start @@ -111,59 +105,7 @@ and print_binop fmt o = | Inter -> Format.fprintf fmt "Inter" | Diff -> Format.fprintf fmt "Diff" -let rec eval_relation tree m n = - match m with - Self -> n - | Firstchild -> Naive_tree.first_child tree n - | Nextsibling -> Naive_tree.next_sibling tree n - | Revfirstchild -> Naive_tree.parent_of_first tree n - | Prevsibling -> Naive_tree.prev_sibling tree n - -(*28/01/2014 - parametres : tree l'arbre xml - ls l'ensemble de noeuds - m move - retour : l'ensemble de noeuds qui correspondent ॆ la relation r -*) - - - - -let rec eval_move tree ls m = - match m with - Self -> ls - | r -> List.filter (fun n -> n != Naive_tree.nil) - (List.map (eval_relation tree r) ls) - -(*28/01/2014 - parametres : tree l'arbre xml - ls l'ensemble de noeuds - m move - retour : l'ensemble de noeuds qui correspondent ॆ des relations lr -*) - -and eval_star tree ls lr = - let h = Hashtbl.create 17 in - let q = Queue.create () in - List.iter ( fun e -> Queue.add e q ) ls; - while not (Queue.is_empty q ) do - let n = Queue.pop q in - if not (Hashtbl.mem h n) then begin - Hashtbl.add h n (); - List.iter ( fun r -> let m = eval_relation tree r n in - if m != Naive_tree.nil && not (Hashtbl.mem h m ) then begin - - Queue.add m q; end - ) lr - end - done; - let l = Hashtbl.fold (fun k _ acc -> k::acc) h [] in - l - (* - Tas.sort_of_list tree l - List.sort (compare_node tree) l*) - let rec compare_node_list tree l1 l2 = match l1,l2 with [],[] -> 0