Re: clp(q) interactive vs. stand-alone behaviour



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
.



Relevant Pages

  • clp(q) interactive vs. stand-alone behaviour
    ... I'm struggling with a strange behavior of sicstus clpsolver. ... Its answer in interactive mode is correct and differs from an (incorrect)answer in a stand-alone program. ... term_variables(D, DVars), ...
    (comp.lang.prolog)
  • Re: difference
    ... A differs from B because A =~B ... if A, B are sets, some members in A are not in B ... then, can conclusion A=~B is incorrect, ... Your description is very confusing. ...
    (sci.math)