[prolog] 'if' in prolog?

You should read Learn Prolog Now! Chapter 10.2 Using Cut. This provides an example:

max(X,Y,Z) :- X =< Y,!, Y = Z.

to be said,

Z is equal to Y IF ! is true (which it always is) AND X is <= Y.

Examples related to prolog

Prolog "or" operator, query 'if' in prolog?

Examples related to iso-prolog

'if' in prolog?

Examples related to logical-purity

'if' in prolog?