Disjunction(邏輯 OR)隱式與 explict

Prolog 按照出現的順序嘗試謂詞的替代子句:

likes(alice, music).
likes(bob, hiking).

// Either alice likes music, or bob likes hiking will succeed.

析取(OR)運算子 ; 可用於在一個規則中表達:

likes(P,Q) :-
    ( P = alice , Q = music ) ; ( P = bob , Q = hiking ).

為清楚起見,括號在這裡很重要。有關 , 和 disjunction ;相對優先順序 ,請參閱此問題