Hostname: page-component-78c5997874-t5tsf Total loading time: 0 Render date: 2024-11-03T00:03:21.897Z Has data issue: false hasContentIssue false

Constraint programming viewed as rule-based programming

Published online by Cambridge University Press:  09 June 2004

KRZYSZTOF R. APT
Affiliation:
CWI, P.O. Box 94079, 1090 GB Amsterdam, The Netherlands and University of Amsterdam, The Netherlands (e-mail: [email protected].)
ERIC MONFROY
Affiliation:
Institut de Recherche en Informatique de Nantes (IRIN), Université de Nantes, 2, rue de la Houssinière, BP 92208, 44322 Nantes Cedex 03, France (e-mail: [email protected])

Abstract

We study here a natural situation when constraint programming can be entirely reduced to rule-based programming. To this end we explain first how one can compute on constraint satisfaction problems using rules represented by simple first-order formulas. Then we consider constraint satisfaction problems that are based on predefined, explicitly given constraints. To solve them we first derive rules from these explicitly given constraints and limit the computation process to a repeated application of these rules, combined with labeling. We consider two types of rule here. The first type, that we call equality rules, leads to a new notion of local consistency, called rule consistency that turns out to be weaker than arc consistency for constraints of arbitrary arity (called hyper-arc consistency in Marriott & Stuckey (1998)). For Boolean constraints rule consistency coincides with the closure under the well-known propagation rules for Boolean constraints. The second type of rules, that we call membership rules, yields a rule-based characterization of arc consistency. To show feasibility of this rule-based approach to constraint programming, we show how both types of rules can be automatically generated, as CHR rules of Frühwirth (1995). This yields an implementation of this approach to programming by means of constraint logic programming. We illustrate the usefulness of this approach to constraint programming by discussing various examples, including Boolean constraints, two typical examples of many valued logics, constraints dealing with Waltz's language for describing polyhedral scenes, and Allen's qualitative approach to temporal logic.

Type
Research Article
Copyright
© 2001 Cambridge University Press

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Footnotes

A preliminary version of this article appeared in Apt & Monfroy (1999). In this version, we also present a framework for computing with rules on constraint satisfaction problems and discuss in detail the results of various experiments.