5.133. gcd

Origin
Constraint

$\mathrm{\pi \pi \pi }\left(\mathrm{\pi },\mathrm{\pi },\mathrm{\pi }\right)$

Arguments
 $\mathrm{\pi }$ $\mathrm{\pi \pi \pi \pi }$ $\mathrm{\pi }$ $\mathrm{\pi \pi \pi \pi }$ $\mathrm{\pi }$ $\mathrm{\pi \pi \pi \pi }$
Restrictions
 $\mathrm{\pi }\beta ₯0$ $\mathrm{\pi }\beta ₯0$ $\mathrm{\pi }\beta ₯0$
Purpose

Enforce the fact that $\mathrm{\pi }$ is the greatest common divisor of $\mathrm{\pi }$ and $\mathrm{\pi }$.

Example
$\left(24,60,12\right)$

The $\mathrm{\pi \pi \pi }$ constraint holds since 12 is the greatest common divisor of 24 and 60.

Typical
 $\mathrm{\pi }>1$ $\mathrm{\pi }>1$
Symmetry

Arguments are permutable w.r.t. permutation $\left(\mathrm{\pi },\mathrm{\pi }\right)$ $\left(\mathrm{\pi }\right)$.

Algorithm

InΒ [DenmatGotliebDucasse07] a filtering algorithm for the $\mathrm{\pi \pi \pi }$ constraint was automatically derived from the Euclidian algorithm by using constructive disjunction and abstract interpretation in order to approximate the behaviour of the while loop of the Euclidian algorithm.