Prolog Language Getting started with Prolog Language CLP(FD) Constraints


Example

CLP(FD) constraints are provided by all serious Prolog implementations. They allow us to reason about integers in a pure way.

?- X #= 1 + 2.
X = 3.

?- 5 #= Y + 2.
Y = 3.