Skip to main content

The Finite Domain Constraint Solver of SWI-Prolog

  • Conference paper
Functional and Logic Programming (FLOPS 2012)

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

Included in the following conference series:

Abstract

We present a new constraint solver over finite domains, freely available as library(clpfd) in SWI-Prolog. Our solver has several unique features, which we describe in this paper: Reasoning over arbitrarily large integers, always terminating propagation, and a domain-specific language that concisely expresses the full semantics of constraint reification. The library is entirely written in Prolog and can be easily ported to other Prolog systems that support attributed variables. The constraint solver is fast enough for teaching and research purposes and is already being used in courses at several universities in France, Germany, Italy, Austria and other countries.

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

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Jaffar, J., Lassez, J.-L.: Constraint Logic Programming. In: POPL, pp. 111–119 (1987)

    Google Scholar 

  2. Diaz, D., Codognet, P.: Design and Implementation of the GNU Prolog System. Journal of Functional and Logic Programming 6 (2001)

    Google Scholar 

  3. Wallace, M., Novello, S., Schimpf, J.: ECLiPSe: A Platform for Constraint Logic Programming. Technical Report (1997)

    Google Scholar 

  4. Carlsson, M., Ottosson, G., Carlson, B.: An Open-Ended Finite Domain Constraint Solver. In: Hartel, P.H., Kuchen, H. (eds.) PLILP 1997. LNCS, vol. 1292, pp. 191–206. Springer, Heidelberg (1997)

    Chapter  Google Scholar 

  5. Zhou, N.F., Nagasawa, I.: An Efficient Finite-domain Constraint Solver in Beta-Prolog. Journal of Japanese Society for Artificial Intelligence 9 (1994)

    Google Scholar 

  6. Gent, I.P., Walsh, T.: CSPLib: A Benchmark Library for Constraints. In: Proceedings of the 5th Int. Conf. PPCP (1999)

    Google Scholar 

  7. Wielemaker, J.: An Overview of the SWI-Prolog Programming Environment. In: Proceedings of the 13th International Workshop on LP Environments (2003)

    Google Scholar 

  8. da Silva, A.F., Santos Costa, V.: The Design and Implementation of the YAP Compiler: An Optimizing Compiler for Logic Programming Languages. In: Etalle, S., Truszczyński, M. (eds.) ICLP 2006. LNCS, vol. 4079, pp. 461–462. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

  9. Apt, K.R., Zoeteweij, P.: An Analysis of Arithmetic Constraints on Integer Intervals. Constraints 4 (2007)

    Google Scholar 

  10. Holzbaur, C.: OFAI CLP(Q,R) Manual, TR (1995)

    Google Scholar 

  11. Pritchard, P., Gries, D.: The Seven-Eleven Problem, TR (1994)

    Google Scholar 

  12. Demoen, B.: Dynamic attributes, their hProlog implementation, and a first evaluation. Technical Report (2002)

    Google Scholar 

  13. Burckel, S., Hoarau, S., Mesnard, F., Neumerkel, U.: cTI: Bottom-Up Termination Inference for Logic Programs. In: WLP 15 (2000)

    Google Scholar 

  14. Bentley, J.: Little languages. Communications of the ACM 29(8), 711–721 (1986)

    Article  MathSciNet  Google Scholar 

  15. Codognet, P., Diaz, D.: Compiling Constraints in clp(FD). Journal of Logic Programming 27(3) (1996)

    Google Scholar 

  16. Mernik, M., Heering, J., Sloane, A.M.: When and how to develop domain-specific languages. ACM Comput. Surv. 37(4), 316–344 (2005)

    Article  Google Scholar 

  17. Johnson, S.C., Lesk, M.E.: Language development tools. Bell System Technical Journal 56(6), 2155–2176 (1987)

    Google Scholar 

  18. Schulte, C., Tack, G.: Perfect Derived Propagators. CoRR entry (2008)

    Google Scholar 

  19. Diaz, D., Codognet, P.: Design and Implementation of the GNU Prolog System. Journal of Functional and Logic Programming (JFLP) 2001(6) (2001)

    Google Scholar 

  20. Zhou, N.-F.: Programming Finite-Domain Constraint Propagators in Action Rules. Theory and Practice of Logic Programming 6(5), 483–508 (2006)

    Article  MathSciNet  MATH  Google Scholar 

  21. Frühwirth, T.: Theory and Practice of Constraint Handling Rules. Special Issue on Constraint Logic Programming, J. of Logic Programming 37(1-3) (1998)

    Google Scholar 

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

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2012 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Triska, M. (2012). The Finite Domain Constraint Solver of SWI-Prolog. In: Schrijvers, T., Thiemann, P. (eds) Functional and Logic Programming. FLOPS 2012. Lecture Notes in Computer Science, vol 7294. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-29822-6_24

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-29822-6_24

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-29821-9

  • Online ISBN: 978-3-642-29822-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics