[ The ECLiPSe Libraries | Reference Manual | Alphabetic Index ]

# library(ic_hybrid_sets)

## 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
> compare_instances_set(?, ?, ?)
>   No description available
> copy_term_set(?, ?)
>   No description available
> delayed_goals_number_set(?, ?)
>   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(?, ?)
>   No description available
> ?X in ?Set
>   The integer X is member of the integer set Set
> in(?X, ?Set, ?Bool)
>   Reified version of the set membership constraint
> ?Set1 includes ?Set2
>   Set1 includes (is a superset of) the integer set Set2
> init_event_receiver(?, ?, ?, ?)
>   No description available
> 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
> 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
> print_setvar(?, ?)
>   No description available
> receive_events(?, ?)
>   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
> suspensions_set(?, ?, ?)
>   No description available
> symdiff(?Set1, ?Set2, ?Set3)
>   Set3 is the symmetric difference of the integer sets Set1 and Set2
> test_unify_sets(?, ?)
>   No description available
> unify_sets(?, ?)
>   No description available
> 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)
>   No description available

## Other Exports

> export op(500, yfx, \)
> 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, 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:

- membership
- non-membership
- inclusion (subset)
- equality
- intersection
- union
- difference
- symmetric difference
- disjointness
- cardinality

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

### 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

- Author: Joachim Schimpf, Neng-Fa Zhou, Andrew Sadler
- Copyright © Cisco Systems, Inc.
- Date: $Date: 2006/09/23 01:53:35 $

Generated from ic_hybrid_sets.eci on Sat Nov 8 06:55:44 2008