Logo
2.7.0
The MiniZinc Handbook
  • 1. Overview
  • 2. A MiniZinc Tutorial
  • 3. User Manual
  • 4. Reference Manual
    • 4.1. Specification of MiniZinc
    • 4.2. The MiniZinc library
      • 4.2.1. Standard Library
      • 4.2.2. Global constraints
        • 4.2.2.1. All-Different and related constraints
        • 4.2.2.2. Lexicographic constraints
        • 4.2.2.3. Sorting constraints
        • 4.2.2.4. Channeling constraints
        • 4.2.2.5. Counting constraints
        • 4.2.2.6. Array-related constraints
        • 4.2.2.7. Set-related constraints
        • 4.2.2.8. Mathematical constraints
        • 4.2.2.9. Packing constraints
        • 4.2.2.10. Scheduling constraints
        • 4.2.2.11. Graph constraints
        • 4.2.2.12. Extensional constraints (table, regular etc.)
        • 4.2.2.13. Machine learning constraints
        • 4.2.2.14. Deprecated constraints
      • 4.2.3. FlatZinc builtins
      • 4.2.4. Additional declarations for Gecode
      • 4.2.5. Additional declarations for Chuffed
      • 4.2.6. MiniZincIDE tools
    • 4.3. Interfacing Solvers to Flatzinc
    • 4.4. Machine-readable JSON output format
The MiniZinc Handbook
  • Docs »
  • 4. Reference Manual »
  • 4.2. The MiniZinc library »
  • 4.2.2. Global constraints »
  • 4.2.2.7. Set-related constraints

4.2.2.7. Set-related constraints¶

In this section: disjoint, partition_set, roots.

disjoint¶

predicate disjoint(var set of $$E: s1, var set of $$E: s2)
Requires that sets s1 and s2 do not intersect.

partition_set¶

predicate partition_set(array [int] of var set of $$E: S,
                        set of $$E: universe)
Constrains the sets in array S to partition the universe.

roots¶

1.  predicate roots(array [$$X] of var $$Y: x,
                    var set of $$X: s,
                    var set of $$Y: t)

2.  function var set of $$X: roots(array [$$X] of var $$Y: x,
                                   var set of $$Y: t)
  1. Requires that x[i] in t for all i in s

  2. Returns s such that x[i] in t for all i in s

Next Previous

© Copyright 2016, 2017, 2018, 2019, 2020 Peter J. Stuckey, Kim Marriott, Guido Tack.

Creative Commons License