aboutsummaryrefslogtreecommitdiff
path: root/lib/predicate.ml
diff options
context:
space:
mode:
authorMatej Kosik2015-12-08 12:49:01 +0100
committerMatej Kosik2015-12-18 15:57:26 +0100
commit75d74cd7d124f244882b9c4ed200eac144dcbc43 (patch)
treee2132c7df8ab11a1043af3601d679544d2ba9280 /lib/predicate.ml
parente2a67cbbbd17fa262b37903a97b0adf2d109bf06 (diff)
COMMENTS: added to the "Predicate" module
In the original version, ocamldoc markup wasn't used properly thus ocamldoc output did not in all places make sense. This commit makes sure that the documentation of the Predicate module is as clear as the documentation of the Set module (in the standard library).
Diffstat (limited to 'lib/predicate.ml')
-rw-r--r--lib/predicate.ml9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/predicate.ml b/lib/predicate.ml
index a60b3dadd4..1aa7db6af1 100644
--- a/lib/predicate.ml
+++ b/lib/predicate.ml
@@ -10,8 +10,6 @@
(* *)
(************************************************************************)
-(* Sets over ordered types *)
-
module type OrderedType =
sig
type t
@@ -43,9 +41,10 @@ module Make(Ord: OrderedType) =
struct
module EltSet = Set.Make(Ord)
- (* when bool is false, the denoted set is the complement of
- the given set *)
type elt = Ord.t
+
+ (* (false, s) represents a set which is equal to the set s
+ (true, s) represents a set which is equal to the complement of set s *)
type t = bool * EltSet.t
let elements (b,s) = (b, EltSet.elements s)
@@ -84,6 +83,7 @@ module Make(Ord: OrderedType) =
let diff s1 s2 = inter s1 (complement s2)
+ (* assumes the set is infinite *)
let subset s1 s2 =
match (s1,s2) with
((false,p1),(false,p2)) -> EltSet.subset p1 p2
@@ -91,6 +91,7 @@ module Make(Ord: OrderedType) =
| ((false,p1),(true,n2)) -> EltSet.is_empty (EltSet.inter p1 n2)
| ((true,_),(false,_)) -> false
+ (* assumes the set is infinite *)
let equal (b1,s1) (b2,s2) =
b1=b2 && EltSet.equal s1 s2