Re: [eclipse-clp-users] Need Help, Problem with variables?

From: Thorsten Winterer <thorsten_winterer_at_...126...>
Date: Wed, 01 Oct 2008 15:33:38 +0200
Hi,

the call

    delete(_38606, [4, 1, 2, ...], [2, 3], 0, most_constrained, eclipse)

can't succeed since the third parameter (remaining variables) is already
instantiated to list [2,3], while the second parameter (all variables)
is [4,1,2,3].
The mode declaration for for ic:delete/5 is

    delete(-X, +List, -R, ++Arg, ++Select)

i.e., the third parameter is supposed to be a free variable. In any
case, R will be bound to list that is one element shorter than List.


Without comments, I don't exactly understand what's going on in your
code, but you also seem to have some infinite loop between test_f/4 and
queen_mientras/2, which would pose a problem if delete/5 hadn't failed:

    test_f(AllVars,SelX,ChoiX,VarsRem,N) :-  %% called from
queen_mientras/2, AllVars and VarsRem instantiated
        delete(Var, AllVars, VarsRem, 0, SelX), % the problem...
        count_backtracks,
        count_iteraciones,
        indomain(Var, ChoiX),
        queen_mientras(AllVars,VarsRem).  %% AllVars and VarsRem
unchanged, so we'll enter an infinite loop


Cheers,
Thorsten
Received on Wed Oct 01 2008 - 13:49:16 CEST

This archive was generated by hypermail 2.3.0 : Tue Apr 16 2024 - 09:13:20 CEST