Negation as failure

From Wikipedia, the free encyclopedia

Negation as failure (NAF, for short) is a non-monotonic inference rule in logic programming, used to derive not~p from failure to derive p. It has been an important feature of logic programming since the earliest days of both Planner and Prolog. In Prolog, it is usually implemented using Prolog's extralogical constructs.

In pure Prolog, NAF literals of the form not~p can occur in the body of clauses and can be used to derive other NAF literals. For example, given only the four clauses

p \leftarrow q \and not~r
q \leftarrow s
q \leftarrow t
t \leftarrow

NAF derives not~s, not~r and not~p.

Contents

The semantics of NAF remained an open issue until Keith Clark [1978] showed that it is correct with respect to the completion of the logic program, where, loosely speaking, "only" and \leftarrow are interpreted as "if and only if", written as "iff" or "\equiv".

For example, the completion of the four clauses above is

p \equiv q \and not~r
q \equiv s \or t
t \equiv true
r \equiv false
s \equiv false

The NAF inference rule simulates reasoning explicitly with the completion, where both sides of the equivalence are negated and negation on the right-hand side is distributed down to atomic formulae. For example, to show not~p, NAF simulates reasoning with the equivalences

not~p \equiv not~q \or r
not~q \equiv not~s \and not~t
not~t \equiv false
not~r \equiv true
not~s \equiv true

In the non-propositional case, the completion needs to be augmented with equality axioms, to formalise the assumption that individuals with distinct names are distinct. NAF simulates this by failure of unification. For example, given only the two clauses

p(a) \leftarrow
p(b) \leftarrow

NAF derives not~p(c).

The completion of the program is

p(X) \equiv X=a \or X=b

augmented with unique names axioms and domain closure axioms.

The completion semantics is closely related both to circumscription and to the closed world assumption.

The completion semantics justifies interpreting the result not~p of a NAF inference as the classical negation \neg~p of p. However, Michael Gelfond [1987] showed that it is also possible to interpret not~p literally as "p can not be shown", "p is not known" or "p is not believed", as in autoepistemic logic. The autoepistemic interpretation was developed further by Gelfond and Lifschitz [1988] and is the basis of answer set programming.

The autoepistemics semantics of a pure Prolog program P with NAF literals is obtained by "expanding" P with a set of ground (variable-free) NAF literals Δ that is stable in the sense that

Δ = {not~p | p is not implied by P ∪ Δ}

In other words, a set of assumptions Δ about what can not be shown is stable if and only if Δ is the set of all sentences that truely can not be shown from the program P expanded by Δ. Here, because of the simple syntax of pure Prolog programs, "implied by" can be understood very simply as derivability using modus ponens and universal instantiation alone.

A program can have zero, one or more stable expansions. For example

p \leftarrow  not~p
has no stable expansions.

p \leftarrow  not~q
has exactly one stable expansion Δ = {not~q}

p \leftarrow  not~q
q \leftarrow  not~p
has exactly two stable expansions Δ1 = {not~p} and Δ2 = {not~q}.

The autoepistemic interpretation of NAF can be combined with classical negation, as in extended logic programming and answer set programming. Combining the two negations, it is possible to express, for example

\neg p \leftarrow not~p (the closed world assumption) and
p \leftarrow not~\neg p (p holds by default).

  • K. Clark [1978, 1987]. Negation as failure. Readings in nonmonotonic reasoning, Morgan Kaufmann Publishers, pages 311 - 325.

  • Report from the W3C Workshop on Rule Languages for Interoperability. Includes notes on NAF and SNAF (scoped negation as failure).
Advanced Search
Included Web Search Engines


Safe Search

close

Top Matching Results

Occasionally Search.com will highlight specialized results that are based on the context of your query. Examples of specialized results include specific links to news, images, or video.

Top Matching Results may highlight information from other Search.com pages, content from the CNET Network of sites, or third party content. The listings are based purely on relevance. Search.com does not receive payment for listings in this section but our partners that provide this data may get paid for listing these products.

Sponsored Links

This section contains paid listings which have been purchased by companies that want to have their sites appear for specific search terms and related content. These listings are administered, sorted and maintained by a third party and are not endorsed by Search.com.

Search Results

Search.com sends your search query to several search engines at one time and integrates the results into one list which has been sorted by relevance using Search.com's proprietary algorithm. You can customize the list of search engines included in your metasearch from the preferences.

The search engines that are used in your metasearch may allow companies to pay to have their Web sites included within the results. To view the Paid Inclusion policy for a specific search engine, please visit their Web site. Search.com does not accept payment or share revenue with any search engine partner for listings in this section.