X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;ds=sidebyside;f=ata.ml;h=6c97f55f5e52353b6de872f899c88e1355d9f676;hb=2676d5a3bbb1e6f6a5af66477edfe3b4c849f4e7;hp=ebc74a53d8df0b2801502bc723cfe3f7fe89d409;hpb=b8aa8e7f1036cf00d0fadc75ccbe0264bae6c1b2;p=SXSI%2Fxpathcomp.git diff --git a/ata.ml b/ata.ml index ebc74a5..6c97f55 100644 --- a/ata.ml +++ b/ata.ml @@ -1,8 +1,6 @@ INCLUDE "debug.ml" INCLUDE "utils.ml" - - type jump_kind = [ `TAG of Tag.t | `CONTAINS of string | `NOTHING ] (* Todo : move elsewhere *) @@ -67,8 +65,8 @@ struct match f.pos with | False -> 0 | True -> 1 - | Or (f1,f2) -> HASHINT3(PRIME2,HNode.hash f1,HNode.hash f2) - | And (f1,f2) -> HASHINT3(PRIME3,HNode.hash f1,HNode.hash f2) + | Or (f1,f2) -> HASHINT3(PRIME2,HNode.uid f1,HNode.uid f2) + | And (f1,f2) -> HASHINT3(PRIME3,HNode.uid f1,HNode.uid f2) | Atom(d,p,s) -> HASHINT4(PRIME4,hash_const_variant d,vb p,s) end @@ -230,7 +228,7 @@ module SetTagKey = struct type t = Ptset.Int.t*Tag.t let equal (s1,t1) (s2,t2) = (t1 == t2) && Ptset.Int.equal s1 s2 - let hash (s,t) = HASHINT2(Ptset.Int.hash s,Tag.hash t) + let hash (s,t) = HASHINT2(Ptset.Int.uid s, t) end module TransTable = Hashtbl @@ -650,7 +648,7 @@ END if Ptss.mem s c.sets then { c with results = IMap.add s (RS.concat r (IMap.find s c.results)) c.results} else - { hash = HASHINT2(c.hash,Ptset.Int.hash s); + { hash = HASHINT2(c.hash,Ptset.Int.uid s); sets = Ptss.add s c.sets; results = IMap.add s r c.results } @@ -682,7 +680,7 @@ END in let h,s = Ptss.fold - (fun s (ah,ass) -> (HASHINT2(ah,Ptset.Int.hash s), + (fun s (ah,ass) -> (HASHINT2(ah,Ptset.Int.uid s), Ptss.add s ass)) (Ptss.union c1.sets c2.sets) (0,Ptss.empty) in @@ -727,7 +725,7 @@ END let h_trans = Hashtbl.create 4096 let get_up_trans slist ptag a tree = - let key = (HASHINT2(SList.hash slist,Tag.hash ptag)) in + let key = (HASHINT2(SList.uid slist,ptag)) in try Hashtbl.find h_trans key with