In older textbooks1 one frequently encounters operator declarations like the following:
?- op(1200,fx,(:-)).
^ ^
These round brackets used to be necessary. But today, they are no longer needed:
| ?- writeq(op(1200,fx,(:-))).
op(1200,fx,:-)
Why are they no longer needed? How does the standard cope with this situation?
1 p.97 6. Standard Operator Declarations of MU-Prolog 3.2db reference manual, appearing in Negation and Control in Prolog by Lee Naish, LNCS 238, Springer-Verlag 1985.
op(1200,fx,:-)
is a compound term in functional notation.Quoting 6.3.3 Compound terms --- functional notation:
Quoting 6.3.3.1 Arguments:
Due to above highlighted case
arg = atom;
,:-
does not need round brackets inop(1200,fx,:-)
.If it were not for above special case, we would need round brackets, as the derivation would have to follow 6.3.1.3 Atoms: