[ library(ic_global) | Reference Manual | Alphabetic Index ]

# bool_channeling(?Var, +DomainBools, +Min)

Channel the domain values of Vars to the 0/1 boolean variables in DomainBools

Var
  An integer domain variable
DomainBools
  A collection of N 0/1 domain variables or integers
Min
  An integer

## Description

Var is an integer domain variable whose initial interval is Min..(Min+N), and this constraint links the domain values of Var with the N 0/1 variables in DomainBools such that the i'th variable in DomainBools represents the value Min+i, and its value is 0 if the value is not in Var's domain, and 1 if Var is assigned the value [Thus, only one variable in DomainBools can take the value 1].

A variant of this constraint, called 'domain_constraint' is in the global constraint catalog. There, instead of having DomainBools and Min, there is a collection of Value-Bool pairs, representing a possible domain value and its associated 0/1 variable. The implementation here is described in the graph model for the domain_constraint in the catalog, and is generalised arc-consistent.