Next:
Contents
An Introductory Course on
Constraint Logic Programming
Manuel Carro
With input from:
Manuel Hermenegildo
Francisco Bueno
Daniel Cabeza
M
José García
Pedro López
Germán Puebla
Computer Science School
Technical University of Madrid, UPM
VOCAL ESPRIT Project P23182
Contents
List of Figures
List of Tables
Acknowledgments
Introduction
What is Constraint (Logic) Programming?
Introduction
Typical Applications and Approaches
The OR Edge
The CP Edge
Constraints: Representation and Solving
Constraints as (Extended) Equations
Why Constraints and Programming?
Constraint-Programming Language Interfaces
An Example: SEND + MORE = MONEY
Prolog: Generate and Test
ILOG Solver (C++ Version)
ILOG Solver (Le Lisp Version)
Eclipse Version
Use Prolog as Host Language?
How Does a CLP System Work?
Modeling the Problem
Be a Solver
Don't Be a Solver!
A Basic Language
A Basic Constraint Language
Clauses
Implicit Equality
Facts
Predicates
Programs and Queries
Searching
Logical Variables
The Execution Mechanism
Database Programming
Datalog and the Relational Database Model
Adding Computation Domains
Domains
Linear (Dis)Equations
Linear Problems with
Prolog IV
Fibonacci Numbers
Non-Linear Solver: Intervals
A note on
Prolog IV
and
Some Useful Primitives
The Bounds of a Variable
Enumerating Variables
A Project Management Problem
A note on minimization (and maximization):
Other Constraints and Operations
Herbrand Terms
Herbrand Terms: Syntactic Equality
Structured Data and Data Abstraction
Structuring Old Problems
Constructing Recursive Data Structures
Recursive Programming: Lists
A note on
Prolog IV
lists
Trees
Data Structures in General
Putting Everything Together
Systems of Linear Equations
Analog RLC circuits
Summarizing
The Prolog Language
Prolog
Control Annotation
Goal Ordering
Clause Ordering
Arithmetic
Type Predicates
Structure Inspection
Input/Output
Pruning Operators: Cut
White cuts
Green cuts
Red cuts,
Meta-Logical Predicates
Meta-calls (Higher Order)
findall(Term, Goal, List)
Negation as Failure
Dynamic Program Modification
Foreign Language Interface
Pragmatics
Programming Tips
Controlling the Control
Complex Constraints
Conclusions and Further Reading
Small Projects
The Blocks World
Problem:
Solution:
A Discussion on
DONALD + GERALD = ROBERT
Ordinary Differential Equations
Problem:
Solution:
A Scheduling Program
Bibliography
Solutions to Proposed Problems
MCL
1998-12-03