MiniZinc with Functions
Functional relations are ubiquitous in combinatorial problems – the Global Constraint Catalog lists 120 functional constraints. This paper argues that the ability to express functional constraints with functional syntax leads to more elegant and readable models, and that it enables a better translation of the models to different underlying solving technologies such as CP, MIP, or SAT.
Yet, most modelling languages only support built-in functions, such as arithmetic, Boolean, or array access operations. Custom, user-defined functions are either not catered for at all, or they have an ad-hoc implementation without a useful semantics in Boolean contexts and not exploiting potential optimisations.
This paper develops a translation from MiniZinc with user-defined functions to FlatZinc. The translation respects the relational semantics of MiniZinc, correctly dealing with partial functions in arbitrary Boolean contexts. At the same time, it takes advantage of the full potential of common subexpression elimination.
KeywordsModelling Language Relational Semantic Partial Function Global Constraint Host Language
Unable to display preview. Download preview PDF.
- 3.Beldiceanu, N., Carlsson, M., Rampon, J.X.: Global constraint catalog, working version as of October 4, 2012, http://www.emn.fr/z-info/sdemasse/gccat/
- 7.Guns, T.: Declarative Pattern Mining using Constraint Programming. Ph.D. thesis, Department of Computer Science, K.U.Leuven (2012)Google Scholar
- 8.Gurobi Optimization, Inc.: Gurobi Optimizer Reference Manual (2012), http://www.gurobi.com
- 9.IBM: ILOG Concert, part of IBM ILOG CPLEX Optimization Studio (2012), http://www-01.ibm.com/software/integration/optimization/cplex-optimizer/interfaces/
- 12.Rendl, A.: Effective Compilation of Constraint Models. Ph.D. thesis, School of Computer Science, University of St. Andrews (2010)Google Scholar
- 13.Schulte, C., et al.: Gecode, the generic constraint development environment (2009), http://www.gecode.org/
- 14.Van Hentenryck, P.: The OPL Optimization Programming Language. MIT Press (1999)Google Scholar
- 15.Van Hentenryck, P., Michel, L.: Constraint-Based Local Search. MIT Press (2005)Google Scholar