The clp(FD) solver described in this chapter is an instance of the general Constraint Logic Programming scheme introduced in [Jaffar & Michaylov 87]. This constraint domain is particularly useful for modeling discrete optimization and verification problems such as scheduling, planning, packing, timetabling etc. The treatise [Van Hentenryck 89] is an excellent exposition of the theoretical and practical framework behind constraint solving in finite domains, and summarizes the work up to 1989.
This solver has the following highlights:
This library fully supports multiple SICStus run-times in a process.
The rest of this chapter is organized as follows: How to load the solver and how to write simple programs is explained in CLPFD Interface. A description of all constraints that the solver provides is contained in Available Constraints. The predicates for searching for solution are documented in Enumeration Predicates. The predicates for getting execution statistics are documented in Statistics Predicates. A few example programs are given in Example Programs. Finally, Syntax Summary contains syntax rules for all expressions.
The following sections discuss advanced features and are probably only relevant to experienced users: How to control the amount of information presented in answers to queries is explained in Answer Constraints. The solver's execution mechanism and primitives are described in The Constraint System. How to add new global constraints via a programming interface is described in Defining Global Constraints. How to define new primitive constraints with indexicals is described in Defining Primitive Constraints.