[ ECLiPSe Control built-in.|Group Index| Full Index]

\+ +Goal

Succeeds if Goal cannot be satisfied. Uses negation as failure (synonym of not/1 and fail_if/1).

+Goal
Goal.

Description

Used to fail if the goal Goal can be satisfied. Uses the standard Prolog form of negation as failure.

May be used to check whether a call Goal succeeds without binding variables, the call \+ \+ Goal can be used.

Note that:

!/0 does not cut through \+/1.

Fail Conditions

Fails if Goal succeeds.

Resatisfiable

No.

Exceptions

Examples


Success:
      \+ fail.
      \+ 1 == 2.
      \+ X == 1.
      \+ \+ X = 1.
          % does not bind X
Fail:
      \+ X = 1.
      \+ true.
      \+ 3 == 3.


See Also

fail_if / 1, not / 1, ~ / 1