Chapter 12 - Constraint Logic Programming

https://doi.org/10.1016/S1574-6526(06)80016-7Get rights and content

Publisher Summary

This chapter reviews that constraint logic programming (CLP) is the merger of two declarative paradigms: constraint solving and logic programming. As both constraint solving and logic programs are based on mathematical relations the merger is natural and convenient. CLP encourages experimentation and fast algorithm development by narrowing the gap between the logic and the solving algorithms. This is because CLP can express both conceptual and design models and it can also express mappings from conceptual to design models. The “conceptual” model of a problem means the precise formulation of the problem in logic, and the “design” models of the problem means its algorithmic formulation, which maps to a sequence of steps for solving it. A single problem may have different conceptual models, and different design models. The chapter also reviews the first important characteristic of constraint logic programs—that is, they allow succinct, natural conceptual modeling of satisfaction and optimization problems.

Section snippets

Example 12.1.

For example, the cryptarithmetic problem SEND+MORE=MONEYwhere each letter represents a different digit, is naturally conceptually modeled by the following CLP program: (we will use the concrete syntax of ECLiPSe [20] throughout this chapter)

The first line initiates a rule to define a new predicate (or user-defined constraint) smm which has the variables of the problem as arguments. The remainder of the rule definessmm in terms of other constraints. The second line defines that each variable is

The Origins of CLP

The core ideas behind constraint logic programming were developed by three largely independent research teams: that of Colmeraur in Marseilles; that of Jaffar and Lassez in Melbourne (Australia) (then IBM T.J. Watson Research Center at Yorktown Heights); and the CHIP team led by Dincbas at the European Computer-Industry Research Center (ECRC) in Munich.

Constraint logic programming emerged as a generalization of logic programming. In the CLP view of logic programming, standard logic programming

Semantics of Constraint Logic Programs

CLP languages extend logic-based programming languages by allowing constraints with a pre-defined interpretation. The key insight of Jaffar and Lassez's CLP Scheme is that for these languages, the operational semantics, declarative semantics and the relationship between these can be parameterized by a choice of constraints, solver and an algebraic and logical semantics for the constraints. Our presentation of the main results follows:

We assume that the reader is familiar with the basics of

CLP for Conceptual Modeling

Constraint logic programs provide an ideal conceptual modeling language since they provide a very expressive subset of first-order logic including existential quantification, and implications defining new constraints in terms of conjunctions and disjunctions of other constraints. We first demonstrate how CLP can be used to model constraint satisfaction problems (CSP) and then discuss how CLP provides considerably more concise and powerful ways of modeling problems than does the standard CSP

CLP for Design Modeling

Constraint logic programming not only provides a conceptual modeling language but also a design modeling language since the primitive constraints expressed in the conceptual model can be directly executed using the underlying constraint solver(s).

Search in CLP

Search is an implicit part of constraint logic programming. Execution searches through the possible derivations in a depth-first left right manner. Because of this it is relatively straightforward to define specific search routines in constraint logic programs.

The aim of search is to overcome the incompleteness of the solver or its weakness in modeling the constraints required by the user (hence requiring multiple rules). In the first case the constraint programmer will add search predicates to

Research initiated in CLP, and covered in this volume

CLP provides a powerful and practical framework for thinking about constraint satisfaction and optimization problems. Indeed it was within the CLP paradigm that many of the concepts and research directions described in this handbook were first introduced. For example global constraints were introduced in CLP [14]; it was within the CLP paradigm that multiple cooperating constraint solvers were introduced [15]; it is within the CLP community that much of the research has taken place exploring

Future of CLP and Interesting Research Questions

It is almost exactly 20 years since the CLP paradigm was introduced. It has been an important component in the success of CP, providing the initial reason for the “programming” component. One impact has been on logic programming. CLP is now a cornerstone of logic programming theory, systems and applications. Standard logic programming systems, such as GNU-Prolog and SICStus Prolog now provide constraint solving libraries. It has also received substantial interest from researchers into

Bibliography (124)

  • J.-L. Laurière

    A language and a program for stating and solving combinatorial problems

    Artificial Intelligence

    (1978)
  • S. Muggleton et al.

    Inductive logic programming: Theory and methods

    Journal of Logic Programming

    (1994)
  • S. Abdennadher et al.

    Automatic generation of rule-based solvers for intentionally defined constraints

    International Journal of Artificial Intelligence Tools

    (2002)
  • A. Aggoun et al.

    Extending CHIP in order to solve complex scheduling problems

  • A. Aiba et al.

    Constraint logic programming language CAL

  • H. Aït-Kaci et al.

    LIFE: A natural language for natural language

    Technical Report ACA-ST-074-88, MCC

    (1988)
  • H. Aït-Kaci et al.

    LOGIN: A logic programming language with built-in inheritance

    Journal of Logic Programming

    (1986)
  • Hassan Aït-Kaci

    Warren's Abstract Machine: A Tutorial reconstruction

    (1991)
  • K. Apt et al.

    Constraint programming viewed as rule-based programming

    Theory and Practice of Logic Programming

    (2001)
  • K. Apt et al.

    Contributions to the theory of logic programming

    JACM

    (1982)
  • R. Barbuti et al.

    Intensional negation of logic programs: Examples and implementation techniques

  • N. Beldiceanu

    Global constraints as graph properties on a structured network of elementary constraints of the same type

  • H. Beringer et al.

    Combinatorial problem solving in constraint logic programming with cooperating solvers

  • H.-J. Bückert

    A resolution principle for constrained logics

    Artificial Intelligence

    (1994)
  • B. Carlson et al.

    Entailment of finite domain constraints

  • M. Carlsson

    Freeze, indexing, and other implementation issues in the WAM

  • D. Chan

    Constructive negation based on the completed database

  • A.M. Cheadle et al.

    ECLiPSe

  • K. Clark

    Negation as failure

  • K. Clark et al.

    A relational language for parallel programming

  • K. Clark et al.

    IC-Prolog – language feature

  • J. Cleary

    Logical arithmetic

    Future Computing Systems

    (1987)
  • A. Colmerauer

    PROLOG II reference manual and theoretical model

    Technical report, Groupe Intelligence Artificielle, Université Aix — Marseille II

    (1982)
  • A. Colmerauer

    Opening the PROLOG-III universe

    BYTE Magazine

    (1987)
  • A. Colmerauer

    Equations and inequations on finite and infinite trees

  • W. Cronholm et al.

    Hybrid branch-and-price for multicast network design

  • J. Crossley et al.

    First-order constrained lambda calculus

  • J. Darlington et al.

    A new perspective on integrating functional and logic languages

  • M. Garcia de la Banda et al.

    Independence in CLP languages

    ACM Transactions on Programming Languages and Systems

    (2000)
  • D. Diaz et al.

    A minimal extension of the WAM for clp (FD)

  • M. Dincbas et al.

    The constraint logic programming language CHIP

  • H. Enderton

    A Mathematical Introduction to Logic

    (1972)
  • R.E. Fikes

    REF-ARF: A system for solving problems stated as procedures

    Artificial Intelligence Journal

    (1970)
  • A. Foster et al.

    Absys1: An incremental compiler for assertions: An introduction

  • B. Freeman-Benson et al.

    The design and implementation of Kaleidoscope'90: A constraint imperative programming language

  • T. Frühwirth

    Constraint simplification rules

  • M. García de la Banda et al.

    To the gates of HAL: a HAL tutorial

  • Cited by (6)

    View full text