[ Control | Reference Manual | Alphabetic Index ]

+Goal1 ; +Goal2

Semicolon (OR) operator - Succeeds if the goal Goal1 succeeds or if the goal Goal2 succeeds.
Goal1
Atom or compound term.
Goal2
Atom or compound term.

Description

Succeeds if either of Goal1 and Goal2 succeeds.

If Goal1 has the special form A -> B (or A *-> B) then the disjunction turns into an if-then-else construct. See those predicates for details.

!/0 cuts through ;/2.

Modes and Determinism

Modules

This predicate is sensitive to its module context (tool predicate, see @/2).

Fail Conditions

Fails if both Goal1 and Goal2 fail

Resatisfiable

Resatisfiable if Goal1 does not contain a literal cut

Examples

Success:
      1 == 2; 2 == 2.

      [eclipse]: (write(a), fail) ; (write(b); write(c)).
      ab
      yes.

      [eclipse]: (write(a); write(b)), write(c).
      ac
      yes.

Fail:
      1 == 2; 3 == 2.



See Also

! / 0, -> / 2, *-> / 2