next up previous contents
Next: Prefix Up: The Three Forms Previous: The Three Forms

Infix

Here are some examples of arithmetic expressions that use infix operators:

All the infix operators used in the above are necessarily binary operators --- i.e. they have an arity of 2. Each of the above terms can be rewritten in `regular' Prolog syntax as

Remember that the use of the inequality operators requires that both arguments are evaluated before unification is applied. For is/2, only the second argument is evaluated before unification is applied.

Here are some examples of infix operators used in the basic syntax of Prolog clauses.

These infix operators are also binary. Here are their regular forms.

Note how the functor ,/2 has to be `protected' with single quotes as in ','.



Paul Brna
Mon May 24 20:14:48 BST 1999