The associativity and precedence of an operator is a part of the definition of the programming language; different programming languages may have different associativity and precedence for the same type of operator.
If the operator is non-associative, the expression might be a syntax error, or it might have some special meaning.
For example, subtraction and division, as used in conventional math notation, are inherently left-associative.
An operation that is not mathematically associative, however, must be notationally left-, right-, or non-associative.
In order to reflect normal usage, addition, subtraction, multiplication, and division operators are usually left-associative,[1][2][3] while for an exponentiation operator (if present)[4][better source needed] there is no general agreement.
A parser reading the tokens from left to right would apply the associativity rule to a branch, because of the right-associativity of ^, in the following way: This can then be evaluated depth-first, starting at the top node (the first ^): A left-associative evaluation would have resulted in the parse tree ((5^4)^3)^2 and the completely different result (6253)2 = 244,140,6252 ≈ 5.9604645×1016.
In Prolog the infix operator :- is non-associative because constructs such as "a :- b :- c" constitute syntax errors.
Another possibility is that sequences of certain operators are interpreted in some other way, which cannot be expressed as associativity.
This generally means that syntactically, there is a special rule for sequences of these operations, and semantically the behavior is different.