Selected Set Operands

The set elements operand is a relatively uncommon type of operand created by using array access (the #[] property) on set enumeration operands with a set operand as index. The operand represents all sets with indices present in the set operand index.

Examples of Selected Set Operands

All selected set operands are created by using SetEnumOperand#[] property.

# Creates a selected set operand from set_enum_operand and set_operand.
selected_set_operand = set_enum_operand[set_operand]

Constraints

Generated from SelectedSetConstraintReceiver.

disjoint

disjoint(options = {})

Constrains the selected sets to be pairwise disjoint.

Examples
# Constrains all sets selected by +set_enum[set]+ to be pairwise
# disjoint.
set_enum[set].must_be.disjoint

Properties

Generated from SelectedSetOperand.

union

union()

Produces a SetOperand representing the selected sets’ union.

Examples
# The union of all sets selected by +set_enum[set]+.
set_enum[set].union

intersection

intersection(options = {})

Produces a SetOperand representing the selected sets’ intersection. The option :with can be used to enumerate the elements in the universe.

Examples
# The intersection of all sets selected by +set_enum[set]+.
set_enum[set].intersection

# The same intersection as above, but with [3,5,7] as universe.
set_enum[set].intersection(:with => [3,5,7])