X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=tagSet.ml;h=ba3f431c3cb6e88a5457c2a250b8759406e2408d;hb=bf2b1a91300ace1e7e83bd78f868a269d86498f9;hp=76c1c9840944bd1a156b6b987ccc5326576ab2b8;hpb=dc91851aaeac91a71eba2c266d0227adea0c5815;p=SXSI%2Fxpathcomp.git diff --git a/tagSet.ml b/tagSet.ml index 76c1c98..ba3f431 100644 --- a/tagSet.ml +++ b/tagSet.ml @@ -4,8 +4,8 @@ struct let hash = Hashtbl.hash end *) -module M : FiniteCofinite.S with type elt = Tag.t and type set = Ptset.t = - FiniteCofinite.Make(Ptset) +module M : FiniteCofinite.S with type elt = Tag.t and type set = Ptset.Int.t = + FiniteCofinite.Make(Ptset.Int) include M @@ -15,3 +15,18 @@ let attribute = singleton Tag.attribute let star = diff any (cup pcdata attribute) let node = neg attribute +let print ppf t = + let print_set s = + Format.fprintf ppf "{"; + Ptset.Int.iter + (fun t -> Format.fprintf ppf "'%s' " (Tag.to_string t)) + s; + Format.fprintf ppf "}" + in + if is_finite t then + if is_empty t then + Format.fprintf ppf "∅" else print_set (positive t) + else + Format.fprintf ppf "Σ"; + if not (is_any t) then + (Format.fprintf ppf "\\" ; print_set (negative t))