Monday, September 1, 2008

GAMS bug in redeclaration

GAMS allows redeclarations of symbols as long as they don't cause a contradiction. I.e. the following is valid GAMS:
set i;
set i /1,2/;
set i(*);

The GAMS compiler gets confused if i is used as domain:
   1  set i;
2 parameter p(i);
3 set i /1,2/;
4 set i(*);
**** $184
**** 184 Domain list redefined

Work-around: make sure line 1 and 4 use both i or i(*).