## 5.69. clause_and

Origin

Logic

Constraint

$\mathrm{𝚌𝚕𝚊𝚞𝚜𝚎}_\mathrm{𝚊𝚗𝚍}\left(\mathrm{𝙿𝙾𝚂𝚅𝙰𝚁𝚂},\mathrm{𝙽𝙴𝙶𝚅𝙰𝚁𝚂},\mathrm{𝚅𝙰𝚁}\right)$

Synonym

$\mathrm{𝚌𝚕𝚊𝚞𝚜𝚎}$.

Arguments
 $\mathrm{𝙿𝙾𝚂𝚅𝙰𝚁𝚂}$ $\mathrm{𝚌𝚘𝚕𝚕𝚎𝚌𝚝𝚒𝚘𝚗}\left(\mathrm{𝚟𝚊𝚛}-\mathrm{𝚍𝚟𝚊𝚛}\right)$ $\mathrm{𝙽𝙴𝙶𝚅𝙰𝚁𝚂}$ $\mathrm{𝚌𝚘𝚕𝚕𝚎𝚌𝚝𝚒𝚘𝚗}\left(\mathrm{𝚟𝚊𝚛}-\mathrm{𝚍𝚟𝚊𝚛}\right)$ $\mathrm{𝚅𝙰𝚁}$ $\mathrm{𝚍𝚟𝚊𝚛}$
Restrictions
 $|\mathrm{𝙿𝙾𝚂𝚅𝙰𝚁𝚂}|+|\mathrm{𝙽𝙴𝙶𝚅𝙰𝚁𝚂}|>0$ $\mathrm{𝚛𝚎𝚚𝚞𝚒𝚛𝚎𝚍}$$\left(\mathrm{𝙿𝙾𝚂𝚅𝙰𝚁𝚂},\mathrm{𝚟𝚊𝚛}\right)$ $\mathrm{𝙿𝙾𝚂𝚅𝙰𝚁𝚂}.\mathrm{𝚟𝚊𝚛}\ge 0$ $\mathrm{𝙿𝙾𝚂𝚅𝙰𝚁𝚂}.\mathrm{𝚟𝚊𝚛}\le 1$ $\mathrm{𝚛𝚎𝚚𝚞𝚒𝚛𝚎𝚍}$$\left(\mathrm{𝙽𝙴𝙶𝚅𝙰𝚁𝚂},\mathrm{𝚟𝚊𝚛}\right)$ $\mathrm{𝙽𝙴𝙶𝚅𝙰𝚁𝚂}.\mathrm{𝚟𝚊𝚛}\ge 0$ $\mathrm{𝙽𝙴𝙶𝚅𝙰𝚁𝚂}.\mathrm{𝚟𝚊𝚛}\le 1$ $\mathrm{𝚅𝙰𝚁}\ge 0$ $\mathrm{𝚅𝙰𝚁}\le 1$
Purpose

Given a first collection of 0-1 variables $\mathrm{𝙿𝙾𝚂𝚅𝙰𝚁𝚂}={U}_{1},{U}_{2},\cdots ,{U}_{p}$, a second collection of 0-1 variables $\mathrm{𝙽𝙴𝙶𝚅𝙰𝚁𝚂}={V}_{1},{V}_{2},\cdots ,{V}_{n}$, and a variable $\mathrm{𝚅𝙰𝚁}$, enforce $\mathrm{𝚅𝙰𝚁}=\left({U}_{1}\wedge {U}_{2}\wedge \cdots \wedge {U}_{p}\right)\wedge \left(¬{V}_{1}\wedge ¬{V}_{2}\wedge \cdots \wedge ¬{V}_{n}\right)$.

Example
$\left(〈1,0〉,〈0〉,0\right)$
Typical
$|\mathrm{𝙿𝙾𝚂𝚅𝙰𝚁𝚂}|+|\mathrm{𝙽𝙴𝙶𝚅𝙰𝚁𝚂}|>1$
Symmetries
• Items of $\mathrm{𝙿𝙾𝚂𝚅𝙰𝚁𝚂}$ are permutable.

• Items of $\mathrm{𝙽𝙴𝙶𝚅𝙰𝚁𝚂}$ are permutable.

Arg. properties
• Extensible wrt. $\mathrm{𝙿𝙾𝚂𝚅𝙰𝚁𝚂}$ when $\mathrm{𝚅𝙰𝚁}=0$.

• Extensible wrt. $\mathrm{𝙽𝙴𝙶𝚅𝙰𝚁𝚂}$ when $\mathrm{𝚅𝙰𝚁}=0$.

Remark

The $\mathrm{𝚌𝚕𝚊𝚞𝚜𝚎}_\mathrm{𝚘𝚛}$ constraint is called $\mathrm{𝚌𝚕𝚊𝚞𝚜𝚎}$ in Gecode (http://www.gecode.org/).

Systems
Figure 5.69.1 depicts the automaton associated with the $\mathrm{𝚌𝚕𝚊𝚞𝚜𝚎}_\mathrm{𝚊𝚗𝚍}$ constraint:
• To the argument $\mathrm{𝚅𝙰𝚁}$ of the $\mathrm{𝚌𝚕𝚊𝚞𝚜𝚎}_\mathrm{𝚊𝚗𝚍}$ constraint corresponds the first signature variable.
• To each variable of the argument $\mathrm{𝙿𝙾𝚂𝚅𝙰𝚁𝚂}$ corresponds a signature variable.
• Finally, to each variable ${\mathrm{𝚅𝙰𝚁}}_{i}$ of the argument $\mathrm{𝙽𝙴𝙶𝚅𝙰𝚁𝚂}$ corresponds a signature variable that is the negation of ${\mathrm{𝚅𝙰𝚁}}_{i}$.