MiniZinc Documentation - Standard Library

These functions and predicates implement the standard library for working with option types. Note that option type support is still incomplete.

Sections:

Declarations in this section:

Functions and Predicates
test absent(var $T: x) =
false
(standard decomposition from stdlib.mzn:213)

Test if x is absent (always returns false)

test absent(opt $T: x) =
not occurs(x)
(standard decomposition from stdlib.mzn:215)

Test if x is absent

function $T: deopt(opt $T: x)

Return value of x if x is not absent. Aborts when evaluated on absent value.

function var $T: deopt(var $T: x) =
x
(standard decomposition from stdlib.mzn:206)

Return value x unchanged (since x is guaranteed to be non-optional).

test occurs(var $T: x) =
true
(standard decomposition from stdlib.mzn:209)

Test if x is not absent (always returns true)

test occurs(opt $T: x)

Test if x is not absent