This manual describes CLP( ) version 1.2, and at a number of places throughout this text changebars have been placed either to indicate new features in version 1.2 from version 1.1 or some changes in the manual. The CLP( ) language is an instance of the Constraint Logic Programming scheme defined by Jaffar and Lassez [10]. Its operational model is similar to that of PROLOG. A major difference is that unification is replaced by a more general mechanism: solving constraints in the domain of uninterpreted functors over real arithmetic terms. A working knowledge of PROLOG programming is assumed in this document; the book by Sterling and Shapiro [20] can serve as a suitable introductory text. Further technical information on CLP( ) is available on language design and implementation [12, 13], meta-programming [7] and delay mechanisms [14]. Additionally, much has been written about applications in electrical engineering [6, 18], differential equations [5, 8], temporal reasoning [1, 2, 3], protocol testing [4], structural analysis and synthesis [15], mechanical engineering [21], user interfaces [23], model-based diagnosis [24], options trading [16], music theory [9], molecular biology [22], etc.
This document is both an introductory tutorial and reference manual describing the compiler-based implementation of CLP( ). The reader experienced with PROLOG or CLP( ) may wish to skip to Chapter 4, and in particular, see the sample session in Section 4.6 to get started quickly. Compiled CLP( ) is an interactive system that compiles all programs and goals into CLAM code which is interpreted by a byte-code emulator that is part of the system. The system is portable in the sense that it will run on virtually all 32 bit UNIX machines with a reasonably standard C compiler, as well as many others.
We would like to emphasize that this manual describes a constantly-evolving, experimental system. Hence much of what is described is subject to change in future releases. Furthermore, the use of undocumented features is particularly dangerous.
Finally, we adopt some standard notational conventions, such as the name/arity convention for describing predicates and functors, + for input arguments, - for output arguments, and ? for arguments that may be either input or output.