In Prolog, custom operators can be defined using
op(+Precedence, +Type, :Operator)
Declares Operator to be an operator of a Type with a Precedence. Operator can also be a list of names in which case all elements of the list are declared to be identical operators.
Precedence is an integer between 0 and 1200, where 0 removes the declaration.
Type is one of:
f indicates the position of the functor and
y indicate the positions of the arguments.
y denotes a term with a precedence lower or equal to the precedence of the functor, whereas
x denotes a strictly lower precedence.
:- op(900, xf, is_true). X_0 is_true :- X_0.
?- dif(X, a) is_true. dif(X, a).