The domains of variables are internally represented compactly as FD set terms. The details of this representation are subject to change and should not be relied on. Therefore, a number of operations on FD sets are provided, as such terms play an important role in the interface. The following operations are the primitive ones:
is_fdset(
+Set)
empty_fdset(
?Set)
fdset_parts(
?Set,
?Min,
?Max,
?Rest)
inf
and sup
, denoting
minus and plus infinity, respectively. Either Set or all the
other arguments must be ground.
The following operations can all be defined in terms of the primitive ones, but in most cases, a more efficient implementation is used:
empty_interval(
+Min,
+Max)
fdset_interval(
?Set,
?Min,
?Max)
fdset_singleton(
?Set,
?Elt)
fdset_min(
+Set,
-Min)
fdset_max(
+Set,
-Min)
fdset_size(
+Set,
-Size)
sup
if Set is infinite.
This operation is linear in the number of intervals of Set.
list_to_fdset(
+List,
-Set)
fdset_to_list(
+Set,
-List)
range_to_fdset(
+Range,
-Set)
fdset_to_range(
+Set,
-Range)
fdset_add_element(
+Set1,
+Elt -Set2)
fdset_del_element(
+Set1,
+Elt,
-Set2)
fdset_disjoint(
+Set1,
+Set2)
fdset_intersect(
+Set1,
+Set2)
fdset_intersection(
+Set1,
+Set2,
-Intersection)
fdset_intersection(
+Sets,
-Intersection)
fdset_member(
?Elt,
+Set)
fdset_eq(
+Set1,
+Set2)
fdset_subset(
+Set1,
+Set2)
fdset_subtract(
+Set1,
+Set2,
-Difference)
fdset_union(
+Set1,
+Set2,
-Union)
fdset_union(
+Sets,
-Union)
fdset_complement(
+Set,
-Complement)
inf..sup
.