## 5.127. eq

Origin

Arithmetic.

Constraint

$\mathrm{𝚎𝚚}\left(\mathrm{𝚅𝙰𝚁}\mathtt{1},\mathrm{𝚅𝙰𝚁}\mathtt{2}\right)$

Synonym

$\mathrm{𝚡𝚎𝚚𝚢}$.

Arguments
 $\mathrm{𝚅𝙰𝚁}\mathtt{1}$ $\mathrm{𝚍𝚟𝚊𝚛}$ $\mathrm{𝚅𝙰𝚁}\mathtt{2}$ $\mathrm{𝚍𝚟𝚊𝚛}$
Restriction
Purpose

Enforce the fact that two variables are equal.

Example
$\left(8,8\right)$

The $\mathrm{𝚎𝚚}$ constraint holds since 8 is equal to 8.

Symmetries
• Arguments are permutable w.r.t. permutation $\left(\mathrm{𝚅𝙰𝚁}\mathtt{1},\mathrm{𝚅𝙰𝚁}\mathtt{2}\right)$.

• All occurrences of a value in $\mathrm{𝚅𝙰𝚁}\mathtt{1}$ or $\mathrm{𝚅𝙰𝚁}\mathtt{2}$ can be renamed to any unused value.

Systems

eq in Choco, rel in Gecode, xeqy in JaCoP, #= in SICStus.

generalisation: $\mathrm{𝚊𝚕𝚕}_\mathrm{𝚎𝚚𝚞𝚊𝚕}$ (equality between more than two variables), $\mathrm{𝚎𝚚}_\mathrm{𝚌𝚜𝚝}$ ($\mathrm{𝚌𝚘𝚗𝚜𝚝𝚊𝚗𝚝}$ added), $\mathrm{𝚎𝚚}_\mathrm{𝚜𝚎𝚝}$ ($\mathrm{𝚟𝚊𝚛𝚒𝚊𝚋𝚕𝚎}$ replaced by $\mathrm{𝚜𝚎𝚝}\mathrm{𝚟𝚊𝚛𝚒𝚊𝚋𝚕𝚎}$).