MiniZinc Documentation - Standard Library

These builtins implement comparison operations.

Functions and Predicates
test '!='($T: x, $T: y)

Usage: x!=y

Return if x is not equal to y

predicate '!='(var $T: x, var $T: y)

Usage: x!=y

Return if x is not equal to y

test '!='(array [$U] of $T: x, array [$U] of $T: y)

Usage: x!=y

Return if array x is not equal to array y

predicate '!='(array [$U] of var $T: x, array [$U] of var $T: y)

Usage: x!=y

Return if array x is not equal to array y

test '<'($T: x, $T: y)

Usage: x

Return if x is less than y

predicate '<'(var $T: x, var $T: y)

Usage: x

Return if x is less than y

test '<'(array [$U] of $T: x, array [$U] of $T: y)

Usage: x

Return if array x is lexicographically smaller than array y

predicate '<'(array [$U] of var $T: x, array [$U] of var $T: y)

Usage: x

Return if array x is lexicographically smaller than array y

test '<='($T: x, $T: y)

Usage: x<=y

Return if x is less than or equal to y

predicate '<='(var $T: x, var $T: y)

Usage: x<=y

Return if x is less than or equal to y

test '<='(array [$U] of $T: x, array [$U] of $T: y)

Usage: x<=y

Return if array x is lexicographically smaller than or equal to array y

predicate '<='(array [$U] of var $T: x, array [$U] of var $T: y)

Usage: x<=y

Return if array x is lexicographically smaller than or equal to array y

test '='($T: x, $T: y)

Usage: x=y

Return if x is equal to y

test '='(opt $T: x, opt $T: y)

Usage: x=y

Return if x is equal to y

predicate '='(var $T: x, var $T: y)

Usage: x=y

Return if x is equal to y

predicate '='(var opt $T: x, var opt $T: y)

Usage: x=y

Return if x is equal to y

test '='(array [$T] of int: x, array [$T] of int: y) =
let { array [int] of int: xx = array1d(x), array [int] of int: yy = array1d(y), } in (assert(index_sets_agree(x, y), "array index sets do not match", forall ( i in index_set(xx) ) ( xx[i]==yy[i] )) )
(standard decomposition from builtins.mzn:63)

Usage: x=y

Return if array x is equal to array y

predicate '='(array [$T] of var int: x, array [$T] of var int: y) =
let { array [int] of var int: xx = array1d(x), array [int] of var int: yy = array1d(y), } in (assert(index_sets_agree(x, y), "array index sets do not match", forall ( i in index_set(xx) ) ( xx[i]==yy[i] )) )
(standard decomposition from builtins.mzn:73)

Usage: x=y

Return if array x is equal to array y

test '='(array [$T] of bool: x, array [$T] of bool: y) =
let { array [int] of bool: xx = array1d(x), array [int] of bool: yy = array1d(y), } in (assert(index_sets_agree(x, y), "array index sets do not match", forall ( i in index_set(xx) ) ( xx[i]==yy[i] )) )
(standard decomposition from builtins.mzn:83)

Usage: x=y

Return if array x is equal to array y

predicate '='(array [$T] of var bool: x, array [$T] of var bool: y) =
let { array [int] of var bool: xx = array1d(x), array [int] of var bool: yy = array1d(y), } in (assert(index_sets_agree(x, y), "array index sets do not match", forall ( i in index_set(xx) ) ( xx[i]==yy[i] )) )
(standard decomposition from builtins.mzn:93)

Usage: x=y

Return if array x is equal to array y

test '='(array [$T] of set of int: x, array [$T] of set of int: y) =
let { array [int] of set of int: xx = array1d(x), array [int] of set of int: yy = array1d(y), } in (assert(index_sets_agree(x, y), "array index sets do not match", forall ( i in index_set(xx) ) ( xx[i]==yy[i] )) )
(standard decomposition from builtins.mzn:103)

Usage: x=y

Return if array x is equal to array y

predicate '='(array [$T] of var set of int: x, array [$T] of var set of int: y) =
let { array [int] of var set of int: xx = array1d(x), array [int] of var set of int: yy = array1d(y), } in (assert(index_sets_agree(x, y), "array index sets do not match", forall ( i in index_set(xx) ) ( xx[i]==yy[i] )) )
(standard decomposition from builtins.mzn:113)

Usage: x=y

Return if array x is equal to array y

test '='(array [$T] of float: x, array [$T] of float: y) =
let { array [int] of float: xx = array1d(x), array [int] of float: yy = array1d(y), } in (assert(index_sets_agree(x, y), "array index sets do not match", forall ( i in index_set(xx) ) ( xx[i]==yy[i] )) )
(standard decomposition from builtins.mzn:123)

Usage: x=y

Return if array x is equal to array y

predicate '='(array [$T] of var float: x, array [$T] of var float: y) =
let { array [int] of var float: xx = array1d(x), array [int] of var float: yy = array1d(y), } in (assert(index_sets_agree(x, y), "array index sets do not match", forall ( i in index_set(xx) ) ( xx[i]==yy[i] )) )
(standard decomposition from builtins.mzn:133)

Usage: x=y

Return if array x is equal to array y

test '>'($T: x, $T: y)

Usage: x>y

Return if x is greater than y

predicate '>'(var $T: x, var $T: y)

Usage: x>y

Return if x is greater than y

test '>'(array [$U] of $T: x, array [$U] of $T: y)

Usage: x>y

Return if array x is lexicographically greater than array y

predicate '>'(array [$U] of var $T: x, array [$U] of var $T: y)

Usage: x>y

Return if array x is lexicographically greater than array y

test '>='($T: x, $T: y)

Usage: x>=y

Return if x is greater than or equal to y

predicate '>='(var $T: x, var $T: y)

Usage: x>=y

Return if x is greater than or equal to y

test '>='(array [$U] of $T: x, array [$U] of $T: y)

Usage: x>=y

Return if array x is lexicographically greater than or equal to array y