lost access to domain variables?

From: Sebastian Sardina <ssardina_at_cs.toronto.edu>
Date: Thu 30 May 2002 01:20:06 AM GMT
Message-Id: <1022721607.5483.14.camel@sis-con.com.ar>

Suppose I got the predicate:

b:- [X,Y,Z] :: [1..2], X#\=Y, Y#\=Z.

Variables X, Y, and Z are "local" to predicate b. So, after b succeeds
I have no access to them.

The query -? b. will suceeed, however, there will be some constraints

[eclipse 7]: b.

Delayed goals:
	X{[1, 2]} #\= Y{[1, 2]}
	Y{[1, 2]} #\= Z{[1, 2]}
Yes (0.00s cpu)

Now, although b has succeeded it may be the case that the constraints
pending are inconsistent. In that case, b did not fail because the
propagation is limited.

Now, is there any way to "recover" the pending  variables that have not
been assigned any variable so far so that I can label them all and be
sure that not only b succeeded but there is at least one possible
consistent assignment to all the pending variables.

I do not want to do the labeling "inside" b/0 tough, I just want to
"recover" the variables that have pending constraints after b/0 has
ended and see if it is possible to assign them some value.

One easy way would be to make X, Y and Z arguments of b/0 so I would use
b/3 instead, and then I can do the query: 
-? b(X,Y,Z), labeling([X,Y,Z]). Is there any other way so that I can
keep my b/0? Since the pending constraints are stored in a kind of
database constraints,  maybe there is some tool to retrive all "pending"


Received on Thu May 30 02:23:43 2002

This archive was generated by hypermail 2.1.8 : Wed 16 Nov 2005 06:07:14 PM GMT GMT