Re: clp(q) interactive vs. stand-alone behaviour
- From: Tom Schrijvers <user@xxxxxxxxxxx>
- Date: Fri, 11 Aug 2006 17:35:35 +0200
Andrey Rybalchenko wrote:
Dear group,
I'm struggling with a strange behavior of sicstus clp(q) solver. Its (correct) answer in interactive mode is correct and differs from an (incorrect )answer in a stand-alone program.
In stand-alone program, main.pl shown below produces:
DVars [1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,0,1,1,0,0,0,0,0,1,0,1,1,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,1,0,1,1,1,1,1,1,1,1]
Similarly, swi clp(q) solver computes (again an incorrect answer)
DVars
[1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,1,0,0,1,0,1,0,0,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,1,0,1,1,1,1,0,0,0,0]
In sicstus interpreter:
DVars [0,0,0,0,1,1,1,1,0,1,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,0,1,0,1,0,0,1,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1]
Correctness is checked by the following procedure:
check(Anser) :-
Cs = ...,
D = ...,
term_variables(D, DVars),
DVars = Answer,
Cs.
Any ideas?
I don't think that term_variables is specified to return the variables in any particular order, or even in the same order every time. You're probably getting the same variables permuted differently each time?
Cheers,
Tom
.
- References:
- clp(q) interactive vs. stand-alone behaviour
- From: Andrey Rybalchenko
- clp(q) interactive vs. stand-alone behaviour
- Prev by Date: Re: When to use facts instead of rules?
- Next by Date: Re: bug in clp(q,r) library
- Previous by thread: clp(q) interactive vs. stand-alone behaviour
- Index(es):
Relevant Pages
|
|