I take this page as C++ reference: http://www.cppreference.com/wiki/operator_precedence In particular the problem is with operator "not" (also "and" and "or") which has very low precedence in Uppaal (see Help and UTAP library source). For example the following expressions evaluates differently in Uppaal than in C++: "not(true) && false" is true in Uppaal and false in C++. The same holds for "not true && false". We propose to change the precedence of "not" to be the same as "!". Similarly "and" should have precedence the same as "&&" and "or" like "||". Also bitwise not "~" would be nice to include for the sake of completeness.
Created attachment 230 [details] model for testing some operator precedence model for testing some operator precedence
Created attachment 231 [details] queries for testing some operator precedence (both modeling and properties)
Fixed precedence of "not", "and" and "or" on trunk in revision 4508. I suspect there will be more issues, in particular with pre-increment and post-increment (they are treated differently in C++), but I don't see any difference between them in the parser. Also cannot think of an example for now... The bitwise not "~" is possible but it creates a mess with ranges and how many bits are used to encode a particular variable, thus it is not going to be implemented. Better use bitwise xor with explicit number of bits.
The fix looks reasonable :). We can have bit inversion but we would need to check that the range is compatible with the operation, basically lower == -(upper+1).