This issue tracker is closed. Please visit UPPAAL issue tracker at Github instead.

Bug 639

Summary: wrong operator precedence in the documentation
Product: UPPAAL Reporter: Marius Mikučionis <marius>
Component: DocumentationAssignee: Marius Mikučionis <marius>
Status: ASSIGNED ---    
Severity: normal CC: adavid, johnh
Priority: P5    
Version: 4.0.14   
Hardware: All   
OS: All   
Architecture:

Description Marius Mikučionis 2017-08-04 13:46:55 CEST
The 4.0.14 says that the precedence of "not", "and", "or" and "imply" have lower precedence than "!", but the implementation seems to treat them interchangably ("not" is the same as "!").

The behavior of 4.1.19 is consistent with 4.0.14 and the documentation of 4.1.19 reflects that behavior. 

So it seems the issue is only in the documentation of 4.0.14.
Comment 1 Marius Mikučionis 2017-08-04 13:59:28 CEST
Here is a test expression:

not true && false

According to the documentation in 4.0.14 the "&&" operator has higher precedence over "not" and hence the expression should compute to "true", but the implementation computes "false".
The behavior (of computing "false") is consistent with alternative operators in C++ (see http://en.cppreference.com/w/cpp/language/operator_alternative ).
Whereas C does not allow "bool" and other keywords keywords.
Comment 2 Marius Mikučionis 2017-08-04 14:09:53 CEST
Just found that C99 supports the keywords by including the following:

#include <stdbool.h> // bool, true, false
#include <iso646.h>  // not, and, or

The behavior is consistent with C++ (and Uppaal implementation).