Home My formal education Article list Prolog Prolog custom operators

Prolog custom operators

E-mail Print
Share/Save/Bookmark
Operator definitions in Prolog look like this:
:- op(Precedence, Type, Name).
%Precedence is a number between 0 and 1200.
%Type is an atom specifying type and associativity of operator
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

Hits: 1224
Comments (0)Add Comment

Write comment

busy
Last Updated ( Friday, 24 October 2008 20:36 )  

Sponsored Links

My friends

Bookingpoint
partner websites

Donate

Do you find content useful? Please donate so I can cover my hosting expenses! Thanks!