MiniZinc with objects
摘要
Object-oriented programming is the dominant paradigm for general-purpose programming languages. While several attempts have been made to introduce object models into constraint modelling languages, these often have restrictions in terms of their expressivity, are not available in mainstream modelling languages, or are incompatible with modern solving technology. To address these challenges, this paper identifies essential requirements for expressive and elegant object-oriented constraint modelling. We propose an object model that supports decision variables of object type, objects referring to other objects, and, crucially, variable sets of objects, whose cardinality is decided by the solver. The object model is presented as an extension of the MiniZinc modelling language that can be translated into standard MiniZinc. A number of examples and a case study demonstrate the viability of the approach.