the following code is detected as non-side-effect-free when used in guard: int getIndex(const int &set[MAXLEN], const int &v) { int i; for (i=0; i<MAXLEN; ++i) // iterate through entire array if (v == set[i]) return i; return -1; } the function works fine when reference symbol is removed (which means value passing by value instead of faster passing by reference).
This is strictly speaking not a bug in UPPAAL, but a problem in the language. The problem is with the array parameter only; it is not a reference to a constant array of integers, but a reference to an array of constant integers. Therefore the type checker does not realise that the argument cannot be modified by the function. I will try to make a workaround for this.
Fixed on the 4.0 branch from rev. 2429.
Fixed on the trunk from rev. 2853.