I just stumbled over the definition of ;/2
in the SWI Prolog Manual which states:
The `or' predicate is defined as:
Goal1 ; _Goal2 :- Goal1.
_Goal1 ; Goal2 :- Goal2.
Wouldn't that mean that ;/2
behaves exactly as if we wrote our own helper predicate consisting of two rules? I had memorized that ;/2
was an impure construct (but it's possible I'm mixing this up with if-then-else) but this definition is pure (although meta-logical).
The semantics of ;/2
are defined in the ISO standard in paragraph 7.8.6 but this is done in terms of manipulation of the current state, choice points etc.
Is the definition in the SWI manual equivalent to the ISO definition? If no, do you know an example where they differ?