## 5.414. used_by_modulo

Origin
Constraint

$\mathrm{𝚞𝚜𝚎𝚍}_\mathrm{𝚋𝚢}_\mathrm{𝚖𝚘𝚍𝚞𝚕𝚘}\left(\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}\mathtt{1},\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}\mathtt{2},𝙼\right)$

Arguments
 $\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}\mathtt{1}$ $\mathrm{𝚌𝚘𝚕𝚕𝚎𝚌𝚝𝚒𝚘𝚗}\left(\mathrm{𝚟𝚊𝚛}-\mathrm{𝚍𝚟𝚊𝚛}\right)$ $\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}\mathtt{2}$ $\mathrm{𝚌𝚘𝚕𝚕𝚎𝚌𝚝𝚒𝚘𝚗}\left(\mathrm{𝚟𝚊𝚛}-\mathrm{𝚍𝚟𝚊𝚛}\right)$ $𝙼$ $\mathrm{𝚒𝚗𝚝}$
Restrictions
 $|\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}\mathtt{1}|\ge |\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}\mathtt{2}|$ $\mathrm{𝚛𝚎𝚚𝚞𝚒𝚛𝚎𝚍}$$\left(\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}\mathtt{1},\mathrm{𝚟𝚊𝚛}\right)$ $\mathrm{𝚛𝚎𝚚𝚞𝚒𝚛𝚎𝚍}$$\left(\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}\mathtt{2},\mathrm{𝚟𝚊𝚛}\right)$ $𝙼>0$
Purpose

For each integer $R$ in $\left[0,𝙼-1\right]$, let $𝑁{\mathit{1}}_{R}$ (respectively $𝑁{\mathit{2}}_{R}$) denote the number of variables of $\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}\mathtt{1}$ (respectively $\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}\mathtt{2}$) that have $R$ as a rest when divided by $𝙼$. For all $R$ in $\left[0,𝙼-1\right]$ we have $𝑁{\mathit{2}}_{R}>0⇒𝑁{\mathit{1}}_{R}\ge 𝑁{\mathit{2}}_{R}$.

Example
$\left(〈1,9,4,5,2,1〉,〈7,1,2,5〉,3\right)$

The values of the collection $\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}\mathtt{2}=〈7,1,2,5〉$ are respectively associated with the equivalence classes $7\mathrm{mod}3=1$, $1\mathrm{mod}3=1$, $2\mathrm{mod}3=2$, $5\mathrm{mod}3=2$. Therefore the equivalence classes 1 and 2 are respectively used 2 and 2 times.

Similarly, the values of the collection $\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}\mathtt{1}=〈1,9,4,5,2,1〉$ associated with the equivalence classes $1\mathrm{mod}3=1$, $9\mathrm{mod}3=0$, $4\mathrm{mod}3=1$, $5\mathrm{mod}3=2$, $2\mathrm{mod}3=2$, $1\mathrm{mod}3=1$. Therefore the equivalence classes 0, 1 and 2 are respectively used 1, 3 and 2 times.

Consequently, the $\mathrm{𝚞𝚜𝚎𝚍}_\mathrm{𝚋𝚢}_\mathrm{𝚖𝚘𝚍𝚞𝚕𝚘}$ constraint holds since, for each equivalence class associated with the collection $\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}\mathtt{2}=〈7,1,2,5〉$, its number of occurrences within $\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}\mathtt{1}=〈1,9,4,5,2,1〉$ is greater than or equal to its number of occurrences within $\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}\mathtt{2}$:

• The equivalence class 1 occurs 3 times within $〈1,9,4,5,2,1〉$ and 2 times within $〈7,1,2,5〉$.

• The equivalence class 2 occurs 2 times within $〈1,9,4,5,2,1〉$ and 2 times within $〈7,1,2,5〉$.

Typical
 $|\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}\mathtt{1}|>1$ $\mathrm{𝚛𝚊𝚗𝚐𝚎}$$\left(\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}\mathtt{1}.\mathrm{𝚟𝚊𝚛}\right)>1$ $|\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}\mathtt{2}|>1$ $\mathrm{𝚛𝚊𝚗𝚐𝚎}$$\left(\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}\mathtt{2}.\mathrm{𝚟𝚊𝚛}\right)>1$ $𝙼>1$ $𝙼<$$\mathrm{𝚖𝚊𝚡𝚟𝚊𝚕}$$\left(\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}\mathtt{1}.\mathrm{𝚟𝚊𝚛}\right)$ $𝙼<$$\mathrm{𝚖𝚊𝚡𝚟𝚊𝚕}$$\left(\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}\mathtt{2}.\mathrm{𝚟𝚊𝚛}\right)$
Symmetries
• Items of $\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}\mathtt{1}$ are permutable.

• Items of $\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}\mathtt{2}$ are permutable.

• An occurrence of a value $u$ of $\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}\mathtt{1}.\mathrm{𝚟𝚊𝚛}$ can be replaced by any other value $v$ such that $v$ is congruent to $u$ modulo $𝙼$.

• An occurrence of a value $u$ of $\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}\mathtt{2}.\mathrm{𝚟𝚊𝚛}$ can be replaced by any other value $v$ such that $v$ is congruent to $u$ modulo $𝙼$.

Arg. properties
• Contractible wrt. $\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}\mathtt{2}$.

• Extensible wrt. $\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}\mathtt{1}$.

• Aggregate: $\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}\mathtt{1}\left(\mathrm{𝚞𝚗𝚒𝚘𝚗}\right)$, $\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}\mathtt{2}\left(\mathrm{𝚞𝚗𝚒𝚘𝚗}\right)$, $𝙼\left(\mathrm{𝚒𝚍}\right)$.

Used in

specialisation: $\mathrm{𝚞𝚜𝚎𝚍}_\mathrm{𝚋𝚢}$ ($\mathrm{𝚟𝚊𝚛𝚒𝚊𝚋𝚕𝚎}\mathrm{mod}\mathrm{𝚌𝚘𝚗𝚜𝚝𝚊𝚗𝚝}$ replaced by $\mathrm{𝚟𝚊𝚛𝚒𝚊𝚋𝚕𝚎}$).

Keywords
Arc input(s)

$\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}\mathtt{1}$ $\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}\mathtt{2}$

Arc generator
$\mathrm{𝑃𝑅𝑂𝐷𝑈𝐶𝑇}$$↦\mathrm{𝚌𝚘𝚕𝚕𝚎𝚌𝚝𝚒𝚘𝚗}\left(\mathrm{𝚟𝚊𝚛𝚒𝚊𝚋𝚕𝚎𝚜}\mathtt{1},\mathrm{𝚟𝚊𝚛𝚒𝚊𝚋𝚕𝚎𝚜}\mathtt{2}\right)$

Arc arity
Arc constraint(s)
$\mathrm{𝚟𝚊𝚛𝚒𝚊𝚋𝚕𝚎𝚜}\mathtt{1}.\mathrm{𝚟𝚊𝚛}\mathrm{mod}𝙼=\mathrm{𝚟𝚊𝚛𝚒𝚊𝚋𝚕𝚎𝚜}\mathtt{2}.\mathrm{𝚟𝚊𝚛}\mathrm{mod}𝙼$
Graph property(ies)
 $•\text{for}\text{all}\text{connected}\text{components:}$$\mathrm{𝐍𝐒𝐎𝐔𝐑𝐂𝐄}$$\ge$$\mathrm{𝐍𝐒𝐈𝐍𝐊}$ $•$$\mathrm{𝐍𝐒𝐈𝐍𝐊}$$=|\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}\mathtt{2}|$

Graph model

Parts (A) and (B) of Figure 5.414.1 respectively show the initial and final graph associated with the Example slot. Since we use the $\mathrm{𝐍𝐒𝐎𝐔𝐑𝐂𝐄}$ and $\mathrm{𝐍𝐒𝐈𝐍𝐊}$ graph properties, the source and sink vertices of the final graph are stressed with a double circle. Since there is a constraint on each connected component of the final graph we also show the different connected components. Each of them corresponds to an equivalence class according to the arc constraint. Note that the vertex corresponding to the variable that takes value 9 was removed from the final graph since there is no arc for which the associated equivalence constraint holds. The $\mathrm{𝚞𝚜𝚎𝚍}_\mathrm{𝚋𝚢}_\mathrm{𝚖𝚘𝚍𝚞𝚕𝚘}$ constraint holds since:

• For each connected component of the final graph the number of sources is greater than or equal to the number of sinks.

• The number of sinks of the final graph is equal to $|\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}\mathtt{2}|$.

Signature

Since the initial graph contains only sources and sinks, and since sources of the initial graph cannot become sinks of the final graph, we have that the maximum number of sinks of the final graph is equal to $|\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}2|$. Therefore we can rewrite $\mathrm{𝐍𝐒𝐈𝐍𝐊}=|\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}2|$ to $\mathrm{𝐍𝐒𝐈𝐍𝐊}\ge |\mathrm{𝚅𝙰𝚁𝙸𝙰𝙱𝙻𝙴𝚂}2|$ and simplify $\underline{\overline{\mathrm{𝐍𝐒𝐈𝐍𝐊}}}$ to $\overline{\mathrm{𝐍𝐒𝐈𝐍𝐊}}$.