From Rules to Constraint Programs with the Rules2CP Modelling Language
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.
KeywordsModelling Language Constraint Program Business Rule Constraint Logic Programming Rule Engine
Unable to display preview. Download preview PDF.
- 1.Van Hentenryck, P.: The OPL Optimization programming Language. MIT Press, Cambridge (1999)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
- 9.Van Hentenryck, P.: Constraint satisfaction in Logic Programming. MIT Press, Cambridge (1989)Google Scholar
- 12.Carlsson, M., et al.: SICStus Prolog User’s Manual. Swedish Institute of Computer Science, 4th edn. (2007), ISBN 91-630-3648-7Google 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
- 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 CrossRefGoogle 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
- 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