Subject: Re: [SWIPL] constraining the variable domain

From: Steffen Moeller <[email-masked]>
Date: Thu, 31 May 2001 12:58:49 +0100 (BST)

Hi, teach this to your SWI command line:

assert(b(X,Y):-X\==Y).
assert(c(1,1)).
assert(c(1,2)).
assert(a(X,Y):-(c(X,Y),b(X,Y))).

and give it a try

?- a(X,Y).
X = 1 Y = 2 ;
No
?-

I assume your problem was the ordering of b/2 and c/2 in the a/2 clause.
Since this is a programming language and not a constraint solver, the
order of clauses is important, just assume you'd write a backtracking
engine yourself.

Cheers,

Steffen