# MiniZinc Documentation - Standard Library

Logical operations are the standard operators of Boolean logic.

Functions and Predicates
test '->'(bool: x, bool: y)

Usage: x->y

Return truth value of x implies y

predicate '->'(var bool: x, var bool: y)

Usage: x->y

Return truth value of x implies y

test '/\'(bool: x, bool: y)

Usage: x/\y

Return truth value of xy

predicate '/\'(var bool: x, var bool: y)

Usage: x/\y

Return truth value of xy

test '<-'(bool: x, bool: y)

Usage: x<-y

Return truth value of y implies x

predicate '<-'(var bool: x, var bool: y)

Usage: x<-y

Return truth value of y implies x

test '<->'(bool: x, bool: y)

Usage: x<->y

Return truth value of x if-and-only-if y

predicate '<->'(var bool: x, var bool: y)

Usage: x<->y

Return truth value of x if-and-only-if y

test '\/'(bool: x, bool: y)

Usage: x\/y

Return truth value of xy

predicate '\/'(var bool: x, var bool: y)

Usage: x\/y

Return truth value of xy

test 'not'(bool: x)

Usage: not x

Return truth value of the negation of x

predicate 'not'(var bool: x)

Usage: not x

Return truth value of the negation of x

test 'xor'(bool: x, bool: y)

Usage: x xor y

Return truth value of x xor y

predicate 'xor'(var bool: x, var bool: y)

Usage: x xor y

Return truth value of x xor y

predicate clause(array [$T] of var bool: x, array [$T] of var bool: y)

Return truth value of $$(\bigvee_i {\bf x}[i]) \lor (\bigvee_j \lnot {\bf y}[j])$$

predicate clause(array [$T] of bool: x, array [$T] of bool: y)

Return truth value of $$(\bigvee_i {\bf x}[i]) \lor (\bigvee_j \lnot {\bf y}[j])$$

test exists(array [$T] of bool: x) Return truth value of $$\bigvee_i {\bf x}[i]$$ predicate exists(array [$T] of var bool: x)

Return truth value of $$\bigvee_i {\bf x}[i]$$

test forall(array [$T] of bool: x) Return truth value of $$\bigwedge_i {\bf x}[i]$$ predicate forall(array [$T] of var bool: x)

Return truth value of $$\bigwedge_i {\bf x}[i]$$

test iffall(array [$T] of bool: x) Return truth value of $$\text{true}\oplus (\oplus_i {\bf x}[i])$$ predicate iffall(array [$T] of var bool: x) =
array_bool_xor(array1d(x)++[true])
(standard decomposition from builtins.mzn:595)

Return truth value of $$\text{true}\oplus (\oplus_i {\bf x}[i])$$

test xorall(array [$T] of bool: x) Return truth value of $$\oplus_i {\bf x}[i]$$ predicate xorall(array [$T] of var bool: x) =
array_bool_xor(array1d(x))
(standard decomposition from builtins.mzn:590)

Return truth value of $$\oplus_i {\bf x}[i]$$