Order of Evaluation
When you do not use the parentheses to specify the order of evaluation, the operator precedence determine the order. Now compare the expressions below:
NOT (valid AND done) | NOT valid AND done
When the Boolean variables valid and complete the value FALSE, the first expression yields TRUE. Though, the second expression yields FALSE as NOT has a higher precedence than AND. So, the second expression is equivalent to:
(NOT valid) AND done
In the example below, notice that if valid has the value FALSE, the entire expression yields FALSE regardless of the value of done:
valid AND done
Similarly, in the next illustration, when valid has the value TRUE, the entire expression yields TRUE regardless of the value of done:
valid OR done