Constraint Handling Rules (CHR) is both a theoretical formalism based on logic and a practical programming language based on rules. This book, written by the creator of CHR, describes the theory of CHR and how to use it in practice. It is supported by a website containing teaching materials, online demos, and free downloads of the language. After a basic tutorial, the author describes in detail the CHR language and discusses guaranteed properties of CHR programs. The author then compares CHR with other formalisms and languages and illustrates how it can capture their essential features. Finally, larger programs are introduced and analyzed in detail. The book is ideal for graduate students and lecturers, and for more experienced programmers and researchers, who can use it for self-study. Exercises with selected solutions, and bibliographic remarks are included at the ends of chapters. The book is the definitive reference on the subject.
Thom Fruhwirth is a Professor in the Faculty of Computer Science at the University of Ulm, Germany. He is the creator of the programming language Constraint Handling Rules (CHR) and the main author of two books on constraint programming and reasoning.
Preface; Part I. CHR Tutorial: 1. Getting started; 2. My first CHR programs; Part II. The CHR Language: 3. Syntax and semantics; 4. Properties of CHR; 5. Program analysis; 6. Rule-based and graph-based formalisms in CHR; Part III. CHR Programs and Applications: 7. My first CHR programs, revisited for analysis; 8. Finite domain constraint solvers; 9. Infinite domain constraint solvers; 10. Union-find algorithm; Bibliography; List of figures; List of illustrations; Index.