## 5.1. abs_value

Origin

Arithmetic.

Constraint

$\mathrm{\pi \pi \pi }_\mathrm{\pi \pi \pi \pi \pi }\left(\mathrm{\pi },\mathrm{\pi }\right)$

Usual name

$\mathrm{\pi \pi \pi }$

Synonym

$\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi }_\mathrm{\pi \pi \pi \pi \pi }$.

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

Enforce the fact that the first variable is equal to the absolute value of the second variable.

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

The $\mathrm{\pi \pi \pi }_\mathrm{\pi \pi \pi \pi \pi }$ constraint holds since 8 is equal to $|-8|$.

All solutions

FigureΒ 5.1.1 gives all solutions to the following non ground instance of the $\mathrm{\pi \pi \pi }_\mathrm{\pi \pi \pi \pi \pi }$ constraint: $\mathrm{\pi }\beta \left[1,6\right],$ $\mathrm{\pi }\beta \left[-2,3\right],$ $\mathrm{\pi \pi \pi }_\mathrm{\pi \pi \pi \pi \pi }$$\left(\mathrm{\pi },\mathrm{\pi }\right)$.

Arg. properties

Functional dependency: $\mathrm{\pi }$ determined by $\mathrm{\pi }$.

Systems

abs in Choco, abs in Gecode.