Skip to main content

MiniZinc with Functions

  • Conference paper

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 7874))

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

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Allen, J.: Anatomy of LISP. McGraw-Hill, Inc., New York (1978)

    MATH  Google Scholar 

  2. Beldiceanu, N., Carlsson, M., Flener, P., Pearson, J.: On the reification of global constraints. Constraints 18, 1–6 (2013)

    Article  MathSciNet  Google Scholar 

  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/

  4. 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)

    Chapter  Google Scholar 

  5. 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)

    Chapter  Google Scholar 

  6. 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)

    Article  MathSciNet  Google Scholar 

  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/

  10. 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)

    Article  MathSciNet  Google Scholar 

  11. 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)

    Chapter  Google Scholar 

  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 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics