## 5.135. domain

Origin

Domain definition.

Constraint

$\mathrm{𝚍𝚘𝚖𝚊𝚒𝚗}\left(\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂},\mathrm{𝙻𝙾𝚆},\mathrm{𝚄𝙿}\right)$

Synonym

$\mathrm{𝚍𝚘𝚖}$.

Arguments
 $\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}$ $\mathrm{𝚌𝚘𝚕𝚕𝚎𝚌𝚝𝚒𝚘𝚗}\left(\mathrm{𝚟𝚊𝚛}-\mathrm{𝚍𝚟𝚊𝚛}\right)$ $\mathrm{𝙻𝙾𝚆}$ $\mathrm{𝚒𝚗𝚝}$ $\mathrm{𝚄𝙿}$ $\mathrm{𝚒𝚗𝚝}$
Restrictions
 $\mathrm{𝚛𝚎𝚚𝚞𝚒𝚛𝚎𝚍}$$\left(\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂},\mathrm{𝚟𝚊𝚛}\right)$ $\mathrm{𝙻𝙾𝚆}\le \mathrm{𝚄𝙿}$
Purpose

Enforce all the variables of the collection $\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}$ to take a value within the interval $\left[\mathrm{𝙻𝙾𝚆},\mathrm{𝚄𝙿}\right]$.

Example
$\left(〈2,8,2〉,1,9\right)$

The $\mathrm{𝚍𝚘𝚖𝚊𝚒𝚗}$ constraint holds since all the values 2, 8 and 2 of its first argument are greater than or equal to its second argument $\mathrm{𝙻𝙾𝚆}=1$ and less than or equal to its third argument $\mathrm{𝚄𝙿}=9$.

Typical
 $|\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}|>1$ $\mathrm{𝙻𝙾𝚆}<\mathrm{𝚄𝙿}$
Symmetries
• Items of $\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}$ are permutable.

• An occurrence of a value of $\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}.\mathrm{𝚟𝚊𝚛}$ can be replaced by any other value in $\left[\mathrm{𝙻𝙾𝚆},\mathrm{𝚄𝙿}\right]$.

• $\mathrm{𝙻𝙾𝚆}$ can be decreased.

• $\mathrm{𝚄𝙿}$ can be increased.

• One and the same constant can be added to the $\mathrm{𝚟𝚊𝚛}$ attribute of all items of $\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}$ as well as to $\mathrm{𝙻𝙾𝚆}$ and $\mathrm{𝚄𝙿}$.

Arg. properties

Contractible wrt. $\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}$.

Remark

The $\mathrm{𝚍𝚘𝚖𝚊𝚒𝚗}$ constraint is called $\mathrm{𝚍𝚘𝚖}$ in Gecode (http://www.gecode.org/).

Reformulation

The $\mathrm{𝚍𝚘𝚖𝚊𝚒𝚗}$$\left(〈\mathrm{𝚟𝚊𝚛}-{V}_{1},\mathrm{𝚟𝚊𝚛}-{V}_{2},\cdots ,\mathrm{𝚟𝚊𝚛}-{V}_{|\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}|}〉,\mathrm{𝙻𝙾𝚆},\mathrm{𝚄𝙿}\right)$ constraint can be expressed in term of the conjunction

${V}_{1}\ge \mathrm{𝙻𝙾𝚆}\wedge {V}_{1}\le \mathrm{𝚄𝙿}$,

${V}_{2}\ge \mathrm{𝙻𝙾𝚆}\wedge {V}_{2}\le \mathrm{𝚄𝙿}$,

$\cdots \cdots \cdots \cdots \cdots \cdots$

${V}_{|\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}|}\ge \mathrm{𝙻𝙾𝚆}\wedge {V}_{|\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}|}\le \mathrm{𝚄𝙿}$.

Systems

member in Choco, dom in Gecode, domain in SICStus.