The standard predicate fail_if/1 is compiled by the XSB compiler.
Exceptions:
not(P) :- call(P), !, fail. not(_). |
Argument P must be ground for sound negation, although no runtime checks are made by the system.
Note that in contrast to the other two kinds of negation as failure ( and fail_if/1), predicate not/1 is not compiled by the compiler but the above definition is used.
Exceptions: The same as call/1 (see Section 6.8).
Exceptions:
... :- ..., sk_not(p(X)), ...is equivalent to
... :- ..., tnot(pp), ...where pp is a new proposition. Thus, the unbound variable X is treated as .
pp :- p(X).
If +P is a non-tabled predicate ensures that +P is ground and called via a tabled predicate so that sk_not/1 can be used with non-tabled predicates as well, regardless of whether +P is ground or not.
(P -> Q ; R) :- P, !, Q. (P -> Q ; R) :- R. |
repeat. repeat :- repeat. |