Negation as failure Created 2026-10-31 Updated 2026-11-05
Negation as failure interprets failure of a specified proof search as a negative result. In the Prolog operation \+ Goal, the negative goal succeeds when trying Goal fails in finite time; it fails when Goal succeeds. A search that never finishes does not establish the negative result.[ref]
For example, suppose a finite knowledge base records penguin(opus) and has no rule capable of deriving penguin(robin). A search for penguin(robin) finitely fails, so its negation succeeds under this operational rule. That result relies on the chosen knowledge base and search semantics. Adding the missing fact changes the result; an unrecorded fact in the outside world has not been independently disproved.
Stable model semantics gives a related model-based interpretation for negative rule premises through the stable model reduct. The rules and have two stable models, and : in either candidate, the surviving rule forces exactly its one member. Neither atom follows by skeptical entailment. Operational finite failure and a chosen model semantics must therefore be distinguished when interpreting a negative rule.