Dear Stackoverflow Community,
I just wanted to test out the constrained logic programming library (clpfd) for Prolog. So I am including the library by calling
:- use_module(library(clpfd)).
Then I want to do sth like the following.
[X,Y] :: [1..2], X #\= Y, X+Y #\= 3.
But I always get the answer that
ERROR: Syntax error: Operator expected
ERROR: [X,Y]
ERROR: ** here **
ERROR: :: [1..2], X #\= Y, X+Y #\= 3 .
The same happens when executing the following example
? member(X,[42,1,17]), [X,Y] :: [0..20].
ERROR: Syntax error: Operator expected
ERROR: member(X,[42,1,17]), [X,Y]
ERROR: ** here **
ERROR: :: [0..20] .
Seems like Prolog does not recognise the :: operator properly. Any help is appreciated
::operator is? - Paul Brown::/2operator for constraints. Both provide alternatives to it (in/2in the case of B-Prolog andin_set_range/2in the case of ECLiPSe). - Paulo Moura