aboutsummaryrefslogtreecommitdiffstats
path: root/lib/concepts
diff options
context:
space:
mode:
Diffstat (limited to 'lib/concepts')
-rw-r--r--lib/concepts/Mode.ml3
-rw-r--r--lib/concepts/Mode.mli2
2 files changed, 5 insertions, 0 deletions
diff --git a/lib/concepts/Mode.ml b/lib/concepts/Mode.ml
index 82c207f..b3031fc 100644
--- a/lib/concepts/Mode.ml
+++ b/lib/concepts/Mode.ml
@@ -16,3 +16,6 @@ let exhaustible modes bound =
Option.fold ~none:false ~some:Cardinality.exhaustible (generation modes bound)
let project attributes = List.filter (fun {bound; _} -> BatSet.String.subset bound attributes)
+
+let given attributes =
+ List.map (fun {bound; yields} -> {bound= BatSet.String.diff bound attributes; yields})
diff --git a/lib/concepts/Mode.mli b/lib/concepts/Mode.mli
index d91b2ab..ba1a04a 100644
--- a/lib/concepts/Mode.mli
+++ b/lib/concepts/Mode.mli
@@ -12,3 +12,5 @@ val exhaustible : t -> attributes -> bool
(** the modes still usable when only [attributes] can be bound. *)
val project : attributes -> t -> t
+
+val given : attributes -> t -> t