Tutorial by Examples

CLP(FD) constraints (Finite Domains) implement arithmetic over integers. They are available in all serious Prolog implementations. There are two major use cases of CLP(FD) constraints: Declarative integer arithmetic Solving combinatorial problems such as planning, scheduling and allocation task...
CLP(Q) implements reasoning over rational numbers. Example: ?- { 5/6 = X/2 + 1/3 }. X = 1.
Prolog itself can be considered as CLP(H): Constraint Logic Programming over Herbrand terms. With this perspective, a Prolog program posts constraints over terms. For example: ?- X = f(Y), Y = a. X = f(a), Y = a.

Page 1 of 1