Skip to main content

Compiling Conditional Constraints

  • Conference paper
  • First Online:
Principles and Practice of Constraint Programming (CP 2019)

Abstract

Conditionals are a core concept in all programming languages. They are also a natural and powerful mechanism for expressing complex constraints in constraint modelling languages. The behaviour of conditionals is complicated by undefinedness. In this paper we show how to most effectively translate conditional constraints for underlying solvers. We show that the simple translation into implications can be improved, at least in terms of reasoning strength, for both constraint programming and mixed integer programming solvers. Unit testing shows that the new translations are more efficient, but the benefits are not so clear on full models where the interaction with other features such as learning is more complicated.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

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 EPUB and 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

Institutional subscriptions

Notes

  1. 1.

    Note that we use a simplified FlatZinc syntax, including support for reified element constraints, to improve readability.

  2. 2.

    We use array slicing notation equivalent to .

  3. 3.

    Proofs of theorems not included in this paper can be found in the extended version at https://www.minizinc.org/pub/mzn_conditionals.pdf.

  4. 4.

    See https://github.com/minizinc/minizinc-benchmarks.

References

  1. Bacchus, F., Walsh, T.: Propagating logical combinations of constraints. In: Kaelbling, L.P., Saffiotti, A. (eds.) IJCAI-05, Proceedings of the Nineteenth International Joint Conference on Artificial Intelligence, Edinburgh, Scotland, UK, 30 July - 5 August 2005, pp. 35–40 (2005)

    Google Scholar 

  2. Belov, G., Stuckey, P.J., Tack, G., Wallace, M.: Improved linearization of constraint programming models. In: Rueher, M. (ed.) CP 2016. LNCS, vol. 9892, pp. 49–65. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-44953-1_4

    Chapter  Google Scholar 

  3. Fourer, R., Kernighan, B.: AMPL: A Modeling Language for Mathematical Programming. Duxbury, Massachusetts (2002)

    Google Scholar 

  4. Frisch, A.M., Stuckey, P.J.: The proper treatment of undefinedness in constraint languages. In: Gent, I.P. (ed.) CP 2009. LNCS, vol. 5732, pp. 367–382. Springer, Heidelberg (2009). https://doi.org/10.1007/978-3-642-04244-7_30

    Chapter  Google Scholar 

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

  6. Hooker, J.N.: Integrated Methods for Optimization, 2nd edn. Springer, Heidelberg (2011). https://doi.org/10.1007/978-1-4614-1900-6

    Book  MATH  Google Scholar 

  7. Jefferson, C., Moore, N.C.A., Nightingale, P., Petrie, K.E.: Implementing logical connectives in constraint programming. Artif. Intell. 174(16–17), 1407–1429 (2010)

    Article  MathSciNet  Google Scholar 

  8. Lhomme, O.: Arc-consistency filtering algorithms for logical combinations of constraints. In: Régin, J.-C., Rueher, M. (eds.) CPAIOR 2004. LNCS, vol. 3011, pp. 209–224. Springer, Heidelberg (2004). https://doi.org/10.1007/978-3-540-24664-0_15

    Chapter  MATH  Google Scholar 

  9. McKinnon, K.I.M., Williams, H.P.: Constructing integer programming models by the predicate calculus. Ann. Oper. Res. 21(1), 227–245 (1989)

    Article  Google Scholar 

  10. 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). https://doi.org/10.1007/978-3-540-74970-7_38

    Chapter  Google Scholar 

  11. Nightingale, P.: Savile Row, a constraint modelling assistant (2018). http://savilerow.cs.st-andrews.ac.uk/

  12. Van Hentenrcyk, P.: The OPL Optimization Programming Language. MIT Press, Cambridge (1999)

    Google Scholar 

  13. Van Hentenryck, P., Saraswat, V., Deville, Y.: Design, implementation, and evaluation of the constraint language cc(FD). In: Podelski, A. (ed.) TCS School 1994. LNCS, vol. 910, pp. 293–316. Springer, Heidelberg (1995). https://doi.org/10.1007/3-540-59155-9_15

    Chapter  Google Scholar 

Download references

Acknowledgements

We would like to thank the anonymous reviewers for their comments that helped improve this paper. This work was partly sponsored by the Australian Research Council grant DP180100151.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Guido Tack .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2019 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Stuckey, P.J., Tack, G. (2019). Compiling Conditional Constraints. In: Schiex, T., de Givry, S. (eds) Principles and Practice of Constraint Programming. CP 2019. Lecture Notes in Computer Science(), vol 11802. Springer, Cham. https://doi.org/10.1007/978-3-030-30048-7_23

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-30048-7_23

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-30047-0

  • Online ISBN: 978-3-030-30048-7

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics