Prolog custom operators

Operator definitions in Prolog look like this:

There are the following possibilities for what Type may look like:

  • infix xfx, xfy, yfx
  • prefix fx, fy
  • suffix xf, yf


x stands for an argument with lower precedence than operator f
y stands for an argument with lower or equal precedence than operator f

Leave a Reply

Your email address will not be published. Required fields are marked *

Please prove me that you are not spamer :) * Time limit is exhausted. Please reload CAPTCHA.