[eclipse-clp-users] Out of range error

From: Volkan Unsal <spocksplanet_at_gmail.com>
Date: Fri, 16 Aug 2013 19:13:04 -0400
Hey all,

It's me again. Sorry about the noob questions I've been throwing at this
lately. This one has to do with the following code:

  %% Create a list of variables for Countries
  (foreach(_,Countries), for(_,1,N) do true),
  %% Set up the domain of the Countries, which would in fact be the colors
  Countries :: 1..N,
  %% Set up inequality constraints between the nodes in edges
  (foreach([N1, N2],Edges), param(Countries) do
      I is N1 + 1,
      J is N2 + 1,
      Countries[I] #\= Countries[J]
    ).

Basically I am generating a list of N variables where N is 100, and then
trying to create an inequality between them for each edge. Just the basic
coloring problem. However, I've been getting out of range error from the
program:

  out of range in arg(5, [_161745{[1 .. 100]}, _161766{[1 .. 100]},
_161787{[1 .. 100]}, _161808{[1 .. 100]}, _161829{[1 .. 100]}, _161850{[1
.. 100]}, _161871{[1 .. 100]}, _161892{[1 .. 100]}, _161913{[1 .. 100]},
_161934{[1 .. 100]}, _161955{[1 .. 100]}, _161976{[1 .. 100]}, _161997{[1
.. 100]}, _162018{[1 .. 100]}, _162039{[1 .. 100]}, _162060{[... .. ...]},
_162081{[...]}, _162102{...}, ...], _163873)

Not sure why it is unable to access the fifth element in this list since it
has 100 items in it.


Volkan
Received on Fri Aug 16 2013 - 23:13:40 CEST

This archive was generated by hypermail 2.2.0 : Sat Aug 17 2013 - 06:13:32 CEST