[ Control | The ECLiPSe Built-In Predicates | 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 succeed.

Note that:

!/0 cuts through ;/2.

Fail Conditions

Fails if both Goal1 and Goal2 fail.

Resatisfiable

Yes.

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