## 5.180. in_intervals

Origin

Domain definition.

Constraint

$\mathrm{𝚒𝚗}_\mathrm{𝚒𝚗𝚝𝚎𝚛𝚟𝚊𝚕𝚜}\left(\mathrm{𝚅𝙰𝚁},\mathrm{𝙸𝙽𝚃𝙴𝚁𝚅𝙰𝙻𝚂}\right)$

Synonym

$\mathrm{𝚒𝚗}$.

Arguments
 $\mathrm{𝚅𝙰𝚁}$ $\mathrm{𝚍𝚟𝚊𝚛}$ $\mathrm{𝙸𝙽𝚃𝙴𝚁𝚅𝙰𝙻𝚂}$ $\mathrm{𝚌𝚘𝚕𝚕𝚎𝚌𝚝𝚒𝚘𝚗}\left(\mathrm{𝚕𝚘𝚠}-\mathrm{𝚒𝚗𝚝},\mathrm{𝚞𝚙}-\mathrm{𝚒𝚗𝚝}\right)$
Restrictions
 $\mathrm{𝚛𝚎𝚚𝚞𝚒𝚛𝚎𝚍}$$\left(\mathrm{𝙸𝙽𝚃𝙴𝚁𝚅𝙰𝙻𝚂},\left[\mathrm{𝚕𝚘𝚠},\mathrm{𝚞𝚙}\right]\right)$ $\mathrm{𝙸𝙽𝚃𝙴𝚁𝚅𝙰𝙻𝚂}.\mathrm{𝚕𝚘𝚠}\le \mathrm{𝙸𝙽𝚃𝙴𝚁𝚅𝙰𝙻𝚂}.\mathrm{𝚞𝚙}$ $|\mathrm{𝙸𝙽𝚃𝙴𝚁𝚅𝙰𝙻𝚂}|>0$
Purpose

Enforce the domain variable $\mathrm{𝚅𝙰𝚁}$ to take a value within one of the intervals specified by the collection of intervals $\mathrm{𝙸𝙽𝚃𝙴𝚁𝚅𝙰𝙻𝚂}$.

Example
$\left(5,〈\mathrm{𝚕𝚘𝚠}-1\mathrm{𝚞𝚙}-1,\mathrm{𝚕𝚘𝚠}-3\mathrm{𝚞𝚙}-5,\mathrm{𝚕𝚘𝚠}-8\mathrm{𝚞𝚙}-8〉\right)$

The $\mathrm{𝚒𝚗}_\mathrm{𝚒𝚗𝚝𝚎𝚛𝚟𝚊𝚕𝚜}$ constraint holds since its first argument $\mathrm{𝚅𝙰𝚁}=5$ belongs to the second intervals of the collection of intervals $\mathrm{𝙸𝙽𝚃𝙴𝚁𝚅𝙰𝙻𝚂}$.

Typical
$|\mathrm{𝙸𝙽𝚃𝙴𝚁𝚅𝙰𝙻𝚂}|>1$
Symmetries
• Items of $\mathrm{𝙸𝙽𝚃𝙴𝚁𝚅𝙰𝙻𝚂}$ are permutable.

• $\mathrm{𝙸𝙽𝚃𝙴𝚁𝚅𝙰𝙻𝚂}.\mathrm{𝚕𝚘𝚠}$ can be decreased.

• $\mathrm{𝙸𝙽𝚃𝙴𝚁𝚅𝙰𝙻𝚂}.\mathrm{𝚞𝚙}$ can be increased.

• One and the same constant can be added to $\mathrm{𝚅𝙰𝚁}$ as well as to the $\mathrm{𝚕𝚘𝚠}$ and $\mathrm{𝚞𝚙}$ attributes of all items of $\mathrm{𝙸𝙽𝚃𝙴𝚁𝚅𝙰𝙻𝚂}$.

Arg. properties

Extensible wrt. $\mathrm{𝙸𝙽𝚃𝙴𝚁𝚅𝙰𝙻𝚂}$.

Remark

Entailment occurs immediately after posting this constraint.

Systems

dom in Gecode, in in JaCoP, in in SICStus.

specialisation: $\mathrm{𝚒𝚗}_\mathrm{𝚒𝚗𝚝𝚎𝚛𝚟𝚊𝚕}$ (set of intervals replaced by single interval).