Constraint Logic Programming

Constraint logic programming is an extension to logic programming that allows conditions to be imposed upon variables in a program clause.

An example of a clause involving a constraint is P(X,Y) :- X>Y, Q(X), R(Y).. Here, the goal is P(X,Y) with two subgoals, Q(X) and R(Y). The constraint on X and Y is X>Y.

 

During execution of a constraint logic program, all constraints encountered in the search tree are put into a constraint store. If at any point during a computation, the constraint store becomes unsatisfiable, then the interpreter backtracks in order to find other clauses to prove the goal.

 

Constraint logic programming can be made concurrent in order to program concurrent processes. The goals in the program are then evaluated concurrently.

 

 

Sources: Wikipedia; Iain Hodkinson.

previous page