aboutsummaryrefslogtreecommitdiffstats
path: root/lib/concepts/Mode.ml
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lib/concepts/Mode.ml6
-rw-r--r--lib/concepts/Mode.mli1
2 files changed, 2 insertions, 5 deletions
diff --git a/lib/concepts/Mode.ml b/lib/concepts/Mode.ml
index 4d7501c..23abacf 100644
--- a/lib/concepts/Mode.ml
+++ b/lib/concepts/Mode.ml
@@ -5,14 +5,12 @@ type mode = {bound: attributes; affords: affordance}
type t = mode list
let attributes_of_list = BatSet.String.of_list
-
let decides_when bound = {bound= attributes_of_list bound; affords= Decides}
let generates_when bound cardinality =
{bound= attributes_of_list bound; affords= Generates cardinality}
let enumerable cardinality = {bound= BatSet.String.empty; affords= Generates cardinality}
-
let empty = []
let declare mode declaration = mode :: declaration
let of_list modes = modes
@@ -33,7 +31,5 @@ let generation declaration bound =
let decision declaration bound =
List.exists
(fun {bound= declared; affords} ->
- match affords with
- | Decides -> BatSet.String.equal declared bound
- | Generates _ -> false )
+ match affords with Decides -> BatSet.String.equal declared bound | Generates _ -> false )
declaration
diff --git a/lib/concepts/Mode.mli b/lib/concepts/Mode.mli
index 57b079f..982518a 100644
--- a/lib/concepts/Mode.mli
+++ b/lib/concepts/Mode.mli
@@ -23,4 +23,5 @@ val to_list : t -> mode list
declared for fewer bound attributes applies to more, since the
attributes left free are then fewer and no more numerous. *)
val generation : t -> attributes -> Cardinality.t option
+
val decision : t -> attributes -> bool