## 5.305. order

Origin
Constraint

$\mathrm{𝚘𝚛𝚍𝚎𝚛}\left(\mathrm{𝚅𝙴𝙲𝚃𝙾𝚁𝚂},\mathrm{𝙿𝙴𝚁𝙼𝚄𝚃𝙰𝚃𝙸𝙾𝙽}\right)$

Type
 $\mathrm{𝚅𝙴𝙲𝚃𝙾𝚁}$ $\mathrm{𝚌𝚘𝚕𝚕𝚎𝚌𝚝𝚒𝚘𝚗}\left(\mathrm{𝚟𝚊𝚛}-\mathrm{𝚍𝚟𝚊𝚛}\right)$
Arguments
 $\mathrm{𝚅𝙴𝙲𝚃𝙾𝚁𝚂}$ $\mathrm{𝚌𝚘𝚕𝚕𝚎𝚌𝚝𝚒𝚘𝚗}\left(\mathrm{𝚟𝚎𝚌}-\mathrm{𝚅𝙴𝙲𝚃𝙾𝚁}\right)$ $\mathrm{𝙿𝙴𝚁𝙼𝚄𝚃𝙰𝚃𝙸𝙾𝙽}$ $\mathrm{𝚌𝚘𝚕𝚕𝚎𝚌𝚝𝚒𝚘𝚗}\left(\mathrm{𝚟𝚊𝚛}-\mathrm{𝚍𝚟𝚊𝚛}\right)$
Restrictions
 $|\mathrm{𝚅𝙴𝙲𝚃𝙾𝚁}|\ge 1$ $|\mathrm{𝚅𝙴𝙲𝚃𝙾𝚁𝚂}|\ge 1$ $\mathrm{𝚛𝚎𝚚𝚞𝚒𝚛𝚎𝚍}$$\left(\mathrm{𝚅𝙴𝙲𝚃𝙾𝚁𝚂},\mathrm{𝚟𝚎𝚌}\right)$ $\mathrm{𝚜𝚊𝚖𝚎}_\mathrm{𝚜𝚒𝚣𝚎}$$\left(\mathrm{𝚅𝙴𝙲𝚃𝙾𝚁𝚂},\mathrm{𝚟𝚎𝚌}\right)$ $\mathrm{𝚛𝚎𝚚𝚞𝚒𝚛𝚎𝚍}$$\left(\mathrm{𝙿𝙴𝚁𝙼𝚄𝚃𝙰𝚃𝙸𝙾𝙽},\mathrm{𝚟𝚊𝚛}\right)$ $\mathrm{𝙿𝙴𝚁𝙼𝚄𝚃𝙰𝚃𝙸𝙾𝙽}.\mathrm{𝚟𝚊𝚛}\ge 1$ $\mathrm{𝙿𝙴𝚁𝙼𝚄𝚃𝙰𝚃𝙸𝙾𝙽}.\mathrm{𝚟𝚊𝚛}\le |\mathrm{𝙿𝙴𝚁𝙼𝚄𝚃𝙰𝚃𝙸𝙾𝙽}|$ $|\mathrm{𝙿𝙴𝚁𝙼𝚄𝚃𝙰𝚃𝙸𝙾𝙽}|=|\mathrm{𝚅𝙴𝙲𝚃𝙾𝚁𝚂}|$
Purpose

Given a collection of distinct $\mathrm{𝚅𝙴𝙲𝚃𝙾𝚁𝚂}$, enforces $\mathrm{𝙿𝙴𝚁𝙼𝚄𝚃𝙰𝚃𝙸𝙾𝙽}.\mathrm{𝚟𝚊𝚛}\left[i\right]$ to be equal to the position of vector $\mathrm{𝚅𝙴𝙲𝚃𝙾𝚁𝚂}.\mathrm{𝚟𝚎𝚌}\left[i\right]$ within the sorted vectors of the collection $\mathrm{𝚅𝙴𝙲𝚃𝙾𝚁𝚂}$.

Example
$\left(\begin{array}{c}〈\begin{array}{c}\mathrm{𝚟𝚎𝚌}-〈1,1,2,2〉,\hfill \\ \mathrm{𝚟𝚎𝚌}-〈2,1,2,1〉,\hfill \\ \mathrm{𝚟𝚎𝚌}-〈2,1,1,1〉,\hfill \\ \mathrm{𝚟𝚎𝚌}-〈1,1,1,2〉,\hfill \\ \mathrm{𝚟𝚎𝚌}-〈1,2,2,1〉,\hfill \\ \mathrm{𝚟𝚎𝚌}-〈1,1,1,1〉,\hfill \\ \mathrm{𝚟𝚎𝚌}-〈2,2,1,1〉,\hfill \\ \mathrm{𝚟𝚎𝚌}-〈2,1,1,2〉\hfill \end{array}〉,\hfill \\ 〈3,7,5,2,4,1,8,6〉\hfill \end{array}\right)$

The $\mathrm{𝚘𝚛𝚍𝚎𝚛}$ constraint holds since:

• The vector $〈1,1,2,2〉$ is in the third position of the sorted collection $\mathrm{𝚅𝙴𝙲𝚃𝙾𝚁𝚂}$,

• The vector $〈2,1,2,1〉$ is in the seventh position of the sorted collection $\mathrm{𝚅𝙴𝙲𝚃𝙾𝚁𝚂}$,

• The vector $〈2,1,1,1〉$ is in the fifth position of the sorted collection $\mathrm{𝚅𝙴𝙲𝚃𝙾𝚁𝚂}$,

• The vector $〈1,1,1,2〉$ is in the second position of the sorted collection $\mathrm{𝚅𝙴𝙲𝚃𝙾𝚁𝚂}$,

• The vector $〈1,2,2,1〉$ is in the fourth position of the sorted collection $\mathrm{𝚅𝙴𝙲𝚃𝙾𝚁𝚂}$,

• The vector $〈1,1,1,1〉$ is in the first position of the sorted collection $\mathrm{𝚅𝙴𝙲𝚃𝙾𝚁𝚂}$,

• The vector $〈2,2,1,1〉$ is in the eigth position of the sorted collection $\mathrm{𝚅𝙴𝙲𝚃𝙾𝚁𝚂}$,

• The vector $〈2,1,1,2〉$ is in the sixth position of the sorted collection $\mathrm{𝚅𝙴𝙲𝚃𝙾𝚁𝚂}$.

Typical
 $|\mathrm{𝚅𝙴𝙲𝚃𝙾𝚁}|>1$ $|\mathrm{𝚅𝙴𝙲𝚃𝙾𝚁𝚂}|>1$
Arg. properties

Functional dependency: $\mathrm{𝙿𝙴𝚁𝙼𝚄𝚃𝙰𝚃𝙸𝙾𝙽}$ determined by $\mathrm{𝚅𝙴𝙲𝚃𝙾𝚁𝚂}$.