10 Mar 2005
CS 3243 - FOL and Prolog
36
Examples of operator properties
lProlog has shortcuts in notation for certain operators (especially arithmetic ones)
l
lPosition Operator Syntax Normal Syntax
lPrefix: -2 -(2)
lInfix: 5+17 +(17,5)
l
lAssociativity: left, right, none.
l X+Y+Z    is parsed as  (X+Y)+Z
lbecause addition is left-associative.
l
lPrecedence: an integer.
lX+Y*Z   is parsed as  X+(Y*Z)
lbecause multiplication has higher precedence.
These are all the same as the normal rules of arithmetic.