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

Bug 639 - wrong operator precedence in the documentation
Summary: wrong operator precedence in the documentation
Status: ASSIGNED
Alias: None
Product: UPPAAL
Classification: Unclassified
Component: Documentation (show other bugs)
Version: 4.0.14
Hardware: All All
: P5 normal
Assignee: Marius Mikučionis
URL:
Depends on:
Blocks:
 
Reported: 2017-08-04 13:46 CEST by Marius Mikučionis
Modified: 2017-08-04 14:09 CEST (History)
2 users (show)

See Also:
Architecture:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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).