projects
/
SXSI
/
xpathcomp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Further optimisations, changed the prototype of Tree.mli
[SXSI/xpathcomp.git]
/
finiteCofinite.ml
diff --git
a/finiteCofinite.ml
b/finiteCofinite.ml
index
32f0e48
..
58f0730
100644
(file)
--- a/
finiteCofinite.ml
+++ b/
finiteCofinite.ml
@@
-10,6
+10,7
@@
module type S =
sig
type elt
type t
sig
type elt
type t
+ type set
val empty : t
val any : t
val is_empty : t -> bool
val empty : t
val any : t
val is_empty : t -> bool
@@
-38,14
+39,16
@@
sig
val choose : t -> elt
val hash : t -> int
val equal : t -> t -> bool
val choose : t -> elt
val hash : t -> int
val equal : t -> t -> bool
+ val positive : t -> set
+ val negative : t -> set
end
end
-module Make (E : Sigs.Set) : S with type elt = E.elt =
+module Make (E : Sigs.Set) : S with type elt = E.elt
and type set = E.t
=
struct
type elt = E.elt
type t = Finite of E.t | CoFinite of E.t
struct
type elt = E.elt
type t = Finite of E.t | CoFinite of E.t
-
+ type set = E.t
let empty = Finite E.empty
let any = CoFinite E.empty
let empty = Finite E.empty
let any = CoFinite E.empty
@@
-179,5
+182,15
@@
struct
function Finite x -> (E.hash x)
| CoFinite x -> ( ~-(E.hash x) land max_int)
function Finite x -> (E.hash x)
| CoFinite x -> ( ~-(E.hash x) land max_int)
+ let positive =
+ function
+ | Finite x -> x
+ | _ -> E.empty
+
+ let negative =
+ function
+ | CoFinite x -> x
+ | _ -> E.empty
+
end
end