[ Reference Manual | Alphabetic Index ]

library(ic_hybrid_sets)

Solver over sets of integers (lex bounds, cooperates with lib(ic))   [more]

Predicates

#(?Set, ?Card)
Card is the cardinality of the integer set Set
?Set :: ++Lwb..++Upb
Set is an integer set within the given bounds
all_disjoint(+Sets)
Sets is a list of integers sets which are all disjoint
all_intersection(+Sets, ?Intersection)
Intersection is the intersection of all the sets in the list Sets
all_ordered(?, ?)
No description available
all_union(+Sets, ?SetUnion)
SetUnion is the union of all the sets in the list Sets
all_union_lex(?, ?)
No description available
difference(?Set1, ?Set2, ?Set3)
Set3 is the difference of the integer sets Set1 and Set2
difference_lex(?, ?, ?)
No description available
?Set1 disjoint ?Set2
The integer sets Set1 and Set2 are disjoint
get_set_attribute(?Set, -Attr)
Get the set-attribute corresponding to Set
?X in ?Set
The integer X is member of the integer set Set
in(?X, ?Set, ?Bool)
Reified version of the set membership constraint
?Set in_set_range ++Lwb..++Upb
Set is an integer set within the given bounds
?Set1 includes ?Set2
Set1 includes (is a superset of) the integer set Set2
insetdomain(?Set, ?CardSel, ?ElemSel, ?Order)
Instantiate Set to a possible value
int_geq_than(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
No description available
int_leq_than(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
No description available
intersect_atmost_n(?, ?, ?, ?)
No description available
intersect_lex(?, ?, ?)
No description available
intersection(?Set1, ?Set2, ?Set3)
Set3 is the intersection of the integer sets Set1 and Set2
intset(?Set, +Min, +Max)
Set is a set containing numbers between Min and Max
intsets(?Sets, ?N, +Min, +Max)
Sets is a list of N sets containing numbers between Min and Max
is_solver_type(?Term)
Succeeds if Term is a ground set or a set variable
is_solver_var(?Term)
Succeeds if Term is a set variable
labeling_ff(?, ?, ?, ?)
No description available
labeling_lex(?)
No description available
labeling_lex(?, ?, ?, ?)
No description available
labeling_smallest_glb(?)
No description available
leq(?, ?)
No description available
less(?, ?)
No description available
lex_min_max(?, ?, ?)
No description available
lex_set_range(?, ?, ?)
No description available
local_intersect_atmost_n(?, ?, ?, ?)
No description available
membership_booleans(?Set, ?BoolArr)
BoolArr is an array of booleans describing Set
next_lex_min(?, ?, ?)
No description available
?X notin ?Set
The integer X is not a member of the integer set Set
potential_members(?Set, -List)
List is the list of elements of whose membership in Set is currently uncertain
prev_lex_max(?, ?, ?)
No description available
safe_set_range(?, ?, ?)
No description available
?Set1 sameset ?Set2
The sets Set1 and Set2 are equal
satisfies(?, ?)
No description available
set_lex_max(?, ?, ?)
No description available
set_lex_min(?, ?, ?)
No description available
set_range(?Set, -Lwb, -Upb)
Lwb and Upb are the current lower and upper bounds on Set
?Set1 subset ?Set2
Set1 is a (non-strict) subset of the integer set Set2
?Set1 subsetof ?Set2
Set1 is a (non-strict) subset of the integer set Set2
symdiff(?Set1, ?Set2, ?Set3)
Set3 is the symmetric difference of the integer sets Set1 and Set2
union(?Set1, ?Set2, ?Set3)
Set3 is the union of the integer sets Set1 and Set2
union_lex(?, ?, ?)
No description available
watch(?)
No description available
weight(?Set, ++ElementWeights, ?Weight)
According to the array of element weights, the weight of set Set is Weight

Structures

struct int_sets(dom, lex_min, lex_max, lex_glb, lex_lub, lex_dirty, off, lcard, ucard, added, removed, add, rem, min_susp, max_susp, card, booleans, value)
Attribute structure for set variables (and constants)

Other Exports

export op(500, yfx, \)
export op(700, xfx, in_set_range)
export op(700, xfx, disjoint)
export op(700, xfx, sameset)
export op(700, xfx, in)
export op(700, xfx, notin)
export op(700, xfx, includes)
export op(700, xfx, subset)
export op(700, xfx, subsetof)
export op(700, xfx, less)
export op(700, xfx, satisfies)
export op(700, xfx, leq)

Description

This is a solver for constraints over the domain of finite integer sets.

(Ground) integer sets are represented simply as sorted, duplicate-free lists of integers e.g.

    	SetOfThree = [1,3,7]
    	EmptySet = []
    

Set Variables

Set variables are variables which can eventually take a ground integer set as their value. They are characterized by a lower bound (the set of elements that are definitely in the set) and an upper bound (the set of elements that may be in the set). A set variable can be declared as follows:
    	SetVar :: []..[1,2,3,4,5,6,7],
    
Since the lower bound is the empty set, this can be written as
    	SetVar subset [1,2,3,4,5,6,7],
    
If the lower bound is the empty set and the upper bound is a set of consecutive integers, you can also write
    	intset(SetVar, 1, 7)
    

Set Constraints

Most of the usual set operations/relations are provided as constraints: as well as a constraint on set weight. Note that there is no complement-constraint because the library has no concept of a set universe and cannot represent infinite sets.

On most argument positions where sets are expected, set expressions are allowed, e.g.

    Set1 /\ Set2       % intersection
    Set1 \/ Set2       % union
    Set1 \ Set2        % difference
    
as well as references to array elements like Set[3].

Search

The insetdomain/4 predicate can be used to enumerate all ground instantiations of a set variable, much like indomain/1 in the finite-domain case.

Cooperation with a finite domain solver

This library comes in two flavours: lib(fd_sets) which cooperates with lib(fd), and lib(ic_sets) which cooperates with lib(ic). This is relevant only for those constraints which involve integer variables, e.g. the cardinality argument in #/2, the weight argument in weight/3 and the booleans in membership_booleans/2. These will be represented as fd- or ic-variables respectively.

About


Generated from ic_hybrid_sets.eci on 2022-09-03 14:26