Abstract
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.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
Allen, J.: Anatomy of LISP. McGraw-Hill, Inc., New York (1978)
Beldiceanu, N., Carlsson, M., Flener, P., Pearson, J.: On the reification of global constraints. Constraints 18, 1–6 (2013)
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/
Feydy, T., Somogyi, Z., Stuckey, P.J.: Half reification and flattening. In: Lee, J. (ed.) CP 2011. LNCS, vol. 6876, pp. 286–301. Springer, Heidelberg (2011)
Frisch, A., Stuckey, P.: The proper treatment of undefinedness in constraint languages. In: Gent, I.P. (ed.) CP 2009. LNCS, vol. 5732, pp. 367–382. Springer, Heidelberg (2009)
Frisch, A.M., Harvey, W., Jefferson, C., Hernández, B.M., Miguel, I.: Essence: A constraint language for specifying combinatorial problems. Constraints 13(3), 268–306 (2008)
Guns, T.: Declarative Pattern Mining using Constraint Programming. Ph.D. thesis, Department of Computer Science, K.U.Leuven (2012)
Gurobi Optimization, Inc.: Gurobi Optimizer Reference Manual (2012), http://www.gurobi.com
IBM: ILOG Concert, part of IBM ILOG CPLEX Optimization Studio (2012), http://www-01.ibm.com/software/integration/optimization/cplex-optimizer/interfaces/
Marriott, K., Nethercote, N., Rafeh, R., Stuckey, P., Garcia de la Banda, M., Wallace, M.: The design of the Zinc modelling language. Constraints 13(3), 229–267 (2008)
Nethercote, N., Stuckey, P.J., Becket, R., Brand, S., Duck, G.J., Tack, G.: MiniZinc: Towards a standard CP modelling language. In: Bessière, C. (ed.) CP 2007. LNCS, vol. 4741, pp. 529–543. Springer, Heidelberg (2007)
Rendl, A.: Effective Compilation of Constraint Models. Ph.D. thesis, School of Computer Science, University of St. Andrews (2010)
Schulte, C., et al.: Gecode, the generic constraint development environment (2009), http://www.gecode.org/
Van Hentenryck, P.: The OPL Optimization Programming Language. MIT Press (1999)
Van Hentenryck, P., Michel, L.: Constraint-Based Local Search. MIT Press (2005)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2013 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Stuckey, P.J., Tack, G. (2013). MiniZinc with Functions. In: Gomes, C., Sellmann, M. (eds) Integration of AI and OR Techniques in Constraint Programming for Combinatorial Optimization Problems. CPAIOR 2013. Lecture Notes in Computer Science, vol 7874. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-38171-3_18
Download citation
DOI: https://doi.org/10.1007/978-3-642-38171-3_18
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-38170-6
Online ISBN: 978-3-642-38171-3
eBook Packages: Computer ScienceComputer Science (R0)