[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with CLP

From: Salvador Abreu
Subject: Re: Problem with CLP
Date: Tue, 23 Sep 2003 22:14:14 +0100

Lars Riis Olsen <address@hidden> wrote:

> So if I am understanding you correctly there is no way of determining 
> whether a "yes" result returned by GNU Prolog is correct. Maybe except
> from binding one of the variables with each of its possible values to 
> check whether any of them returns "yes" (which obviuosly is immensely 
> ugly and not at all feasable for large ranges.). Is this correct a 
> correct interpretation of your previous post?.

Just a thought:

Take the constrained variables in your query and try to do a labeling
step, for example and using your query:

| ?- fd_domain(X,0,15), fd_domain(Y,0,15),
    (((X #< Y) #/\ ((Y-X) #> 8)) #\/ ((X #> Y) #/\ ((X - Y) #< 8))) #/\   (((X 
#< Y) #/\ ((Y-X) #< 8)) #\/ ((X #> Y) #/\ ((X - Y) #> 8))),

| ?- 

This should distinguish between the "yes" and "no" cases, as only the
bindings which yield a solution (via constraint propagation) well emerge
in the query variables.

If you just lay down the constraints, you're not really "activating" the
constraint solver; look up fd_labeling/2, fd_labeling/1 and
fd_labelingff/1 in the GNU Prolog manual.

It would be nice to have a reversible external representation for
constrained variables, though... :-)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]