## 5.421. xor

Origin

Logic

Constraint

$\mathrm{\pi ‘\pi \pi }\left(\mathrm{\pi  \pi °\pi },\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }\right)$

Synonyms

$\mathrm{\pi \pi \pi }$, $\mathrm{\pi \pi \pi }$.

Arguments
 $\mathrm{\pi  \pi °\pi }$ $\mathrm{\pi \pi \pi \pi }$ $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }$ $\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi \pi \pi }\left(\mathrm{\pi \pi \pi }-\mathrm{\pi \pi \pi \pi }\right)$
Restrictions
 $\mathrm{\pi  \pi °\pi }\beta ₯0$ $\mathrm{\pi  \pi °\pi }\beta €1$ $|\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }|=2$ $\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi }$$\left(\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi },\mathrm{\pi \pi \pi }\right)$ $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }.\mathrm{\pi \pi \pi }\beta ₯0$ $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }.\mathrm{\pi \pi \pi }\beta €1$
Purpose

Let $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }$ be a collection of 0-1 variables ${\mathrm{\pi  \pi °\pi }}_{1},{\mathrm{\pi  \pi °\pi }}_{2}$. Enforce .

Example
 $\left(0,β©0,0βͺ\right)$ $\left(1,β©0,1βͺ\right)$ $\left(1,β©1,0βͺ\right)$ $\left(0,β©1,1βͺ\right)$
Symmetry

Items of $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }$ are permutable.

Arg. properties

Functional dependency: $\mathrm{\pi  \pi °\pi }$ determined by $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }$.

Counting
 Length ($n$) 2 3 4 5 6 7 8 Solutions 4 0 0 0 0 0 0

Number of solutions for $\mathrm{\pi ‘\pi \pi }$: domains $0..n$

Length ($n$)2
Total4
 Parameter value

02
12

Solution count for $\mathrm{\pi ‘\pi \pi }$: domains $0..n$

Systems

reifiedXor in Choco, rel in Gecode, xorbool in JaCoP, #\ in SICStus.

FigureΒ 5.421.1 depicts the automaton associated with the $\mathrm{\pi ‘\pi \pi }$ constraint. To the first argument $\mathrm{\pi  \pi °\pi }$ of the $\mathrm{\pi ‘\pi \pi }$ constraint corresponds the first signature variable. To each variable ${\mathrm{\pi  \pi °\pi }}_{i}$ of the second argument $\mathrm{\pi  \pi °\pi \pi Έ\pi °\pi ±\pi »\pi ΄\pi }$ of the $\mathrm{\pi ‘\pi \pi }$ constraint corresponds the next signature variable. There is no signature constraint.