title: AMPL Variables in subscripts are not yet allowed
body: <p>I really hope someone can help with this...
  This is what i have in the .mod file</p>
  
  <pre><code>set I := 1..10;
  set J := 1..10;
  set K := 1..2;
  set W := 1..20;
  
  param v{K, W};
  param d{I, J};
  
  var x1, integer;
  var y1, integer;
  var x2, integer;
  var y2, integer;
  var assist{W}, binary;
  </code></pre>
  
  <p>and this is the code generating error:</p>
  
  <pre><code>minimize nome: sum{w in W} (if (assist[w] == 0) then 
                      (if (x1 &gt;= v[1,w]) then 
                          (if (y1 &gt;= v[2,w]) then 
                              (d[x1 - v[1,w],y1 - v[2,w]])....
  </code></pre>
  
  <p>where the error regards the last line and says:</p>
  
  <pre><code>Variables in subscripts are not yet allowed.
  context:  (d[x1 - v[1,w],y1 -  &gt;&gt;&gt; v[2,w]] &lt;&lt;&lt; )
  </code></pre>
  
  <p>this is one of constraints (others are just the same): </p>
  
  <pre><code>subject to rangex1:
  x1 &gt; 0 &amp;&amp; x1 &lt;= 10;
  </code></pre>