X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=ata.ml;h=b2b694ffc8efd22f51ce2f5cb95d3271307bb9b7;hb=b1e6806834df253d5454fffad7f14fb24c74af70;hp=6cdd9efec5baae2ddf5b9bfe60c34a4036dbb4d3;hpb=09870a49122b3d7048422818dbb0a038513b4d14;p=SXSI%2Fxpathcomp.git diff --git a/ata.ml b/ata.ml index 6cdd9ef..b2b694f 100644 --- a/ata.ml +++ b/ata.ml @@ -213,14 +213,16 @@ module Transition = struct s == s' && b==b' && m==m' && Formula.equal f f' end) - let print ppf f = let (st,mark,form,_) = node f in + let print ppf f = let (st,mark,form,b) = node f in Format.fprintf ppf "%i %s" st (if mark then "⇒" else "→"); Formula.print ppf form; - Format.pp_print_flush ppf () + Format.fprintf ppf "%s%!" (if b then " (b)" else "") + + module Infix = struct let ( ?< ) x = x - let ( >< ) state (l,mark) = state,(l,mark,true) - let ( ><@ ) state (l,mark) = state,(l,mark,false) + let ( >< ) state (l,mark) = state,(l,mark,false) + let ( ><@ ) state (l,mark) = state,(l,mark,true) let ( >=> ) (state,(label,mark,bur)) form = (state,label,(make (state,mark,form,bur))) end @@ -364,11 +366,10 @@ module F = Formula Hashtbl.fold (fun p l acc -> if p == q then List.fold_left - - (fun acc (ts,t) -> - let _,_,_,aux = Transition.node t in - if aux then acc else - TagSet.cup ts acc) acc l + (fun acc (ts,t) -> + let _,_,_,aux = Transition.node t in + if aux then acc else + TagSet.cup ts acc) acc l else acc) a.trans TagSet.empty @@ -390,7 +391,6 @@ module F = Formula let next_sibling_ctx x _ = Tree.next_sibling x let r_ignore _ x = x - let set_get_tag r t = r := (fun _ -> t) module type ResultSet = sig