Skip to main content

From Rules to Constraint Programs with the Rules2CP Modelling Language

  • Conference paper
Recent Advances in Constraints (CSCLP 2008)

Part of the book series: Lecture Notes in Computer Science ((LNAI,volume 5655))

Abstract

In this paper, we present a rule-based modelling language for constraint programming, called Rules2CP. Unlike other modelling languages, Rules2CP adopts a single knowledge representation paradigm based on rules without recursion, and a restricted set of data structures based on records and enumerated lists given with iterators. We show that this is sufficient to model constraint satisfaction problems, together with search strategies where search trees are expressed by logical formulae, and heuristic choice criteria are defined by preference orderings on variables and formulae. We describe the compilation of Rules2CP statements to constraint programs over finite domains, by a term rewriting system and partial evaluation. We prove the confluence of these transformations and provide a complexity bound on the size of the generated programs. The expressiveness of Rules2CP is illustrated first with simple examples, and then with a complete library for packing problems, called PKML, which, in addition to pure bin packing and bin design problems, can deal with common sense rules about weights, stability, as well as specific packing business rules. The performances of both the compiler and the generated code are evaluated on Korf’s benchmarks of optimal rectangle packing problems.

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. Van Hentenryck, P.: The OPL Optimization programming Language. MIT Press, Cambridge (1999)

    Google Scholar 

  2. Hentenryck, P.V., Perron, L., Puget, J.F.: Search and strategies in opl. ACM Transactions on Compututational Logic 1, 285–320 (2000)

    Article  MathSciNet  Google Scholar 

  3. Rafeh, R., de la Banda, M.G., Marriott, K., Wallace, M.: From Zinc to design model. In: Hanus, M. (ed.) PADL 2007. LNCS, vol. 4354, pp. 215–229. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

  4. de la Banda, M.G., Marriott, K., Rafeh, R., Wallace, M.: The modelling language Zinc. In: Benhamou, F. (ed.) CP 2006. LNCS, vol. 4204, pp. 700–705. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

  5. Frisch, A.M., Harvey, W., Jefferson, C., Martinez-Hernandez, B., Miguel, I.: Essence: A constraint language for specifying combinatorial problems. Constraints 13, 268–306 (2008)

    Article  MathSciNet  MATH  Google Scholar 

  6. Group, B.R.: The business rules manifesto Business Rules Group (2003), http://www.businessrulesgroup.org/brmanifesto.htm

  7. Korf, R.E.: Optimal rectangle packing: New results. In: ICAPS, pp. 142–149 (2004)

    Google Scholar 

  8. Haemmerlé, R., Fages, F.: Modules for prolog revisited. In: Etalle, S., Truszczyński, M. (eds.) ICLP 2006. LNCS, vol. 4079, pp. 41–55. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

  9. Van Hentenryck, P.: Constraint satisfaction in Logic Programming. MIT Press, Cambridge (1989)

    Google Scholar 

  10. Huang, J., Darwiche, A.: The language of search. Journal of Artificial Intelligence Research 29, 191–219 (2007)

    MathSciNet  MATH  Google Scholar 

  11. Apt, K., Wallace, M.: Constraint Logic Programming using Eclipse. Cambridge University Press, Cambridge (2006)

    Book  Google Scholar 

  12. Carlsson, M., et al.: SICStus Prolog User’s Manual. Swedish Institute of Computer Science, 4th edn. (2007), ISBN 91-630-3648-7

    Google Scholar 

  13. Fages, F., Soliman, S., Coolen, R.: CLPGUI: a generic graphical user interface for constraint logic programming. Journal of Constraints, Special Issue on User-Interaction in Constraint Satisfaction 9, 241–262 (2004)

    Google Scholar 

  14. Fages, F., Martin, J.: From rules to constraint programs with the Rules2CP modelling language. INRIA Research Report RR-6495, Institut National de Recherche en Informatique (2008)

    Google Scholar 

  15. Rosen, B.: Tree-manipulating systems and Church-Rosser theorems. Journal of the ACM 20, 160–187 (1973)

    Article  MathSciNet  MATH  Google Scholar 

  16. Carlsson, M., Beldiceanu, N., Martin, J.: A geometric constraint over k-dimensional objects and shapes subject to business rules. In: Stuckey, P.J. (ed.) CP 2008. LNCS, vol. 5202, pp. 220–234. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  17. Beldiceanu, N., Carlsson, M., Poder, E., Sadek, R., Truchet, C.: A generic geometrical constraint kernel in space and time for handling polymorphic k-dimensional objects. In: Bessière, C. (ed.) CP 2007. LNCS, vol. 4741, pp. 180–194. Springer, Heidelberg (2007); SICS Technical Report T2007:08, http://www.sics.se/libindex.html

    Chapter  Google Scholar 

  18. Allen, J.: Time and time again: The many ways to represent time. International Journal of Intelligent System 6 (1991)

    Google Scholar 

  19. Randell, D., Cui, Z., Cohn, A.: A spatial logic based on regions and connection. In: Nebel, B., Rich, C., Swartout, W.R. (eds.) Proc. of 2nd International Conference on Knowledge Representation and reasoning KR 1992, pp. 165–176. Morgan Kaufmann, San Francisco (1992)

    Google Scholar 

  20. Carpenter, H., Dowsland, W.: Practical consideration of the pallet loading problem. Journal of the Operations Research Society 36, 489–497 (1985)

    Article  MATH  Google Scholar 

  21. Simonis, H., O’Sullivan, B.: Using global constraints for rectangle packing. In: Proceedings of the first Workshop on Bin Packing and Placement Constraints BPPC 2008, associated to CPAIOR 2008 (2008)

    Google Scholar 

  22. Jaffar, J., Lassez, J.L.: Constraint logic programming. In: Proceedings of the 14th ACM Symposium on Principles of Programming Languages, pp. 111–119. ACM, Munich (1987)

    Google Scholar 

  23. Balland, E., Brauner, P., Kopetz, R., Moreau, P.E., Reilles, A.: Tom: Piggybacking rewriting on java. In: Baader, F. (ed.) RTA 2007. LNCS, vol. 4533, pp. 36–47. Springer, Heidelberg (2007)

    Chapter  Google Scholar 

  24. Fages, F., Coquery, E.: Typing constraint logic programs. Journal of Theory and Practice of Logic Programming 1, 751–777 (2001)

    Article  MathSciNet  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2009 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Fages, F., Martin, J. (2009). From Rules to Constraint Programs with the Rules2CP Modelling Language. In: Oddi, A., Fages, F., Rossi, F. (eds) Recent Advances in Constraints. CSCLP 2008. Lecture Notes in Computer Science(), vol 5655. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-03251-6_5

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-03251-6_5

  • Publisher Name: Springer, Berlin, Heidelberg

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

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

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics