It is possible to find out the associativity and precedence of any operator ---whether
it is a built-in one or a user-defined one--- with the help of ** current_op/3**.
For example, here is how to find out about ** +**:

produces two solutions (if we ask for a further solution after the first one is found). The first solution is the precedence and associativity for unary?- current_op(X,Y,+).X=500

Y=fx ;

X=500

Y=yfx

You will find some strange things amongst the 45 different operator declarations.?- current_op(X,Y,Z),write_op(X,Y,Z),fail.write_op(Precedence,Associativity,Operator):-

write('Operator '),write(Operator),

write(' has precedence '),write(Precedence),

write(' and associativity '),write(Associativity),

nl.

Mon May 24 20:14:48 BST 1999