MiniZinc Documentation - Standard Library

These functions return information about declared or inferred variable bounds and domains.

Functions and Predicates
function set of int: dom(var int: x)

Return domain of x

function set of int: dom_array(array [$T] of var int: x)

Return union of all domains of the elements in array x

function set of int: dom_bounds_array(array [$T] of var int: x)

Return approximation of union of all domains of the elements in array x

function int: dom_size(var int: x) =
card(dom(x))
(standard decomposition from builtins.mzn:1328)

Return cardinality of the domain of x

function $T: fix(var opt $T: x)

Check if the value of x is fixed at this point in evaluation. If it is fixed, return its value, otherwise abort.

function array [$U] of $T: fix(array [$U] of var opt $T: x)

Check if the value of every element of the array x is fixedat this point in evaluation. If all are fixed, return an array of their values, otherwise abort.

test has_bounds(var int: x)

Test if variable x has declared, finite bounds

test has_bounds(var float: x)

Test if variable x has declared, finite bounds

test has_ub_set(var set of int: x)

Test if variable x has a declared, finite upper bound

test is_fixed(var opt $T: x)

Test if x is fixed

test is_fixed(array [$U] of var opt $T: x)

Test if every element of array x is fixed

function int: lb(var int: x)

Return lower bound of x

function int: lb(var opt int: x)

Return lower bound of x

function float: lb(var float: x)

Return lower bound of x

function set of int: lb(var set of int: x)

Return lower bound of x

function array [$U] of int: lb(array [$U] of var int: x) =
arrayXd(x, [ lb(xx) | xx in array1d(x) ])
(standard decomposition from builtins.mzn:1289)

Return array of lower bounds of the elements in array x

function array [$U] of float: lb(array [$U] of var float: x) =
arrayXd(x, [ lb(xx) | xx in array1d(x) ])
(standard decomposition from builtins.mzn:1295)

Return array of lower bounds of the elements in array x

function array [$U] of set of int: lb(array [$U] of var set of int: x) =
arrayXd(x, [ lb(xx) | xx in array1d(x) ])
(standard decomposition from builtins.mzn:1301)

Return array of lower bounds of the elements in array x

function int: lb_array(array [$U] of var opt int: x)

Return minimum of all lower bounds of the elements in array x

function float: lb_array(array [$U] of var float: x)

Return minimum of all lower bounds of the elements in array x

function set of int: lb_array(array [$U] of var set of int: x)

Return intersection of all lower bounds of the elements in array x

function int: ub(var int: x)

Return upper bound of x

function int: ub(var opt int: x)

Return upper bound of x

function float: ub(var float: x)

Return upper bound of x

function set of int: ub(var set of int: x)

Return upper bound of x

function array [$U] of int: ub(array [$U] of var int: x) =
arrayXd(x, [ ub(xx) | xx in array1d(x) ])
(standard decomposition from builtins.mzn:1292)

Return array of upper bounds of the elements in array x

function array [$U] of float: ub(array [$U] of var float: x) =
arrayXd(x, [ ub(xx) | xx in array1d(x) ])
(standard decomposition from builtins.mzn:1298)

Return array of upper bounds of the elements in array x

function array [$U] of set of int: ub(array [$U] of var set of int: x) =
arrayXd(x, [ ub(xx) | xx in array1d(x) ])
(standard decomposition from builtins.mzn:1304)

Return array of upper bounds of the elements in array x

function int: ub_array(array [$U] of var opt int: x)

Return maximum of all upper bounds of the elements in array x

function float: ub_array(array [$U] of var float: x)

Return maximum of all upper bounds of the elements in array x

function set of int: ub_array(array [$U] of var set of int: x)

Return union of all upper bounds of the elements in array x